servicelogmgmt

package
v0.0.0-...-8c930d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(ctx context.Context) error

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址