controllerstub

package
v0.0.0-...-2d43aa0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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) Cleanup

func (cs *ControllerStub) Cleanup()

Cleanup resources

func (*ControllerStub) Group

func (*ControllerStub) Group() string

Return module group

func (*ControllerStub) Name

func (*ControllerStub) Name() string

Return module name

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 NewPodManager

func NewPodManager() (*PodManager, error)

NewPodManager creates pod manger

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

Jump to

Keyboard shortcuts

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