Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseHandler ¶ added in v0.1.2
type BaseHandler struct {
}
func (*BaseHandler) PostHook ¶ added in v0.1.2
func (b *BaseHandler) PostHook(*HookCtx) error
type BaseResource ¶
type BaseResource struct {
ID string `schema:"id"`
}
BaseResource is a resource that can have multiple instances
func (*BaseResource) Init ¶ added in v0.1.2
func (b *BaseResource) Init(spec map[string]interface{}) error
Init implements the Resource interface
func (*BaseResource) SetID ¶
func (b *BaseResource) SetID(id string)
SetID sets the id of the specific resource
type Config ¶
type Config struct {
// Provider is the provider used by the operator
Provider Provider
// State is the state access
State state.State
// Backends are the list of backends handled by the operator
HandlerFactories []HandlerFactory
// GRPCAddr is the address of the grpc server
GRPCAddr *net.TCPAddr
}
Config is the parametrization of the operator server
type Handler ¶
type Handler interface {
// EvaluatePlan evaluates and modifies the execution plan
EvaluatePlan(*PlanCtx) error
// PostHook is executed when a node changes the state
PostHook(*HookCtx) error
// Spec returns the specification for the cluster
Spec() *Spec
// Client returns a connection with a specific node in the cluster
Client(node *proto.Node) (interface{}, error)
}
Handler is the interface that needs to be implemented by the backend
type NodeUpdate ¶ added in v0.1.2
NodeUpdate is an update from a node (TODO: move to proto)
type Nodetype ¶
type Nodetype struct {
// Image is the default docker image for the node
Image string
// Version is the default docker image for the node
Version string
// Volume is a list volumes for this node type
Volumes []*Volume
// Ports is a list of ports for this node type
Ports []*Port
}
Nodetype is a type of node for the Backend
type Provider ¶
type Provider interface {
// Setup setups the provider (Maybe do this on the factory)
Setup() error
// Start starts the provider
Start() error
// CreateResource creates the computational resource
CreateResource(*proto.Node) (*proto.Node, error)
// DeleteResource deletes the computational resource
DeleteResource(*proto.Node) (*proto.Node, error)
// WatchUpdates watches for updates from nodes
WatchUpdates() chan *NodeUpdate
// Exec executes a shell script
Exec(handler string, path string, args ...string) error
}
Provider is the entity that holds the state of the infrastructure. Both for the computing resources and the general resources.
type ProviderFactory ¶
ProviderFactory is a factory method to create factories
type Resource ¶
type Resource interface {
GetName() string
Delete(conn interface{}) error
Reconcile(conn interface{}) error
Init(spec map[string]interface{}) error
}
Resource is a resource in the cluster
type Server ¶
type Server struct {
Provider Provider
State state.State
// contains filtered or unexported fields
}
Server is the operator server
Click to show internal directories.
Click to hide internal directories.