Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cfg Config) goresilience.Runner
New will wrap a execution unit that will cut the execution of a runner when some time passes using the context. use 0 timeout for default timeout.
func NewMiddleware ¶
func NewMiddleware(cfg Config) goresilience.Middleware
NewMiddleware returns a middleware that will cut the execution of a runner when some time passes using the context. use 0 timeout for default timeout.
Types ¶
type Config ¶
type Config struct { // Timeout is the duration that will be waited before giving as a timeouted execution. Timeout time.Duration // Cancel decides if a context is canceled on a timeouted execution. // This is useful to stop the middleware chain on timeout. Cancel bool }
Config is the configuration of the timeout.
Click to show internal directories.
Click to hide internal directories.