Documentation ¶
Index ¶
- Constants
- Variables
- func GenKey(prefix []byte, id audit.IDBytes) []byte
- type AdvancedConf
- type Conf
- type Log
- func (l *Log) AccessLogEntriesBetween(ctx context.Context, fromTS, toTS time.Time) audit.AccessLogIterator
- func (l *Log) AccessLogEntryByID(ctx context.Context, id audit.ID) audit.AccessLogIterator
- func (l *Log) Backend() string
- func (l *Log) Close() error
- func (l *Log) DecisionLogEntriesBetween(ctx context.Context, fromTS, toTS time.Time) audit.DecisionLogIterator
- func (l *Log) DecisionLogEntryByID(ctx context.Context, id audit.ID) audit.DecisionLogIterator
- func (l *Log) Enabled() bool
- func (l *Log) ForceWrite()
- func (l *Log) LastNAccessLogEntries(ctx context.Context, n uint) audit.AccessLogIterator
- func (l *Log) LastNDecisionLogEntries(ctx context.Context, n uint) audit.DecisionLogIterator
- func (l *Log) RegisterCallback(fn func(chan<- struct{}))
- func (l *Log) Write(ctx context.Context, key, value []byte) error
- func (l *Log) WriteAccessLogEntry(ctx context.Context, record audit.AccessLogEntryMaker) error
- func (l *Log) WriteDecisionLogEntry(ctx context.Context, record audit.DecisionLogEntryMaker) error
Constants ¶
View Source
const (
Backend = "local"
)
Variables ¶
View Source
var ( AccessLogPrefix = []byte("aacc") DecisionLogPrefix = []byte("adec") )
Functions ¶
Types ¶
type AdvancedConf ¶
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) SetDefaults ¶
func (c *Conf) SetDefaults()
type Log ¶
Log implements the decisionlog interface with Badger as the backing store.
func (*Log) AccessLogEntriesBetween ¶
func (*Log) AccessLogEntryByID ¶
func (*Log) DecisionLogEntriesBetween ¶
func (*Log) DecisionLogEntryByID ¶
func (*Log) ForceWrite ¶ added in v0.35.0
func (l *Log) ForceWrite()
ForceWrite forces a write operation and blocks until completion. It is used only by tests.
func (*Log) LastNAccessLogEntries ¶
func (*Log) LastNDecisionLogEntries ¶
func (*Log) RegisterCallback ¶ added in v0.35.0
func (l *Log) RegisterCallback(fn func(chan<- struct{}))
func (*Log) WriteAccessLogEntry ¶
func (*Log) WriteDecisionLogEntry ¶
Click to show internal directories.
Click to hide internal directories.