Documentation ¶
Index ¶
- Constants
- type Config
- type Log
- func (b *Log) Close() error
- func (l *Log) EmitAuditEvent(eventType string, fields events.EventFields) error
- func (l *Log) GetSessionChunk(namespace string, sid session.ID, offsetBytes, maxBytes int) ([]byte, error)
- func (l *Log) GetSessionEvents(namespace string, sid session.ID, after int, inlcudePrintEvents bool) ([]events.EventFields, error)
- func (l *Log) PostSessionSlice(slice events.SessionSlice) error
- func (l *Log) SearchEvents(fromUTC, toUTC time.Time, filter string, limit int) ([]events.EventFields, error)
- func (l *Log) SearchSessionEvents(fromUTC time.Time, toUTC time.Time, limit int) ([]events.EventFields, error)
- func (l *Log) UploadSessionRecording(events.SessionRecording) error
- func (l *Log) WaitForDelivery(ctx context.Context) error
Constants ¶
const ( // DefaultReadCapacityUnits specifies default value for read capacity units DefaultReadCapacityUnits = 10 // DefaultWriteCapacityUnits specifies default value for write capacity units DefaultWriteCapacityUnits = 10 // DefaultRetentionPeriod is a default data retention period in events table // default is 1 year DefaultRetentionPeriod = 365 * 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Region is where DynamoDB Table will be used to store k/v Region string `json:"region,omitempty"` // Tablename where to store K/V in DynamoDB Tablename string `json:"table_name,omitempty"` // ReadCapacityUnits is Dynamodb read capacity units ReadCapacityUnits int64 `json:"read_capacity_units"` // WriteCapacityUnits is Dynamodb write capacity units WriteCapacityUnits int64 `json:"write_capacity_units"` // RetentionPeriod is a default retention period for events RetentionPeriod time.Duration // Clock is a clock interface, used in tests Clock clockwork.Clock }
Config structure represents DynamoDB confniguration as appears in `storage` section of Teleport YAML
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults is a helper returns an error if the supplied configuration is not enough to connect to DynamoDB
type Log ¶
type Log struct { // Entry is a log entry *log.Entry // Config is a backend configuration Config // contains filtered or unexported fields }
Log is a dynamo-db backed storage of events
func New ¶
New returns new instance of DynamoDB backend. It's an implementation of backend API's NewFunc
func (*Log) EmitAuditEvent ¶
func (l *Log) EmitAuditEvent(eventType string, fields events.EventFields) error
EmitAuditEvent emits audit event
func (*Log) GetSessionChunk ¶
func (l *Log) GetSessionChunk(namespace string, sid session.ID, offsetBytes, maxBytes int) ([]byte, error)
GetSessionChunk returns a reader which can be used to read a byte stream of a recorded session starting from 'offsetBytes' (pass 0 to start from the beginning) up to maxBytes bytes.
If maxBytes > MaxChunkBytes, it gets rounded down to MaxChunkBytes
func (*Log) GetSessionEvents ¶
func (l *Log) GetSessionEvents(namespace string, sid session.ID, after int, inlcudePrintEvents bool) ([]events.EventFields, error)
Returns all events that happen during a session sorted by time (oldest first).
after tells to use only return events after a specified cursor Id
This function is usually used in conjunction with GetSessionReader to replay recorded session streams.
func (*Log) PostSessionSlice ¶
func (l *Log) PostSessionSlice(slice events.SessionSlice) error
PostSessionSlice sends chunks of recorded session to the event log
func (*Log) SearchEvents ¶
func (l *Log) SearchEvents(fromUTC, toUTC time.Time, filter string, limit int) ([]events.EventFields, error)
SearchEvents is a flexible way to find The format of a query string depends on the implementing backend. A recommended format is urlencoded (good enough for Lucene/Solr)
Pagination is also defined via backend-specific query format.
The only mandatory requirement is a date range (UTC). Results must always show up sorted by date (newest first)
func (*Log) SearchSessionEvents ¶
func (l *Log) SearchSessionEvents(fromUTC time.Time, toUTC time.Time, limit int) ([]events.EventFields, error)
SearchSessionEvents returns session related events only. This is used to find completed session.
func (*Log) UploadSessionRecording ¶
func (l *Log) UploadSessionRecording(events.SessionRecording) error