hub

package
v0.35.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Backend = "hub"
)

Variables

View Source
var (
	SyncStatusPrefix   = []byte("bs")   // "b" for contiguity with audit log keys in LSM, "s" because "sync"
	AccessSyncPrefix   = []byte("bsac") // these need to be len(4) to correctly reuse `local.GenKey`
	DecisionSyncPrefix = []byte("bsde")
)

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Ingest     IngestConf `yaml:"ingest" conf:",ignore"`
	local.Conf `yaml:",inline"`
}

func (*Conf) Key

func (c *Conf) Key() string

func (*Conf) SetDefaults

func (c *Conf) SetDefaults()

func (*Conf) Validate

func (c *Conf) Validate() (outErr error)

type ErrIngestBackoff

type ErrIngestBackoff struct {
	Backoff time.Duration
	// contains filtered or unexported fields
}

func (ErrIngestBackoff) Error

func (e ErrIngestBackoff) Error() string

type Impl

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

func NewIngestSyncer

func NewIngestSyncer(conf *Conf, logger *zap.Logger) (*Impl, error)

func (*Impl) Sync

func (i *Impl) Sync(ctx context.Context, batch *logsv1.IngestBatch) error

type IngestConf

type IngestConf struct {
	// Credentials holds bundle source credentials.
	Credentials *hub.CredentialsConf `yaml:"credentials" conf:",ignore"`
	// Connection defines settings for the remote server connection.
	Connection *hub.ConnectionConf `yaml:"connection" conf:",ignore"`
	// MaxBatchSize defines the max number of log entries to send in each Ingest request.
	MaxBatchSize uint `yaml:"maxBatchSize" conf:",example=32"`
	// MinFlushInterval is the minimal duration between Ingest requests.
	MinFlushInterval time.Duration `yaml:"minFlushInterval" conf:",example=3s"`
	// FlushTimeout defines the max allowable timeout for each Ingest request.
	FlushTimeout time.Duration `yaml:"flushTimeout" conf:",example=5s"`
	// NumGoRoutines defines the max number of goroutines used when streaming log entries from the local DB.
	NumGoRoutines uint `yaml:"numGoRoutines" conf:",example=8"`
}

type IngestSyncer

type IngestSyncer interface {
	Sync(context.Context, *logsv1.IngestBatch) error
}

type Log

type Log struct {
	*local.Log
}

func NewLog

func NewLog(conf *Conf, decisionFilter audit.DecisionLogEntryFilter, syncer IngestSyncer, logger *zap.Logger) (*Log, error)

func (*Log) Backend

func (l *Log) Backend() string

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