Documentation
¶
Index ¶
- Constants
- Variables
- type Controller
- type ControllerClient
- func (mc *ControllerClient) CreateController(ctx context.Context, m Controller, mayExist bool) (Controller, error)
- func (mc *ControllerClient) DeleteController(ctx context.Context, name string) error
- func (mc *ControllerClient) GetController(ctx context.Context, name string) (Controller, error)
- func (mc *ControllerClient) GetControllers(ctx context.Context) ([]Controller, error)
- func (mc *ControllerClient) InitControllers(ctx context.Context)
- type ControllerKey
- type ControllerManager
- type ControllerServer
- type ControllerSpec
Constants ¶
const ( MinControllerPriority = 1 MaxControllerPriority = 1000000 CONTROLLER_TYPE_ACTION string = "action" CONTROLLER_TYPE_PLACEMENT string = "placement" )
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, group string) *ControllerClient
NewControllerClient returns an instance of the ControllerClient which implements the Manager
func (*ControllerClient) CreateController ¶
func (mc *ControllerClient) CreateController(ctx context.Context, m Controller, mayExist bool) (Controller, error)
CreateController a new collection based on the Controller
func (*ControllerClient) DeleteController ¶
func (mc *ControllerClient) DeleteController(ctx context.Context, name string) error
DeleteController the Controller from database
func (*ControllerClient) GetController ¶
func (mc *ControllerClient) GetController(ctx context.Context, name string) (Controller, error)
GetController returns the Controller for corresponding name
func (*ControllerClient) GetControllers ¶
func (mc *ControllerClient) GetControllers(ctx context.Context) ([]Controller, error)
GetControllers returns all the Controllers that are registered
func (*ControllerClient) InitControllers ¶
func (mc *ControllerClient) InitControllers(ctx context.Context)
InitControllers initializes connctions for controllers in the DB
type ControllerKey ¶
type ControllerKey struct { ControllerName string `json:"controller"` ControllerGroup string `json:"controllerGroup"` }
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(ctx context.Context, ms Controller, mayExist bool) (Controller, error) GetController(ctx context.Context, name string) (Controller, error) GetControllers(ctx context.Context) ([]Controller, error) InitControllers(ctx context.Context) DeleteController(ctx context.Context, name string) error }
ControllerManager is an interface exposes the Controller functionality
type ControllerServer ¶
ControllerServer implements a controller/manager service
func NewControllerServer ¶
func NewControllerServer(name string, httpRouter *mux.Router, grpcServer *register.GrpcServer) (*ControllerServer, error)