Extending Failsafe-go

Failsafe-go can be extended to add custom policies along with the existing policies.

Custom Policies

Policies consist of a failsafe.Policy implementation, containing the necessary configuration to handle executions, and a policy.Executor implementation, to handle individual executions according to a policy. Policies can be stateful, similar to circuit breakers, or stateless, similar to retry policies.

The policy package provides base types to help with building a custom policy. Those along with the existing policy.Executor implementations are a good reference for creating custom implementations.