Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deregister ¶
Deregister deregisters a attack creator on base registry.
Types ¶
type Attacker ¶
type Attacker interface { // Apply applies an attack or fault to the system Apply(ctx context.Context) error // Revert reverts an attack or fault from the system Revert() error }
Attacker implements the lowest level of error applied to a system.
type Creater ¶
Creater should be implement by any attacker that wants to be automatically created by the global registry of attacks.
type CreatorFunc ¶
CreatorFunc implements Creater interface as a handy way of creating creaters quickly
type Registry ¶
type Registry interface { Register(id string, c Creater) error Deregister(id string) error Exists(id string) bool New(id string, opts Opts) (Attacker, error) }
Registry is an interface that needs to be implemented by any attack registry.
type SimpleRegistry ¶
SimpleRegistry is basic registry of attackers.
func NewSimpleRegistry ¶
func NewSimpleRegistry() SimpleRegistry
NewSimpleRegistry returns a basic registerer.
func (SimpleRegistry) Deregister ¶
func (r SimpleRegistry) Deregister(id string) error
Deregister deregisters a attack creator.
func (SimpleRegistry) Exists ¶
func (r SimpleRegistry) Exists(id string) bool
Exists returns true if the creator is registered for a given ID, false instead.
Click to show internal directories.
Click to hide internal directories.