alerter

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert interface {
	Message() string
	ShouldIgnoreResource() bool
}

type Alerter

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

func NewAlerter

func NewAlerter() *Alerter

func (*Alerter) IsResourceIgnored

func (a *Alerter) IsResourceIgnored(res *resource.Resource) bool

func (*Alerter) Retrieve

func (a *Alerter) Retrieve() Alerts

func (*Alerter) SendAlert

func (a *Alerter) SendAlert(key string, alert Alert)

func (*Alerter) SetAlerts

func (a *Alerter) SetAlerts(alerts Alerts)

type AlerterInterface

type AlerterInterface interface {
	SendAlert(key string, alert Alert)
}

type Alerts

type Alerts map[string][]Alert

type FakeAlert

type FakeAlert struct {
	Msg            string
	IgnoreResource bool
}

func (*FakeAlert) Message

func (f *FakeAlert) Message() string

func (*FakeAlert) ShouldIgnoreResource

func (f *FakeAlert) ShouldIgnoreResource() bool

type SerializableAlert

type SerializableAlert struct {
	Alert
}

func (*SerializableAlert) MarshalJSON

func (s *SerializableAlert) MarshalJSON() ([]byte, error)

func (*SerializableAlert) UnmarshalJSON

func (s *SerializableAlert) UnmarshalJSON(bytes []byte) error

type SerializedAlert

type SerializedAlert struct {
	Msg string `json:"message"`
}

func (*SerializedAlert) Message

func (u *SerializedAlert) Message() string

func (*SerializedAlert) ShouldIgnoreResource

func (u *SerializedAlert) ShouldIgnoreResource() bool

Jump to

Keyboard shortcuts

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