cwauditlogrepository

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CWAuditLogRepository

type CWAuditLogRepository struct {
	CW           cwlogsIface
	GroupPrefix  string
	StreamPrefix string
	// contains filtered or unexported fields
}

CWAuditLogRepository is an implementation of an audit respository in CloudWatch

func New

New creates an CWAuditLogRepository from a list of CWRepositoryOption functions

func NewDefaultRepository

func NewDefaultRepository(config map[string]interface{}) (*CWAuditLogRepository, error)

NewDefaultRepository creates a new repository from the default config data

func (*CWAuditLogRepository) CreateLog

func (l *CWAuditLogRepository) CreateLog(ctx context.Context, group, stream string, retention int64, tags []*dataset.Tag) error

CreateLog creates the specified log group and stream in CloudWatch if they don't exist It also sets the log retention for the log group (in days) and adds tags

func (*CWAuditLogRepository) GetLog added in v1.1.0

func (l *CWAuditLogRepository) GetLog(ctx context.Context, group, stream string) ([]string, error)

GetLog returns all audit log events from the specified group and stream in CloudWatch

func (*CWAuditLogRepository) Log

func (l *CWAuditLogRepository) Log(ctx context.Context, group, stream string) chan string

Log creates a channel for writing audit log events to the specified group and stream in CloudWatch

type CWRepositoryOption

type CWRepositoryOption func(*CWAuditLogRepository)

CWRepositoryOption is a function to set cloudwatch repository options

func WithClient

func WithClient(akid, secret, region string) CWRepositoryOption

WithClient initializes a cloudwatch client using AWS static credentials (key, secret, region)

func WithPrefix

func WithPrefix(prefix string) CWRepositoryOption

WithPrefix sets the log group prefix

func WithTimeout

func WithTimeout(timeout time.Duration) CWRepositoryOption

WithTimeout sets the log batch timeout

Jump to

Keyboard shortcuts

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