Documentation ¶
Index ¶
- type ControllerStub
- type DownstreamController
- type PodManager
- func (pm *PodManager) AddPod(k string, v types.FakePod)
- func (pm *PodManager) DeletePod(k string)
- func (pm *PodManager) GetEvent() chan *model.Message
- func (pm *PodManager) GetPod(key string) types.FakePod
- func (pm *PodManager) ListPods() []types.FakePod
- func (pm *PodManager) PodHandlerFunc(w http.ResponseWriter, req *http.Request)
- func (pm *PodManager) UpdatePodStatus(k string, s string)
- type UpstreamController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControllerStub ¶
type ControllerStub struct {
// contains filtered or unexported fields
}
HandlerStub definition
func (*ControllerStub) Start ¶
func (cs *ControllerStub) Start(c *context.Context)
Start controller hub
type DownstreamController ¶
type DownstreamController struct {
// contains filtered or unexported fields
}
DownstreamController receives http request and send to cloudhub
func NewDownstreamController ¶
func NewDownstreamController(context *context.Context, pm *PodManager) (*DownstreamController, error)
NewDownstreamController creates a downstream controller
func (*DownstreamController) Start ¶
func (dc *DownstreamController) Start() error
Start DownstreamController
func (*DownstreamController) Stop ¶
func (dc *DownstreamController) Stop() error
Stop DownstreamController
func (*DownstreamController) SyncPods ¶
func (dc *DownstreamController) SyncPods(stop chan struct{})
SyncPods is used to send message to cloudhub
type PodManager ¶
type PodManager struct {
// contains filtered or unexported fields
}
PodManager is a manager watch pod change event
func (*PodManager) AddPod ¶
func (pm *PodManager) AddPod(k string, v types.FakePod)
AddPod adds pod in cache
func (*PodManager) DeletePod ¶
func (pm *PodManager) DeletePod(k string)
DeletePod deletes pod in cache
func (*PodManager) GetEvent ¶
func (pm *PodManager) GetEvent() chan *model.Message
GetEvent return a channel which receives event
func (*PodManager) GetPod ¶
func (pm *PodManager) GetPod(key string) types.FakePod
GetPod gets pod from cache
func (*PodManager) ListPods ¶
func (pm *PodManager) ListPods() []types.FakePod
ListPods lists all pods in cache
func (*PodManager) PodHandlerFunc ¶
func (pm *PodManager) PodHandlerFunc(w http.ResponseWriter, req *http.Request)
PodHandlerFunc is used to receive and process message
func (*PodManager) UpdatePodStatus ¶
func (pm *PodManager) UpdatePodStatus(k string, s string)
UpdatePodStatus update pod status in cache
type UpstreamController ¶
type UpstreamController struct {
// contains filtered or unexported fields
}
UpstreamController subscribe messages from edge
func NewUpstreamController ¶
func NewUpstreamController(context *context.Context, pm *PodManager) (*UpstreamController, error)
NewUpstreamController creates a upstream controller
func (*UpstreamController) Start ¶
func (uc *UpstreamController) Start() error
Start UpstreamController
func (*UpstreamController) Stop ¶
func (uc *UpstreamController) Stop() error
Stop UpstreamController
func (*UpstreamController) UpdatePodStatus ¶
func (uc *UpstreamController) UpdatePodStatus(stop chan struct{})
UpdatePodStatus is used to update pod status in cache map
func (*UpstreamController) WaitforMessage ¶
func (uc *UpstreamController) WaitforMessage(stop chan struct{})
WaitforMessage from cloudhub