api

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHeaderString added in v0.5.6

func GetHeaderString(ctx context.Context, headerKey string) string

func SupportedHeaders added in v0.5.6

func SupportedHeaders(cfg HeadersConfig) map[string]bool

Types

type AlertService

type AlertService interface {
	CreateAlerts(ctx context.Context, providerType string, providerID uint64, namespaceID uint64, body map[string]interface{}) ([]alert.Alert, int, error)
	List(context.Context, alert.Filter) ([]alert.Alert, error)
}

type Deps

type Deps struct {
	TemplateService     TemplateService
	RuleService         RuleService
	AlertService        AlertService
	ProviderService     ProviderService
	NamespaceService    NamespaceService
	ReceiverService     ReceiverService
	SubscriptionService SubscriptionService
	NotificationService NotificationService
}

type HeadersConfig added in v0.5.6

type HeadersConfig struct {
	IdempotencyKey string `mapstructure:"idempotency_key" yaml:"idempotency_key" default:"Idempotency-Key"`
}

type NotificationService

type NotificationService interface {
	DispatchToReceiver(ctx context.Context, n notification.Notification, receiverID uint64) error
	DispatchToSubscribers(ctx context.Context, namespaceID uint64, n notification.Notification) error
	CheckAndInsertIdempotency(ctx context.Context, scope, key string) (uint64, error)
	MarkIdempotencyAsSuccess(ctx context.Context, id uint64) error
	RemoveIdempotencies(ctx context.Context, TTL time.Duration) error
}

type ReceiverService

type ReceiverService interface {
	List(ctx context.Context, flt receiver.Filter) ([]receiver.Receiver, error)
	Create(ctx context.Context, rcv *receiver.Receiver) error
	Get(ctx context.Context, id uint64, gopts ...receiver.GetOption) (*receiver.Receiver, error)
	Update(ctx context.Context, rcv *receiver.Receiver) error
	Delete(ctx context.Context, id uint64) error
}

type RuleService

type RuleService interface {
	Upsert(context.Context, *rule.Rule) error
	List(context.Context, rule.Filter) ([]rule.Rule, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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