webhook

package
v1.53.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 13 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) (*http.Response, 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, maxBackoffDuration time.Duration) Client

NewHTTPClient is the constructor for a HTTPClient.

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