Versions in this module Expand all Collapse all v0 v0.1.0 Dec 5, 2025 Changes in this version + const EventLoginFailed + const EventLoginSuccess + func LookupIPLocation(ip string) string + func NewSweepCommand() *cobra.Command + func NewWatchCommand() *cobra.Command + func RunSweep(ctx context.Context, opts SweepOptions) error + func RunWatch(ctx context.Context, opts WatchOptions) error + func ValidateChannelConfig(ch *ChannelConfig) error + type ChannelConfig struct + Curl *CurlConfig + Email *EmailConfig + Enabled bool + Name string + Type string type Config + Channels []ChannelConfig + func (c *Config) GetEnabledChannels() []ChannelConfig + type CurlConfig struct + Command string + type CurlNotifier struct + func NewCurlNotifier(curlCmd string) (*CurlNotifier, error) + func (c *CurlNotifier) Send(event LoginEvent) error + func (c *CurlNotifier) Test() error + type CurlRequest struct + Body string + Headers map[string]string + Method string + URL string + func ParseCurl(curlCmd string) (*CurlRequest, error) + func (r *CurlRequest) Execute(data any) (*http.Response, error) + type CursorStore struct + func NewCursorStore(path string) (*CursorStore, error) + func (c *CursorStore) Load() (*SourceState, error) + func (c *CursorStore) Save(state *SourceState) error + type EmailConfig struct + From string + Pass string + Port int + Server string + To string + User string + type EmailInput struct + From string + Name string + Pass string + Port int + Server string + To string + User string type EmailNotifier + func NewEmailNotifierFromChannel(cfg *EmailConfig) *EmailNotifier + type IPLookup struct + func GetIPLookup() *IPLookup + func (l *IPLookup) Lookup(ip string) string + type IPLookupProvider interface + Lookup func(ctx context.Context, ip string) (*IPLookupResult, error) + Name func() string + type IPLookupResult struct + City string + Country string + Region string + func (r *IPLookupResult) String() string type LoginEvent + HostIP string + LogPath string + Message string + Method string + Port int + type NotifyOn string + const NotifyOnAll + const NotifyOnFailed + const NotifyOnSuccess + type SourceState struct + FileOffsets map[string]int64 + JournalCursor string + type SweepOptions struct + CursorPath string + DisplayLoc *time.Location + FailLimit int + FailWindow time.Duration + JournalUnits []string + LogPaths []string + Notify bool + NotifyOn NotifyOn + Since time.Duration + Source string + type WatchOptions struct + CursorPath string + DisplayLoc *time.Location + FailLimit int + FailWindow time.Duration + JournalUnits []string + LogPaths []string + NotifyOn NotifyOn + PollTimeout time.Duration + Source string v0.0.2 Dec 30, 2024 Changes in this version + var ErrConfigInvalid = fmt.Errorf("invalid notification configuration") + var ErrConfigNotFound = fmt.Errorf("notification configuration not found") + var ErrNotEnabled = fmt.Errorf("notification is not enabled") + var ErrNotificationFailed = fmt.Errorf("notification failed to send") + func NewCommand() *cobra.Command + func ValidateConfig(cfg *Config) error + type Config struct + EmailFrom string + EmailTo string + Enabled bool + SMTPPass string + SMTPPort int + SMTPServer string + SMTPUser string + Type string + WebhookURL string + type ConfigError struct + Field string + Message string + func (e *ConfigError) Error() string + type ConfigManager struct + func NewConfigManager() *ConfigManager + func (cm *ConfigManager) BackupConfig() error + func (cm *ConfigManager) DeleteConfig() error + func (cm *ConfigManager) LoadConfig() (*Config, error) + func (cm *ConfigManager) RestoreConfig() error + func (cm *ConfigManager) SaveConfig(cfg Config) error + type ConfigValidator interface + Validate func() error + type EmailNotifier struct + From string + Password string + Port int + Server string + To string + Username string + func NewEmailNotifier(config Config) *EmailNotifier + func (e *EmailNotifier) Send(event LoginEvent) error + func (e *EmailNotifier) Test() error + type LoginEvent struct + Hostname string + IP string + Location string + Timestamp time.Time + Type string + User string + type Notifier interface + Send func(event LoginEvent) error + Test func() error + type NotifyType int + const NotifyTypeEmail + const NotifyTypeWebhook + type ValidationError struct + Errors []ConfigError + func (e *ValidationError) AddError(field, message string) + func (e *ValidationError) Error() string + func (e *ValidationError) HasErrors() bool + type WebhookNotifier struct + URL string + func NewWebhookNotifier(url string) *WebhookNotifier + func (w *WebhookNotifier) Send(event LoginEvent) error + func (w *WebhookNotifier) Test() error