spec

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertingClientSet

type AlertingClientSet interface {
	HashRing
	Purge(ctx context.Context) error
	Conditions() ConditionStorage
	Endpoints() EndpointStorage
	Routers() RouterStorage
	States() StateStorage
	Incidents() IncidentStorage
}

type AlertingIncidentTracker

type AlertingIncidentTracker[T interfaces.AlertingSecret] interface {
	AlertingStorage[T]
	OpenInterval(ctx context.Context, conditionId, fingerprint string, start *timestamppb.Timestamp) error
	CloseInterval(ctx context.Context, conditionId, fingerprint string, end *timestamppb.Timestamp) error
	GetActiveWindowsFromIncidentTracker(
		ctx context.Context,
		conditionId string,
		start,
		end *timestamppb.Timestamp,
	) ([]*alertingv1.ActiveWindow, error)
}

type AlertingSecretStorage

type AlertingSecretStorage[T interfaces.AlertingSecret] interface {
	AlertingStorage[T]
}

type AlertingStateCache

type AlertingStateCache[T interfaces.AlertingSecret] interface {
	AlertingStorage[T]
	IsDiff(ctx context.Context, key string, value T) bool
	LastKnownChange(ctx context.Context, key string) (*timestamppb.Timestamp, error)
}

type AlertingStorage

type AlertingStorage[T any] interface {
	Put(ctx context.Context, key string, value T) error
	Get(ctx context.Context, key string, opts ...opts.RequestOption) (T, error)
	Delete(ctx context.Context, key string) error
	ListKeys(ctx context.Context) ([]string, error)
	List(ctx context.Context, opts ...opts.RequestOption) ([]T, error)
}

type AlertingStoreBroker

type AlertingStoreBroker interface {
	NewClientSet() AlertingClientSet
	// Use applies a specific storage client to the matching storage client in the clientset
	//
	// It is also responsible for migrating existing data if there is an existing store
	// of the same type already in use by the clientset
	Use(store any)
}

type HashRing

type HashRing interface {
	GetHash(ctx context.Context, key string) (string, error)
	// Sync reads from the client set and updates the router storage in the appropriate way
	// It returns the router keys that have changed.
	Sync(ctx context.Context, opts ...opts.SyncOption) (routerKeys []string, err error)
	ForceSync(ctx context.Context, opts ...opts.SyncOption) error
}

HashRing Hash ring uniquely maps groups of objects to a (key, hash) pairs

type PartitionedAlertingStorage

type PartitionedAlertingStorage[T interfaces.AlertingSecret] interface {
	Group(id string) AlertingSecretStorage[T]
	ListGroups(ctx context.Context) ([]string, error)
}

type RouterStorage

type RouterStorage = AlertingStorage[routing.OpniRouting]

Jump to

Keyboard shortcuts

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