woodpecker/pipeline/backend/backend.go

25 lines
679 B
Go
Raw Normal View History

2017-03-05 07:56:08 +00:00
package backend
2018-04-01 18:34:01 +00:00
import (
"context"
"io"
)
2017-03-05 07:56:08 +00:00
// Engine defines a container orchestration backend and is used
// to create and manage container resources.
type Engine interface {
// Setup the pipeline environment.
2018-04-01 18:34:01 +00:00
Setup(context.Context, *Config) error
2017-03-05 07:56:08 +00:00
// Start the pipeline step.
2018-04-01 18:34:01 +00:00
Exec(context.Context, *Step) error
2017-03-05 07:56:08 +00:00
// Kill the pipeline step.
2018-04-01 18:34:01 +00:00
Kill(context.Context, *Step) error
2017-03-05 07:56:08 +00:00
// Wait for the pipeline step to complete and returns
// the completion results.
2018-04-01 18:34:01 +00:00
Wait(context.Context, *Step) (*State, error)
2017-03-05 07:56:08 +00:00
// Tail the pipeline step logs.
2018-04-01 18:34:01 +00:00
Tail(context.Context, *Step) (io.ReadCloser, error)
2017-03-05 07:56:08 +00:00
// Destroy the pipeline environment.
2018-04-01 18:34:01 +00:00
Destroy(context.Context, *Config) error
2017-03-05 07:56:08 +00:00
}