Documentation ¶
Index ¶
- type CWAuditLogRepository
- func (l *CWAuditLogRepository) CreateLog(ctx context.Context, group, stream string, retention int64, ...) error
- func (l *CWAuditLogRepository) GetLog(ctx context.Context, group, stream string) ([]string, error)
- func (l *CWAuditLogRepository) Log(ctx context.Context, group, stream string) chan string
- type CWRepositoryOption
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 ¶
func New(opts ...CWRepositoryOption) (*CWAuditLogRepository, error)
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
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