Documentation
¶
Overview ¶
Package tensile is a config management library a la Puppet, Ansible, Chef, etc.pp. written in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context is a superset of context.Context to pass additional fields to a Node.
type Depender ¶
type Depender interface {
// DependsOn returns a list of resources the node depends on, e.g.
// packages or files.
DependsOn() ([]NodeRef, error)
}
Depender is the interface to be satisfied by a Node when it depends on other resources to be provided by other Node., e.g. a package that must be installed or a file to be ensured.
type Executor ¶
type Executor interface {
// NeedsExecution is run before Execute. NeedsExecution must not
// mane any modifications to the system, it must be a stateless
// check to check if Node.Execute must be called.
//
// NeedsExecution is called e.g. for noop runs to check if any
// changes are needed.
NeedsExecution(ctx context.Context) (bool, error)
// Execute is called for the node to make the desired change.
Execute(ctx context.Context) error
}
Executor is the interface to be satisfied by a Node to be executed.
type ExecutorCtx ¶
type ExecutorCtx interface {
// NeedsExecution is run before Execute. NeedsExecution must not
// mane any modifications to the system, it must be a stateless
// check to check if Node.Execute must be called.
//
// NeedsExecution is called e.g. for noop runs to check if any
// changes are needed.
NeedsExecution(ctx Context) (bool, error)
// Execute is called for the node to make the desired change.
Execute(ctx Context) error
}
ExecutorCtx is equivalent to Executor but with a Context instead of a context.Context.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a single step to be executed by an engine.
func (*Node) NeedsExecution ¶
NeedsExecution calls .NeedsExecution on the wrapped node if it implements it.
type NodeRef ¶
NodeRef is a reference to a node.
func (NodeRef) String ¶
String implements the fmt.Stringer interface.
type Provider ¶
type Provider interface {
// Provides returns a list of resources the node will provide, e.g.
// a list of packages or files.
Provides() ([]NodeRef, error)
}
Provider is the interface to be satisfied by a Node when it provides resources, e.g. installing a package or creating a file.
type TensileCtx ¶
TensileCtx implements a Context.
func NewContext ¶
func NewContext(ctx context.Context) *TensileCtx
NewContext returns an initialized TensileCtx.
type Validator ¶
type Validator interface {
// Validate validates the configuration of the node.
// It may be used to setup states in the node.
Validate(ctx context.Context) error
}
Validator is the interface to be satisfied by a Node when the configuration needs to be validated e.g. before execution.
type ValidatorCtx ¶
type ValidatorCtx interface {
// Validate validates the configuration of the node.
// It may be used to setup states in the node.
Validate(ctx Context) error
}
ValidatorCtx is equivalent to Validator but with a Context instead of a context.Contex.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
tester
command
A quick command to test things.
|
A quick command to test things. |
|
pkg
|
|
|
engine
Package engine contains execution engines for tensile.
|
Package engine contains execution engines for tensile. |
|
queue
Package queue implements the ordering logic to execute tensile.Node.
|
Package queue implements the ordering logic to execute tensile.Node. |
|
Package tensilestd contains tensile.Node implementations.
|
Package tensilestd contains tensile.Node implementations. |