Documentation ¶
Overview ¶
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Index ¶
- type BearerAuthTokenProvider
- type BearerAuthTokenProviderMock
- type BearerAuthTokenProviderMock_AuthToken_Call
- func (_c *BearerAuthTokenProviderMock_AuthToken_Call) Return(_a0 string, _a1 error) *BearerAuthTokenProviderMock_AuthToken_Call
- func (_c *BearerAuthTokenProviderMock_AuthToken_Call) Run(run func(ctx context.Context)) *BearerAuthTokenProviderMock_AuthToken_Call
- func (_c *BearerAuthTokenProviderMock_AuthToken_Call) RunAndReturn(run func(context.Context) (string, error)) *BearerAuthTokenProviderMock_AuthToken_Call
- type BearerAuthTokenProviderMock_Expecter
- type Config
- type DisruptionConfig
- type DisruptionCronConfig
- type DisruptionCronEvent
- type DisruptionEvent
- type Notifier
- type NotifierEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BearerAuthTokenProvider ¶
BearerAuthTokenProvider defines an interface for retrieving authentication tokens.
func NewBearerAuthTokenProvider ¶
func NewBearerAuthTokenProvider(logger *zap.SugaredLogger, client *http.Client, url string, headers map[string]string, tokenPath string) BearerAuthTokenProvider
NewBearerAuthTokenProvider creates a new BearerAuthTokenProvider.
type BearerAuthTokenProviderMock ¶
BearerAuthTokenProviderMock is an autogenerated mock type for the BearerAuthTokenProvider type
func NewBearerAuthTokenProviderMock ¶
func NewBearerAuthTokenProviderMock(t interface { mock.TestingT Cleanup(func()) }) *BearerAuthTokenProviderMock
NewBearerAuthTokenProviderMock creates a new instance of BearerAuthTokenProviderMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*BearerAuthTokenProviderMock) AuthToken ¶
func (_m *BearerAuthTokenProviderMock) AuthToken(ctx context.Context) (string, error)
AuthToken provides a mock function with given fields: ctx
func (*BearerAuthTokenProviderMock) EXPECT ¶
func (_m *BearerAuthTokenProviderMock) EXPECT() *BearerAuthTokenProviderMock_Expecter
type BearerAuthTokenProviderMock_AuthToken_Call ¶
BearerAuthTokenProviderMock_AuthToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AuthToken'
func (*BearerAuthTokenProviderMock_AuthToken_Call) Return ¶
func (_c *BearerAuthTokenProviderMock_AuthToken_Call) Return(_a0 string, _a1 error) *BearerAuthTokenProviderMock_AuthToken_Call
func (*BearerAuthTokenProviderMock_AuthToken_Call) Run ¶
func (_c *BearerAuthTokenProviderMock_AuthToken_Call) Run(run func(ctx context.Context)) *BearerAuthTokenProviderMock_AuthToken_Call
func (*BearerAuthTokenProviderMock_AuthToken_Call) RunAndReturn ¶
func (_c *BearerAuthTokenProviderMock_AuthToken_Call) RunAndReturn(run func(context.Context) (string, error)) *BearerAuthTokenProviderMock_AuthToken_Call
type BearerAuthTokenProviderMock_Expecter ¶
type BearerAuthTokenProviderMock_Expecter struct {
// contains filtered or unexported fields
}
func (*BearerAuthTokenProviderMock_Expecter) AuthToken ¶
func (_e *BearerAuthTokenProviderMock_Expecter) AuthToken(ctx interface{}) *BearerAuthTokenProviderMock_AuthToken_Call
AuthToken is a helper method to define mock.On call
- ctx context.Context
type Config ¶
type Config struct { Headers []string `yaml:"headers"` HeadersFilepath string `yaml:"headersFilepath"` AuthURL string `yaml:"authURL"` AuthHeaders []string `yaml:"authHeaders"` AuthTokenPath string `yaml:"authTokenPath"` Disruption DisruptionConfig `yaml:"disruption"` DisruptionCron DisruptionCronConfig `yaml:"disruptioncron"` }
type DisruptionConfig ¶
type DisruptionCronConfig ¶
type DisruptionCronEvent ¶
type DisruptionCronEvent struct { NotifierEvent // Manifest is the JSON representation of the DisruptionCron object Manifest string `jsonapi:"attribute" json:"manifest"` }
type DisruptionEvent ¶
type DisruptionEvent struct { NotifierEvent // Manifest is the JSON representation of the Disruption object Manifest string `jsonapi:"attribute" json:"manifest"` // TargetsCount is the number of targets in the Disruption object TargetsCount int `jsonapi:"attribute" json:"targets_count"` }
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier describes a HTTP notifier
func New ¶
func New(commonConfig types.NotifiersCommonConfig, httpConfig Config, logger *zap.SugaredLogger) (*Notifier, error)
New HTTP Notifier
func (*Notifier) GetNotifierName ¶
GetNotifierName returns the driver's name
type NotifierEvent ¶
type NotifierEvent struct { ID string `jsonapi:"primary,http_notifier_events"` Name string `jsonapi:"attribute" json:"name"` NotificationTitle string `jsonapi:"attribute" json:"notification_title"` NotificationType types.NotificationType `jsonapi:"attribute" json:"notification_type"` EventReason v1beta1.EventReason `jsonapi:"attribute" json:"event_reason"` EventMessage string `jsonapi:"attribute" json:"event_message"` InvolvedObjectKind string `jsonapi:"attribute" json:"involved_object_kind"` // Deprecated: DisruptionName exists for historical compatibility // and should not be used. Use Name instead. DisruptionName string `jsonapi:"attribute" json:"disruption_name"` // Deprecated: Disruption exists for historical compatibility // and should not be used. Use DisruptionEvent.Manifest or DisruptionCronEvent.Manifest instead. Disruption string `jsonapi:"attribute" json:"disruption"` // Deprecated: TargetsCount exists for historical compatibility // and should not be used. Use DisruptionEvent.TargetsCount instead. TargetsCount int `jsonapi:"attribute" json:"targets_count"` Timestamp int64 `jsonapi:"attribute" json:"timestamp"` Cluster string `jsonapi:"attribute" json:"cluster"` Namespace string `jsonapi:"attribute" json:"namespace"` Username string `jsonapi:"attribute" json:"username,omitempty"` UserEmail string `jsonapi:"attribute" json:"user_email,omitempty"` UserGroups string `jsonapi:"attribute" json:"user_groups,omitempty"` }
NotifierEvent represents a notification event