{"modulePath":"github.com/function61/lambda-alertmanager","version":"v1.0.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package amstate\n\n## Constants\n\n```go\nconst (\n\tStream = \"/alertmanager\"\n)\n```\n\n## Functions\n\n```go\nfunc HasAlertWithId(id string, alerts []Alert) bool\n```\n\n```go\nfunc NewAlertId() string\n```\n\n```go\nfunc NewHttpMonitorId() string\n```\n\n## Types\n\n```go\ntype Alert struct {\n\tId        string    `json:\"alert_key\"` // name in JSON for backwards compat\n\tSubject   string    `json:\"subject\"`   // same type of error should always have same subject\n\tDetails   string    `json:\"details\"`\n\tTimestamp time.Time `json:\"timestamp\"`\n}\n```\n\n```go\nfunc FindAlertWithSubject(subject string, alerts []Alert) *Alert\n```\n\n```go\nfunc GetUnnoticedAlerts(alerts []Alert, now time.Time) []Alert\n```\nunnoticed = not acked within 4 hours\n\n```go\ntype App struct {\n\tState  *Store\n\tReader *ehreader.Reader\n\tWriter ehclient.Writer\n\tLogger *log.Logger\n}\n```\n\n```go\nfunc LoadUntilRealtime(\n\tctx context.Context,\n\ttenantCtx *ehreader.TenantCtxWithSnapshots,\n\tlogger *log.Logger,\n) (*App, error)\n```\n\n```go\nfunc (a *App) AppendAfter(ctx context.Context, cur ehclient.Cursor, events ...ehevent.Event) error\n```\nhelper\n\n```go\ntype DeadMansSwitch struct {\n\tSubject string    `json:\"subject\"`\n\tTtl     time.Time `json:\"ttl\"`\n}\n```\n\n```go\nfunc FindDeadMansSwitchWithSubject(subject string, dmss []DeadMansSwitch) *DeadMansSwitch\n```\n\n```go\nfunc GetExpiredDeadMansSwitches(switches []DeadMansSwitch, now time.Time) []DeadMansSwitch\n```\n\n```go\ntype HttpMonitor struct {\n\tId      string    `json:\"id\"`\n\tCreated time.Time `json:\"created\"`\n\tEnabled bool      `json:\"enabled\"`\n\tUrl     string    `json:\"url\"`\n\tFind    string    `json:\"find\"`\n}\n```\n\n```go\nfunc EnabledHttpMonitors(monitors []HttpMonitor) []HttpMonitor\n```\n\n```go\nfunc FindHttpMonitorWithId(id string, monitors []HttpMonitor) *HttpMonitor\n```\n\n```go\ntype Store struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New(tenant ehreader.Tenant, logger *log.Logger) *Store\n```\n\n```go\nfunc (s *Store) ActiveAlerts() []Alert\n```\n\n```go\nfunc (s *Store) DeadMansSwitches() []DeadMansSwitch\n```\n\n```go\nfunc (s *Store) GetEventTypes() ehevent.Allocators\n```\n\n```go\nfunc (s *Store) HttpMonitors() []HttpMonitor\n```\n\n```go\nfunc (s *Store) InstallSnapshot(snap *ehreader.Snapshot) error\n```\n\n```go\nfunc (s *Store) LastUnnoticedAlertsNotified() time.Time\n```\n\n```go\nfunc (s *Store) ProcessEvents(_ context.Context, processAndCommit ehreader.EventProcessorHandler) error\n```\n\n```go\nfunc (s *Store) Snapshot() (*ehreader.Snapshot, error)\n```\n\n```go\nfunc (s *Store) Version() ehclient.Cursor\n```\n\n","path":"github.com/function61/lambda-alertmanager/pkg/amstate","name":"amstate","synopsis":"","isRedistributable":true}
