Documentation
¶
Overview ¶
Package lastlogin provides last login tracking capabilities (reserved module).
Index ¶
Constants ¶
View Source
const (
ModelLastLogins = "last_logins"
)
View Source
const PluginID = "lastlogin"
Variables ¶
Functions ¶
func RegisterSchema ¶
RegisterSchema registers the last_logins model with the unified schema.
Types ¶
type LastLogin ¶
type LastLogin interface {
Record(ctx context.Context, rec *Record) error
Get(ctx context.Context, userID string) (*Record, error)
}
LastLogin defines the service capability to track and query authentication history.
type Record ¶
type Record struct {
UserID string `json:"user_id"`
AccountID string `json:"account_id,omitempty"`
Method string `json:"method"`
IP string `json:"ip,omitempty"`
UserAgent string `json:"user_agent,omitempty"`
LoggedInAt time.Time `json:"logged_in_at"`
}
Record captures metadata of a user's latest authentication.
Click to show internal directories.
Click to hide internal directories.