local

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedConf

type AdvancedConf struct {
	BufferSize    uint          `yaml:"bufferSize" conf:",example=256"`
	MaxBatchSize  uint          `yaml:"maxBatchSize" conf:",example=32"`
	FlushInterval time.Duration `yaml:"flushInterval" conf:",example=1s"`
	GCInterval    time.Duration `yaml:"gcInterval" conf:",example=60s"`
}

type Conf

type Conf struct {
	// Path to store the data
	StoragePath string `yaml:"storagePath" conf:",example=/path/to/dir"`
	// How long to keep records for
	RetentionPeriod time.Duration `yaml:"retentionPeriod" conf:",example=168h"`
	Advanced        AdvancedConf  `yaml:"advanced"`
}

Conf is optional configuration for local Audit.

func (*Conf) Key

func (c *Conf) Key() string

func (*Conf) SetDefaults

func (c *Conf) SetDefaults()

func (*Conf) Validate

func (c *Conf) Validate() error

type Log

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

Log implements the decisionlog interface with Badger as the backing store.

func NewLog

func NewLog(conf *Conf) (*Log, error)

func (*Log) AccessLogEntriesBetween

func (l *Log) AccessLogEntriesBetween(ctx context.Context, fromTS, toTS time.Time) audit.AccessLogIterator

func (*Log) AccessLogEntryByID

func (l *Log) AccessLogEntryByID(ctx context.Context, id audit.ID) audit.AccessLogIterator

func (*Log) Close

func (l *Log) Close()

func (*Log) DecisionLogEntriesBetween

func (l *Log) DecisionLogEntriesBetween(ctx context.Context, fromTS, toTS time.Time) audit.DecisionLogIterator

func (*Log) DecisionLogEntryByID

func (l *Log) DecisionLogEntryByID(ctx context.Context, id audit.ID) audit.DecisionLogIterator

func (*Log) LastNAccessLogEntries

func (l *Log) LastNAccessLogEntries(ctx context.Context, n uint) audit.AccessLogIterator

func (*Log) LastNDecisionLogEntries

func (l *Log) LastNDecisionLogEntries(ctx context.Context, n uint) audit.DecisionLogIterator

func (*Log) WriteAccessLogEntry

func (l *Log) WriteAccessLogEntry(ctx context.Context, record audit.AccessLogEntryMaker) error

func (*Log) WriteDecisionLogEntry

func (l *Log) WriteDecisionLogEntry(ctx context.Context, record audit.DecisionLogEntryMaker) error

Jump to

Keyboard shortcuts

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