template

package
v1.51.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLeveledLogger added in v1.48.1

func NewLeveledLogger(logger *zap.Logger) retryablehttp.LeveledLogger

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 LeveledLogger added in v1.48.1

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

func (*LeveledLogger) Debug added in v1.48.1

func (l *LeveledLogger) Debug(msg string, keyvals ...interface{})

func (*LeveledLogger) Error added in v1.48.1

func (l *LeveledLogger) Error(msg string, keyvals ...interface{})

func (*LeveledLogger) Info added in v1.48.1

func (l *LeveledLogger) Info(msg string, keyvals ...interface{})

func (*LeveledLogger) Warn added in v1.48.1

func (l *LeveledLogger) Warn(msg string, keyvals ...any)

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