template

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSink

func NewSink(logger *zap.Logger, webhookTemplates []config.WebhookTemplate, maxBackoffDuration time.Duration) (audit.Sink, error)

NewSink is the constructor for a Sink.

Types

type Executer

type Executer interface {
	Execute(context.Context, audit.Event) error
}

Executer will try and send the event to the configured URL with all of the parameters. It will send the request with the retyrable client.

func NewWebhookTemplate

func NewWebhookTemplate(logger *zap.Logger, url, body string, headers map[string]string, maxBackoffDuration time.Duration) (Executer, error)

NewWebhookTemplate is the constructor for a WebhookTemplate.

type Sink

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

func (*Sink) Close

func (t *Sink) Close() error

func (*Sink) SendAudits

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

func (*Sink) String

func (t *Sink) String() string

Jump to

Keyboard shortcuts

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