MCPcopy
hub / github.com/mcuadros/ofelia / Middleware

Interface Middleware

core/common.go:181–189  ·  view source on GitHub ↗

Middleware can wrap any job execution, allowing to execution code before or/and after of each `Job.Run`

Source from the content-addressed store, hash-verified

179// Middleware can wrap any job execution, allowing to execution code before
180// or/and after of each `Job.Run`
181type Middleware interface {
182 // Run is called instead of the original `Job.Run`, you MUST call to `ctx.Run`
183 // inside of the middleware `Run` function otherwise you will broken the
184 // Job workflow.
185 Run(*Context) error
186 // ContinueOnStop, If return true the Run function will be called even if
187 // the execution is stopped
188 ContinueOnStop() bool
189}
190
191type middlewareContainer struct {
192 m map[string]Middleware

Callers 1

doNextMethod · 0.65

Implementers 5

TestMiddlewarecore/common_test.go
Savemiddlewares/save.go
Mailmiddlewares/mail.go
Slackmiddlewares/slack.go
Overlapmiddlewares/overlap.go

Calls

no outgoing calls

Tested by

no test coverage detected