daemon

package
v0.0.0-...-fbf086c Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllServiceWorkers

func GetAllServiceWorkers() *list.List

GetAllServiceWorkers returns a list of all services workers currently active

Types

type ConfigApplierWorker

type ConfigApplierWorker struct {
	StoppableByChan
	// contains filtered or unexported fields
}

ConfigApplierWorker is a worker listening on the update channel and applying new configurations.

func NewConfigApplierWorker

func NewConfigApplierWorker(updateChan ConfigUpdateChanType, ipvsUpdateChan IPVSApplierChanType, publisherConfigUpdateChan PublisherConfigUpdateChanType) *ConfigApplierWorker

NewConfigApplierWorker creates a Configuration applier worker based on an update channel.

func (*ConfigApplierWorker) Worker

func (s *ConfigApplierWorker) Worker()

type ConfigUpdateChanType

type ConfigUpdateChanType chan model.IPVSMeshConfig

ConfigUpdateChanType is a channel that transmits updated configuration

type ConfigWatcherWorker

type ConfigWatcherWorker struct {
	StoppableByChan
	// contains filtered or unexported fields
}

ConfigWatcherWorker is a continuously running loop watching changes on a given config file. If the file changes, it is read, parsed and passed on to an update channel.

func NewConfigWatcherWorker

func NewConfigWatcherWorker(configFileName string, updateChan ConfigUpdateChanType, onceFlag bool) *ConfigWatcherWorker

NewConfigWatcherWorker creates a new watcher on given config file. It reads changes and sends updates to updateChan

func (*ConfigWatcherWorker) Worker

func (s *ConfigWatcherWorker) Worker()

type IPVSApplierChanType

type IPVSApplierChanType chan IPVSApplierUpdateStruct

IPVSApplierChanType ...

type IPVSApplierUpdateStruct

type IPVSApplierUpdateStruct struct {
	// contains filtered or unexported fields
}

IPVSApplierUpdateStruct is a message from a plugin with a downward api. The message affects a single service from the model and contains data updates.

type IPVSApplierWorker

type IPVSApplierWorker struct {
	StoppableByChan
	// contains filtered or unexported fields
}

IPVSApplierWorker is a worker maintaining the recent ipvs configuration model. It receives downward api updates from a channel and merges them into the model, updating state using ipvsctl

func NewIPVSApplierWorker

func NewIPVSApplierWorker(updateChan IPVSApplierChanType, publisherUpdateChan PublisherUpdateChanType) *IPVSApplierWorker

NewIPVSApplierWorker creates an IPVS applier worker based on an update channel and the recent model

func (*IPVSApplierWorker) Worker

func (s *IPVSApplierWorker) Worker()

Worker ...

type PublisherConfigUpdateChanType

type PublisherConfigUpdateChanType chan model.IPVSMeshConfig

PublisherConfigUpdateChanType is for configuration updates

type PublisherUpdate

type PublisherUpdate struct {
	// contains filtered or unexported fields
}

PublisherUpdate is a message from the ipvs applier indicating that an endpoint has changed. It is the raw data structure for the ipvsctl model

type PublisherUpdateChanType

type PublisherUpdateChanType chan PublisherUpdate

PublisherUpdateChanType is for backend updates

type PublisherhWorker

type PublisherhWorker struct {
	StoppableByChan
	// contains filtered or unexported fields
}

PublisherhWorker takes care about a single service of the current configuration model.

func NewPublisherWorker

func NewPublisherWorker(updateChan PublisherUpdateChanType, configUpdateCh PublisherConfigUpdateChanType, onceFlag bool, onceCh chan struct{}) *PublisherhWorker

NewPublisherWorker creates a worker for publish notifications

func (*PublisherhWorker) Worker

func (s *PublisherhWorker) Worker()

Worker checks downward notifications

type Service

type Service struct {
	StoppableByChan
	GroupID int
	// contains filtered or unexported fields
}

Service is a service that is able to stop the background daemon (as grpc service)

func NewService

func NewService(groupID int) *Service

NewService creates a new instance of the stoppable daemon service

func (*Service) Register

func (s *Service) Register(stoppable *StoppableByChan)

Register adds a new StoppableByChan to the list of registered services

func (*Service) Start

func (s *Service) Start(ctx context.Context)

Start starts the background service

func (*Service) Stop

Stop stops all running services

type ServiceWorker

type ServiceWorker struct {
	StoppableByChan
	// contains filtered or unexported fields
}

ServiceWorker takes care about a single service of the current configuration model.

func GetServiceWorkerByName

func GetServiceWorkerByName(name string) *ServiceWorker

GetServiceWorkerByName retrieves a single ServiceWorker by the name of its service within the model.

func NewServiceWorker

func NewServiceWorker(sc chan *sync.WaitGroup, cfg *model.IPVSMeshConfig, service *model.Service, ipvsUpdateChan IPVSApplierChanType) *ServiceWorker

NewServiceWorker creates a new ServiceWorker for a single service of a configuration model.

func (*ServiceWorker) Update

func (s *ServiceWorker) Update(newService *model.Service)

Update applies configuration updates to a ServiceWorker

func (*ServiceWorker) Worker

func (s *ServiceWorker) Worker()

Worker checks downward notifications

type StoppableByChan

type StoppableByChan struct {
	StopChan *chan *sync.WaitGroup
}

StoppableByChan is a service part that can be stopped by sending to given channel

Jump to

Keyboard shortcuts

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