webhook

package
v1.42.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSink

func NewSink(logger *zap.Logger, webhookClient Client) audit.Sink

NewSink is the constructor for a Sink.

Types

type Client

type Client interface {
	SendAudit(ctx context.Context, e audit.Event) error
}

Client is the client-side contract for sending an audit to a configured sink.

func NewWebhookClient added in v1.28.0

func NewWebhookClient(logger *zap.Logger, url, signingSecret string, opts ...ClientOption) Client

NewHTTPClient is the constructor for a HTTPClient.

type ClientOption

type ClientOption func(h *webhookClient)

func WithMaxBackoffDuration

func WithMaxBackoffDuration(maxBackoffDuration time.Duration) ClientOption

WithMaxBackoffDuration allows for a configurable backoff duration configuration.

type Sink

type Sink struct {
	// contains filtered or unexported fields
}

Sink is a structure in charge of sending Audits to a configured webhook at a URL.

func (*Sink) Close

func (w *Sink) Close() error

func (*Sink) SendAudits

func (w *Sink) SendAudits(ctx context.Context, events []audit.Event) error

func (*Sink) String

func (w *Sink) String() string

Jump to

Keyboard shortcuts

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