controller

package
v0.0.0-...-7c77b90 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const CONTROLLER_TYPE_ACTION string = "action"
View Source
const CONTROLLER_TYPE_PLACEMENT string = "placement"
View Source
const MaxControllerPriority = 1000000
View Source
const MinControllerPriority = 1

Variables

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

type ControllerSpec

type ControllerSpec struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Type     string `json:"type"`
	Priority int    `json:"priority"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL