Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Warning ¶
type Warning struct {
ID int64 `json:"-"`
UUID uuid.UUID `json:"uuid" db:"primary=yes"`
Type api.WarningType `json:"type"`
Scope string `json:"scope"`
EntityType string `json:"entity_type"`
Entity string `json:"entity"`
Status api.WarningStatus `json:"status"`
FirstOccurrence time.Time `json:"first_occurrence"`
LastOccurrence time.Time `json:"last_occurrence"`
LastUpdated time.Time `json:"last_updated" db:"update_timestamp"`
Messages []string `json:"messages" db:"marshal=json"`
Count int
}
func NewWarning ¶
func NewWarning(warningType api.WarningType, scope api.WarningScope, message string) Warning
type WarningEmitter ¶ added in v0.6.4
type WarningFilter ¶
type WarningRepo ¶
type WarningRepo interface {
Upsert(ctx context.Context, w Warning) (int64, error)
GetAll(ctx context.Context) (Warnings, error)
GetByScopeAndType(ctx context.Context, scope api.WarningScope, wType api.WarningType) (Warnings, error)
GetByUUID(ctx context.Context, id uuid.UUID) (*Warning, error)
Update(ctx context.Context, id uuid.UUID, w Warning) error
DeleteByUUID(ctx context.Context, id uuid.UUID) error
}
type WarningService ¶
type WarningService interface {
GetAll(ctx context.Context) (Warnings, error)
GetByScopeAndType(ctx context.Context, scope api.WarningScope, wType api.WarningType) (Warnings, error)
GetByUUID(ctx context.Context, id uuid.UUID) (*Warning, error)
UpdateStatusByUUID(ctx context.Context, id uuid.UUID, status api.WarningStatus) (*Warning, error)
DeleteByUUID(ctx context.Context, id uuid.UUID) error
WarningEmitter
}
func NewWarningService ¶
func NewWarningService(repo WarningRepo, opts ...WarningServiceOption) WarningService
type WarningServiceOption ¶
type WarningServiceOption func(s *warningService)
func WithWarningServiceNow ¶
func WithWarningServiceNow(nowFunc func() time.Time) WarningServiceOption
Click to show internal directories.
Click to hide internal directories.