alerter

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 15

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
	Resource() *resource.Resource
}

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) Resource added in v0.38.0

func (f *FakeAlert) Resource() *resource.Resource

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) Resource added in v0.38.0

func (s *SerializedAlert) Resource() *resource.Resource

func (*SerializedAlert) ShouldIgnoreResource

func (u *SerializedAlert) ShouldIgnoreResource() bool

type UnsupportedResourcetypeAlert added in v0.38.2

type UnsupportedResourcetypeAlert struct {
	Typ string
}

func NewUnsupportedResourcetypeAlert added in v0.38.2

func NewUnsupportedResourcetypeAlert(typ string) *UnsupportedResourcetypeAlert

func (*UnsupportedResourcetypeAlert) Message added in v0.38.2

func (f *UnsupportedResourcetypeAlert) Message() string

func (*UnsupportedResourcetypeAlert) Resource added in v0.38.2

func (*UnsupportedResourcetypeAlert) ShouldIgnoreResource added in v0.38.2

func (f *UnsupportedResourcetypeAlert) ShouldIgnoreResource() bool

Jump to

Keyboard shortcuts

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