Documentation
¶
Overview ¶
Package envite generated by go-bindata.// sources: ui/build/asset-manifest.json ui/build/favicon.ico ui/build/index.html ui/build/logo-large.svg ui/build/logo-small.svg ui/build/static/css/main.02ca4c04.css ui/build/static/js/27.3d9e48d0.chunk.js ui/build/static/js/main.2bc38110.js ui/build/static/js/main.2bc38110.js.LICENSE.txt
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetFile() http.FileSystem
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func Execute(server *Server, executionMode ExecutionMode) error
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type AnsiColor
- type Component
- type ComponentGraph
- type ComponentStatus
- type Environment
- func (b *Environment) Apply(ctx context.Context, enabledComponentIDs []string) error
- func (b *Environment) Cleanup(ctx context.Context) error
- func (b *Environment) Components() []Component
- func (b *Environment) Output() *Reader
- func (b *Environment) StartAll(ctx context.Context) error
- func (b *Environment) StartComponent(ctx context.Context, componentID string) error
- func (b *Environment) Status(ctx context.Context) (GetStatusResponse, error)
- func (b *Environment) StopAll(ctx context.Context) error
- func (b *Environment) StopComponent(ctx context.Context, componentID string) error
- type ErrInvalidComponentID
- type ErrInvalidExecutionMode
- type ExecutionMode
- type GetStatusResponse
- type GetStatusResponseComponent
- type LogLevel
- type Logger
- type Option
- type Reader
- type Server
- type Writer
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyEnvID = errors.New("environment ID cannot be empty") ErrNilGraph = errors.New("environment component graph cannot be nil") )
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/
foo.txt
img/
a.png
b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetFile ¶
func AssetFile() http.FileSystem
AssetFile return a http.FileSystem instance that data backend by asset
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func Execute ¶
func Execute(server *Server, executionMode ExecutionMode) error
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Component ¶
type Component interface {
ID() string
Type() string
AttachEnvironment(ctx context.Context, env *Environment, writer *Writer) error
Prepare(ctx context.Context) error
Start(ctx context.Context) error
Stop(ctx context.Context) error
Cleanup(ctx context.Context) error
Status(ctx context.Context) (ComponentStatus, error)
Config() any
EnvVars() map[string]string
}
type ComponentGraph ¶
type ComponentGraph struct {
// contains filtered or unexported fields
}
func NewComponentGraph ¶
func NewComponentGraph() *ComponentGraph
func (*ComponentGraph) AddLayer ¶
func (c *ComponentGraph) AddLayer(layerComponents ...Component) *ComponentGraph
type ComponentStatus ¶
type ComponentStatus string
const ( ComponentStatusStopped ComponentStatus = "stopped" ComponentStatusFailed ComponentStatus = "failed" ComponentStatusStarting ComponentStatus = "starting" ComponentStatusRunning ComponentStatus = "running" ComponentStatusFinished ComponentStatus = "finished" )
type Environment ¶
type Environment struct {
Logger Logger
// contains filtered or unexported fields
}
func NewEnvironment ¶
func NewEnvironment(id string, componentGraph *ComponentGraph, options ...Option) (*Environment, error)
func (*Environment) Apply ¶
func (b *Environment) Apply(ctx context.Context, enabledComponentIDs []string) error
func (*Environment) Components ¶
func (b *Environment) Components() []Component
func (*Environment) Output ¶
func (b *Environment) Output() *Reader
func (*Environment) StartComponent ¶
func (b *Environment) StartComponent(ctx context.Context, componentID string) error
func (*Environment) Status ¶
func (b *Environment) Status(ctx context.Context) (GetStatusResponse, error)
func (*Environment) StopComponent ¶
func (b *Environment) StopComponent(ctx context.Context, componentID string) error
type ErrInvalidComponentID ¶
type ErrInvalidComponentID struct {
// contains filtered or unexported fields
}
func (ErrInvalidComponentID) Error ¶
func (e ErrInvalidComponentID) Error() string
type ErrInvalidExecutionMode ¶
type ErrInvalidExecutionMode struct {
// contains filtered or unexported fields
}
func (ErrInvalidExecutionMode) Error ¶
func (e ErrInvalidExecutionMode) Error() string
type ExecutionMode ¶
type ExecutionMode string
const ( ExecutionModeStart ExecutionMode = "start" ExecutionModeStop ExecutionMode = "stop" ExecutionModeDaemon ExecutionMode = "daemon" )
func ParseExecutionMode ¶
func ParseExecutionMode(value string) (ExecutionMode, error)
type GetStatusResponse ¶
type GetStatusResponse struct {
ID string `json:"id"`
Components [][]GetStatusResponseComponent `json:"components"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(port string, env *Environment) *Server
type Writer ¶
type Writer struct {
Color AnsiColor
// contains filtered or unexported fields
}