notice

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notice

type Notice struct {
	Type    Type
	Message string
	Details string
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store allows identifying notices for various targets.

func NewStore

func NewStore(ctx context.Context, db *sql.DB) (*Store, error)

NewStore creates a new DB and prepares all necessary SQL statements.

func (*Store) FindAllPolicyNotices

func (s *Store) FindAllPolicyNotices(ctx context.Context, policyID string) ([]Notice, error)

FindAllPolicyNotices sets a notice for a Policy if it is not assigned to any services.

func (*Store) FindAllServiceNotices added in v0.31.0

func (s *Store) FindAllServiceNotices(ctx context.Context, serviceID string) ([]Notice, error)

FindAllServiceNotices returns any relevant notices for the given service. Currently returns notices pertaining to the system limit for unacknowledged alerts.

type Type

type Type int

Type NoticeType represents the level of severity of a Notice.

const (
	TypeWarning Type = iota
	TypeError
	TypeInfo
)

Defaults to Warning when unset

func (Type) MarshalGQL

func (t Type) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (Type) String

func (i Type) String() string

func (*Type) UnmarshalGQL

func (t *Type) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Marshaler interface

Jump to

Keyboard shortcuts

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