Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFailEnabled = errors.New("failing switchable appender is failing")
Functions ¶
This section is empty.
Types ¶
type BlockingSwitchable ¶
type BlockingSwitchable struct {
// contains filtered or unexported fields
}
BlockingSwitchable allows to block all messages until it is released.
func NewBlockingSwitchable ¶
func NewBlockingSwitchable(inner zapappender.Appender) *BlockingSwitchable
func NewBlockingSwitchableCtx ¶
func NewBlockingSwitchableCtx(ctx context.Context, inner zapappender.Appender) *BlockingSwitchable
func (*BlockingSwitchable) Break ¶
func (a *BlockingSwitchable) Break()
Break blocks all messages until Fix is called.
func (*BlockingSwitchable) Breaking ¶
func (a *BlockingSwitchable) Breaking() bool
Breaking returns true if messages are currently blocked.
func (*BlockingSwitchable) Sync ¶
func (a *BlockingSwitchable) Sync() error
type FailingSwitchable ¶
type FailingSwitchable struct {
// contains filtered or unexported fields
}
FailingSwitchable returns an error on all writes while it is Breaking.
func NewFailingSwitchable ¶
func NewFailingSwitchable(inner zapappender.Appender) *FailingSwitchable
func (*FailingSwitchable) Break ¶
func (a *FailingSwitchable) Break()
Break starts failing messages.
func (*FailingSwitchable) Breaking ¶
func (a *FailingSwitchable) Breaking() bool
Breaking returns true if FailingSwitchable is set to fail.
func (*FailingSwitchable) Sync ¶
func (a *FailingSwitchable) Sync() error
type Switchable ¶
type Switchable interface { // Breaking returns true if the failure behaviour is activated. Breaking() bool // Break starts the failure behaviour. Break() // Fix stops the failure behaviour. Fix() }
Switchable is the base interface for chaos adapters created for testing.
Click to show internal directories.
Click to hide internal directories.