Documentation ¶
Index ¶
- func NewConditionKeyStore(js nats.JetStreamContext) nats.KeyValue
- func NewEndpointKeyStore(js nats.JetStreamContext) nats.KeyValue
- func NewIncidentKeyStore(js nats.JetStreamContext) nats.KeyValue
- func NewRouterObjectStore(js nats.JetStreamContext) nats.ObjectStore
- func NewStatusCache(js nats.JetStreamContext) nats.KeyValue
- type AlertingClientSet
- type AlertingIncidentTracker
- type AlertingSecretStorage
- type AlertingStateCache
- type AlertingStorage
- type AlertingStoreBroker
- type CompositeAlertingBroker
- type CompositeAlertingClientSet
- func (c *CompositeAlertingClientSet) CalculateHash(ctx context.Context, key string, syncOptions *storage_opts.SyncOptions) error
- func (c CompositeAlertingClientSet) Conditions() ConditionStorage
- func (c CompositeAlertingClientSet) Endpoints() EndpointStorage
- func (c *CompositeAlertingClientSet) ForceSync(ctx context.Context, incomingOpts ...storage_opts.SyncOption) error
- func (c *CompositeAlertingClientSet) GetHash(_ context.Context, key string) string
- func (c CompositeAlertingClientSet) Incidents() IncidentStorage
- func (c *CompositeAlertingClientSet) Purge(ctx context.Context) error
- func (c CompositeAlertingClientSet) Routers() RouterStorage
- func (c CompositeAlertingClientSet) States() StateStorage
- func (c *CompositeAlertingClientSet) Sync(ctx context.Context, incomingOpts ...storage_opts.SyncOption) ([]string, error)
- type ConditionStorage
- type EndpointStorage
- type HashRing
- type IncidentStorage
- type RouterStorage
- type StateStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConditionKeyStore ¶
func NewConditionKeyStore(js nats.JetStreamContext) nats.KeyValue
func NewEndpointKeyStore ¶
func NewEndpointKeyStore(js nats.JetStreamContext) nats.KeyValue
func NewIncidentKeyStore ¶
func NewIncidentKeyStore(js nats.JetStreamContext) nats.KeyValue
func NewRouterObjectStore ¶
func NewRouterObjectStore(js nats.JetStreamContext) nats.ObjectStore
func NewStatusCache ¶
func NewStatusCache(js nats.JetStreamContext) nats.KeyValue
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 CompositeAlertingBroker ¶
type CompositeAlertingBroker struct { opts.ClientSetOptions *CompositeAlertingClientSet }
func NewCompositeAlertingBroker ¶
func NewCompositeAlertingBroker(options opts.ClientSetOptions) *CompositeAlertingBroker
func (*CompositeAlertingBroker) NewClientSet ¶
func (c *CompositeAlertingBroker) NewClientSet() AlertingClientSet
func (*CompositeAlertingBroker) Use ¶
func (c *CompositeAlertingBroker) Use(store any)
type CompositeAlertingClientSet ¶
type CompositeAlertingClientSet struct { Logger *zap.SugaredLogger // contains filtered or unexported fields }
func (*CompositeAlertingClientSet) CalculateHash ¶
func (c *CompositeAlertingClientSet) CalculateHash(ctx context.Context, key string, syncOptions *storage_opts.SyncOptions) error
func (CompositeAlertingClientSet) Conditions ¶
func (c CompositeAlertingClientSet) Conditions() ConditionStorage
func (CompositeAlertingClientSet) Endpoints ¶
func (c CompositeAlertingClientSet) Endpoints() EndpointStorage
func (*CompositeAlertingClientSet) ForceSync ¶
func (c *CompositeAlertingClientSet) ForceSync(ctx context.Context, incomingOpts ...storage_opts.SyncOption) error
Based on the other storage, calculate what the virtual config should be, then overwrite the virtual config storage
func (*CompositeAlertingClientSet) GetHash ¶
func (c *CompositeAlertingClientSet) GetHash(_ context.Context, key string) string
func (CompositeAlertingClientSet) Incidents ¶
func (c CompositeAlertingClientSet) Incidents() IncidentStorage
func (*CompositeAlertingClientSet) Purge ¶
func (c *CompositeAlertingClientSet) Purge(ctx context.Context) error
func (CompositeAlertingClientSet) Routers ¶
func (c CompositeAlertingClientSet) Routers() RouterStorage
func (CompositeAlertingClientSet) States ¶
func (c CompositeAlertingClientSet) States() StateStorage
func (*CompositeAlertingClientSet) Sync ¶
func (c *CompositeAlertingClientSet) Sync(ctx context.Context, incomingOpts ...storage_opts.SyncOption) ([]string, error)
type ConditionStorage ¶
type ConditionStorage = AlertingSecretStorage[*alertingv1.AlertCondition]
type EndpointStorage ¶
type EndpointStorage = AlertingSecretStorage[*alertingv1.AlertEndpoint]
type HashRing ¶
type HashRing interface { CalculateHash(ctx context.Context, key string, syncOptions *opts.SyncOptions) error GetHash(ctx context.Context, key string) string // 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 IncidentStorage ¶
type IncidentStorage = AlertingIncidentTracker[*alertingv1.IncidentIntervals]
type RouterStorage ¶
type RouterStorage = AlertingStorage[routing.OpniRouting]
type StateStorage ¶
type StateStorage = AlertingStateCache[*alertingv1.CachedState]
Click to show internal directories.
Click to hide internal directories.