Documentation ¶
Index ¶
- func NewSlowEmitter(delay time.Duration) events.Emitter
- type ChannelEmitter
- func (e *ChannelEmitter) C() <-chan events.AuditEvent
- func (e *ChannelEmitter) Close(ctx context.Context) error
- func (e *ChannelEmitter) Complete(ctx context.Context) error
- func (e *ChannelEmitter) CreateAuditStream(ctx context.Context, sid session.ID) (events.Stream, error)
- func (e *ChannelEmitter) Done() <-chan struct{}
- func (e *ChannelEmitter) EmitAuditEvent(ctx context.Context, event events.AuditEvent) error
- func (e *ChannelEmitter) ResumeAuditStream(ctx context.Context, sid session.ID, uploadID string) (events.Stream, error)
- func (e *ChannelEmitter) Status() <-chan events.StreamStatus
- type CounterEmitter
- type MockEmitter
- func (e *MockEmitter) Close(ctx context.Context) error
- func (e *MockEmitter) Complete(ctx context.Context) error
- func (e *MockEmitter) CreateAuditStream(ctx context.Context, sid session.ID) (events.Stream, error)
- func (e *MockEmitter) Done() <-chan struct{}
- func (e *MockEmitter) EmitAuditEvent(ctx context.Context, event events.AuditEvent) error
- func (e *MockEmitter) Events() []events.AuditEvent
- func (e *MockEmitter) LastEvent() events.AuditEvent
- func (e *MockEmitter) Reset()
- func (e *MockEmitter) ResumeAuditStream(ctx context.Context, sid session.ID, uploadID string) (events.Stream, error)
- func (e *MockEmitter) Status() <-chan events.StreamStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChannelEmitter ¶
type ChannelEmitter struct {
// contains filtered or unexported fields
}
ChannelEmitter emits audit events by writing them to a channel.
func NewChannelEmitter ¶
func NewChannelEmitter(capacity int) *ChannelEmitter
NewChannelEmitter returns a new instance of test emitter.
func (*ChannelEmitter) C ¶
func (e *ChannelEmitter) C() <-chan events.AuditEvent
func (*ChannelEmitter) CreateAuditStream ¶
func (*ChannelEmitter) Done ¶
func (e *ChannelEmitter) Done() <-chan struct{}
func (*ChannelEmitter) EmitAuditEvent ¶
func (e *ChannelEmitter) EmitAuditEvent(ctx context.Context, event events.AuditEvent) error
func (*ChannelEmitter) ResumeAuditStream ¶
func (*ChannelEmitter) Status ¶
func (e *ChannelEmitter) Status() <-chan events.StreamStatus
type CounterEmitter ¶
type CounterEmitter struct {
// contains filtered or unexported fields
}
func NewCountingEmitter ¶
func NewCountingEmitter() *CounterEmitter
NewCountingEmitter returns an emitter that counts the number of events that are emitted. It is safe for concurrent use.
func (*CounterEmitter) Count ¶
func (c *CounterEmitter) Count() int64
Count returns the number of events that have been emitted. It is safe for concurrent use.
func (*CounterEmitter) EmitAuditEvent ¶
func (c *CounterEmitter) EmitAuditEvent(ctx context.Context, event events.AuditEvent) error
type MockEmitter ¶
type MockEmitter struct {
// contains filtered or unexported fields
}
MockEmitter is an emitter that stores all emitted events.
func (*MockEmitter) CreateAuditStream ¶
func (*MockEmitter) Done ¶
func (e *MockEmitter) Done() <-chan struct{}
func (*MockEmitter) EmitAuditEvent ¶
func (e *MockEmitter) EmitAuditEvent(ctx context.Context, event events.AuditEvent) error
EmitAuditEvent emits audit event
func (*MockEmitter) Events ¶
func (e *MockEmitter) Events() []events.AuditEvent
Events returns all the emitted events.
func (*MockEmitter) LastEvent ¶
func (e *MockEmitter) LastEvent() events.AuditEvent
LastEvent returns the last emitted event.
func (*MockEmitter) ResumeAuditStream ¶
func (*MockEmitter) Status ¶
func (e *MockEmitter) Status() <-chan events.StreamStatus
Click to show internal directories.
Click to hide internal directories.