audit

package
v0.0.0-...-4d13c9b Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: GPL-3.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config encapsulates the requirements for generating a Stream

func Build

func Build(opts ...Option) (*Config, error)

Build ingests configuration options to then yield a Config and return an error if it fails during setup.

type Extension

type Extension string

Extension describe differing types of persisted queued types

const (

	// Active states which items are currently actively being worked on
	Active Extension = ".active"

	// Flushed states which items have been flushed
	Flushed Extension = ".flushed"

	// Failed status which items are failed
	Failed Extension = ".failed"
)

func (Extension) Ext

func (e Extension) Ext() string

Ext returns the extension of the constant extension

type LocalConfig

type LocalConfig struct {
	RootPath string
	Fsys     fsys.Filesystem
}

LocalConfig creates a configuration to create a LocalLog.

func BuildLocalConfig

func BuildLocalConfig(opts ...LocalConfigOption) (*LocalConfig, error)

BuildLocalConfig ingests configuration options to then yield a LocalConfig, and return an error if it fails during configuring.

type LocalConfigOption

type LocalConfigOption func(*LocalConfig) error

LocalConfigOption defines a option for generating a LocalConfig

func WithFsys

func WithFsys(fsys fsys.Filesystem) LocalConfigOption

WithFsys adds an fsys option to the configuration

func WithRootPath

func WithRootPath(rootPath string) LocalConfigOption

WithRootPath adds an rootPath option to the configuration

type Log

type Log interface {

	// Append a transaction to the log
	Append(models.Transaction) error
}

Log represents an audit log of transactions that have occurred.

func New

func New(config *Config, logger log.Logger) (log Log, err error)

New returns a new log

type Option

type Option func(*Config) error

Option defines a option for generating a stream Config

func With

func With(name string) Option

With adds a type of stream to use for the configuration.

func WithLocalConfig

func WithLocalConfig(localConfig *LocalConfig) Option

WithLocalConfig adds a local log config to the configuration

func WithRemoteConfig

func WithRemoteConfig(remoteConfig *RemoteConfig) Option

WithRemoteConfig adds a remote log config to the configuration

type RemoteConfig

type RemoteConfig struct {
	EC2Role           bool
	ID, Secret, Token string
	Region, Stream    string
}

RemoteConfig creates a configuration to create a RemoteLog.

func BuildRemoteConfig

func BuildRemoteConfig(opts ...RemoteConfigOption) (*RemoteConfig, error)

BuildRemoteConfig ingests configuration options to then yield a RemoteConfig, and return an error if it fails during configuring.

type RemoteConfigOption

type RemoteConfigOption func(*RemoteConfig) error

RemoteConfigOption defines a option for generating a RemoteConfig

func WithEC2Role

func WithEC2Role(ec2Role bool) RemoteConfigOption

WithEC2Role adds an EC2Role option to the configuration

func WithID

func WithID(id string) RemoteConfigOption

WithID adds an ID option to the configuration

func WithRegion

func WithRegion(region string) RemoteConfigOption

WithRegion adds an Region option to the configuration

func WithSecret

func WithSecret(secret string) RemoteConfigOption

WithSecret adds an Secret option to the configuration

func WithStream

func WithStream(stream string) RemoteConfigOption

WithStream adds an Stream option to the configuration

func WithToken

func WithToken(token string) RemoteConfigOption

WithToken adds an Token option to the configuration

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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