Documentation ¶
Index ¶
- Constants
- Variables
- type Controller
- type ControllerClient
- func (mc *ControllerClient) CreateController(m Controller, mayExist bool) (Controller, error)
- func (mc *ControllerClient) DeleteController(name string) error
- func (mc *ControllerClient) GetController(name string) (Controller, error)
- func (mc *ControllerClient) GetControllers() ([]Controller, error)
- func (mc *ControllerClient) InitControllers()
- type ControllerKey
- type ControllerManager
- type ControllerSpec
Constants ¶
const CONTROLLER_TYPE_ACTION string = "action"
const CONTROLLER_TYPE_PLACEMENT string = "placement"
const MaxControllerPriority = 1000000
const MinControllerPriority = 1
Variables ¶
var CONTROLLER_TYPES = [...]string{CONTROLLER_TYPE_ACTION, CONTROLLER_TYPE_PLACEMENT}
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { Metadata mtypes.Metadata `json:"metadata"` Spec ControllerSpec `json:"spec"` }
Controller contains the parameters needed for Controllers It implements the interface for managing the Controllers
type ControllerClient ¶
type ControllerClient struct {
// contains filtered or unexported fields
}
ControllerClient implements the Manager It will also be used to maintain some localized state
func NewControllerClient ¶
func NewControllerClient(name, tag string) *ControllerClient
NewControllerClient returns an instance of the ControllerClient which implements the Manager
func (*ControllerClient) CreateController ¶
func (mc *ControllerClient) CreateController(m Controller, mayExist bool) (Controller, error)
CreateController a new collection based on the Controller
func (*ControllerClient) DeleteController ¶
func (mc *ControllerClient) DeleteController(name string) error
DeleteController the Controller from database
func (*ControllerClient) GetController ¶
func (mc *ControllerClient) GetController(name string) (Controller, error)
GetController returns the Controller for corresponding name
func (*ControllerClient) GetControllers ¶
func (mc *ControllerClient) GetControllers() ([]Controller, error)
GetControllers returns all the Controllers that are registered
func (*ControllerClient) InitControllers ¶
func (mc *ControllerClient) InitControllers()
InitControllers initializes connctions for controllers in the DB
type ControllerKey ¶
type ControllerKey struct {
ControllerName string `json:"controller-name"`
}
ControllerKey is the key structure that is used in the database
func (ControllerKey) String ¶
func (mk ControllerKey) String() string
We will use json marshalling to convert to string to preserve the underlying structure.
type ControllerManager ¶
type ControllerManager interface { CreateController(ms Controller, mayExist bool) (Controller, error) GetController(name string) (Controller, error) GetControllers() ([]Controller, error) InitControllers() DeleteController(name string) error }
ControllerManager is an interface exposes the Controller functionality