storage

package
v0.0.0-...-74de58c Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadOptions

type ReadOptions struct {
	Offset int64
	Limit  int64
}

type Storage

type Storage interface {
	// Used to get un-sent events.
	UnsentEvents(ctx context.Context) ([]*auditv1.Event, error)

	// 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)

	ReadEvent(ctx context.Context, id int64) (*auditv1.Event, error)

	// Basic Locking functions to provide concurrency control.
	AttemptLock(ctx context.Context, lockID uint32) (bool, error)
	ReleaseLock(ctx context.Context, lockID uint32) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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