Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cfg Config) (events.SessionPreparerRecorder, error)
New returns a events.SessionPreparerRecorder. If session recording is disabled, a recorder is returned that will discard all session events. If session recording is set to be synchronous, the returned recorder will use syncStream to create an event stream. Otherwise, a streamer will be used that will back recorded session events to disk for eventual upload.
Types ¶
type Config ¶
type Config struct { // SessionID defines the session to record. SessionID session.ID // ServerID is a server ID to write. ServerID string // Namespace is the session namespace. Namespace string // Clock is used to override time in tests. Clock clockwork.Clock // UID is UID generator. UID utils.UID // ClusterName defines the name of this teleport cluster. ClusterName string // RecordingCfg is a session recording config. RecordingCfg types.SessionRecordingConfig // SyncStreamer will be used to create session recording streams if // RecordingCfg specifies that session recording should be done // synchronously. SyncStreamer events.Streamer // DataDir is the directory that data should be stored in. DataDir string // Component is a component used for logging. Component string // Context is a context to cancel the writes // or any other operations. Context context.Context // MakeEvents converts bytes written via the io.Writer interface // into AuditEvents that are written to the stream. // For backwards compatibility, SessionWriter will convert bytes to // SessionPrint events when MakeEvents is not provided. MakeEvents func([]byte) []apievents.AuditEvent // BackoffTimeout is a backoff timeout // if set, failed audit write events will be lost // if session writer fails to write events after this timeout. BackoffTimeout time.Duration // BackoffDuration is a duration of the backoff before the next try. BackoffDuration time.Duration }
Config configures a session recorder.
Click to show internal directories.
Click to hide internal directories.