audit

package
v0.0.0-...-e01fbee Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "clutch.service.audit"
)

Variables

View Source
var ErrFailedFilters = errors.New("event did not pass auditor's filters")

Functions

func New

func New(cfg *any.Any, logger *zap.Logger, scope tally.Scope) (service.Service, error)

Types

type Auditor

type Auditor interface {
	// Check if an event passes the configured filters for this store. True if it should save the event.
	Filter(event *auditv1.Event) bool

	// Calls used by middleware to persist events during requests.
	WriteRequestEvent(ctx context.Context, req *auditv1.RequestEvent) (int64, error)
	UpdateRequestEvent(ctx context.Context, id int64, update *auditv1.RequestEvent) error

	// Used for services and modules to read past events within a timerange.
	// If end is nil, should search until the current time.
	ReadEvents(ctx context.Context, start time.Time, end *time.Time, options *ReadOptions) ([]*auditv1.Event, error)

	// Used for services and modules to read a specific event.
	ReadEvent(ctx context.Context, id int64) (*auditv1.Event, error)
}

Required functions to save/share events processed by Clutch.

type ReadOptions

type ReadOptions struct {
	Offset int64
	Limit  int64
}

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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