notifier

package
v0.0.0-...-24555ab Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MaxNumPerBatch = 64

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Name         string            `json:"name"`
	Labels       map[string]string `json:"labels"`
	Annotations  map[string]string `json:"annotations"`
	StartsAt     time.Time         `json:"startsAt,omitempty"`
	EndsAt       time.Time         `json:"endsAt,omitempty"`
	GeneratorURL string            `json:"generatorURL,omitempty"`
}

type AlertManager

type AlertManager struct {
	Endpoint string
	// contains filtered or unexported fields
}

func NewAlertManager

func NewAlertManager(addr string, distribution bool) *AlertManager

func (*AlertManager) Send

func (a *AlertManager) Send(ctx context.Context, b []byte, alertName string) error

type Limiter

type Limiter interface {
	//Allow() bool
	//AllowN(now time.Time, n int) bool
	Wait(ctx context.Context) error
}

type NotifyManager

type NotifyManager struct {
	QueueCapacity int
	// contains filtered or unexported fields
}

func NewManager

func NewManager(done chan interface{}, amAddr string, isDistribution bool) *NotifyManager

func (*NotifyManager) Consume

func (m *NotifyManager) Consume() []*Alert

func (*NotifyManager) Run

func (m *NotifyManager) Run()

func (*NotifyManager) Send

func (m *NotifyManager) Send(alerts ...*Alert)

Jump to

Keyboard shortcuts

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