woodpecker/pipeline/backend/types/engine.go
Anbraten c1a8884d62
Add backend selection for agent (#463)
- add backend selection option
- by default it will auto-detect a backend
2021-11-26 03:34:48 +01:00

36 lines
738 B
Go

package types
import (
"context"
"io"
)
// Engine defines a container orchestration backend and is used
// to create and manage container resources.
type Engine interface {
Name() string
IsAvivable() bool
Load() error
// Setup the pipeline environment.
Setup(context.Context, *Config) error
// Exec start the pipeline step.
Exec(context.Context, *Step) error
// Kill the pipeline step.
Kill(context.Context, *Step) error
// Wait for the pipeline step to complete and returns
// the completion results.
Wait(context.Context, *Step) (*State, error)
// Tail the pipeline step logs.
Tail(context.Context, *Step) (io.ReadCloser, error)
// Destroy the pipeline environment.
Destroy(context.Context, *Config) error
}