Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cleanup ¶
Cleanup deletes operation and login logs older than the configured retention (config key logmgmt.retention / LOGMGMT_RETENTION, 90 days by default). Errors surface to the cronjob runner instead of being swallowed: a log table that stops being trimmed must alarm, not rot silently.
It runs on the context of its cron round, so its statements and log lines carry the round's identity. The add path registers it through module/logmgmt; projects using copied logmgmt source register it in their own cronjob setup, for example cronjob.Register(servicelogmgmt.Cleanup, "0 0 * * * *", "logmgmt_cleanup").
func RecordLoginEvent ¶
func RecordLoginEvent(ctx *gst.ServiceContext, event authn.LoginEvent)
RecordLoginEvent persists one login lifecycle event as a LoginLog row. It is the observer added through authn.AddLoginObserver: module/logmgmt adds it on the add path, and project-owned assembly code adds it on the copy path. Nothing here adds itself, so login recording is never started by a package import alone — and adding it twice would record every event twice, because observers multicast.
Observers never block or fail the login itself, so a failed insert is only logged. The user-agent columns hold the "<name> <version>" and "<platform> <os>" renderings.
Types ¶
type LoginLogService ¶
type LoginLogService struct {
service.Base[*modellogmgmt.LoginLog, *modellogmgmt.LoginLog, *modellogmgmt.LoginLog]
}
LoginLogService backs the add-path module registration of the built-in CRUD routes. The copy path does not need it: copied model Design generates the same built-in routes without a service shell.
type OperationLogService ¶
type OperationLogService struct {
service.Base[*modellogmgmt.OperationLog, *modellogmgmt.OperationLog, *modellogmgmt.OperationLog]
}