engine

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package engine implements the Seesaw v2 engine component, which is responsible for maintaining configuration information, handling state transitions and providing communication between Seesaw v2 components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine contains the data necessary to run the Seesaw v2 Engine.

func NewEngine

func NewEngine(cfg *config.EngineConfig) *Engine

NewEngine returns an initialised Engine struct.

func (*Engine) Run

func (e *Engine) Run()

Run starts the Engine.

func (*Engine) Shutdown

func (e *Engine) Shutdown()

Shutdown attempts to perform a graceful shutdown of the engine.

type SeesawEngine

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

SeesawEngine provides the IPC interface to the Seesaw Engine.

func (*SeesawEngine) BGPNeighbors

func (s *SeesawEngine) BGPNeighbors(ctx *ipc.Context, reply *quagga.Neighbors) error

BGPNeighbors returns a list of the BGP neighbors that we are peering with.

func (*SeesawEngine) Backends

func (s *SeesawEngine) Backends(ctx *ipc.Context, reply *int) error

Backends returns a list of currently configured Backends.

func (*SeesawEngine) ClusterStatus

func (s *SeesawEngine) ClusterStatus(ctx *ipc.Context, reply *seesaw.ClusterStatus) error

ClusterStatus returns status information about this Seesaw Cluster.

func (*SeesawEngine) ConfigReload

func (s *SeesawEngine) ConfigReload(ctx *ipc.Context, reply *int) error

ConfigReload requests a configuration reload.

func (*SeesawEngine) ConfigSource

func (s *SeesawEngine) ConfigSource(args *ipc.ConfigSource, oldSource *string) error

ConfigSource requests the configuration source be changed to the specified source. The name of the original source is returned.

func (*SeesawEngine) ConfigStatus

func (s *SeesawEngine) ConfigStatus(ctx *ipc.Context, reply *seesaw.ConfigStatus) error

ConfigStatus returns status information about this Seesaw's current configuration.

func (*SeesawEngine) Failover

func (s *SeesawEngine) Failover(ctx *ipc.Context, reply *int) error

Failover requests the Seesaw Engine to relinquish master state.

func (*SeesawEngine) HAConfig

func (s *SeesawEngine) HAConfig(ctx *ipc.Context, reply *seesaw.HAConfig) error

HAConfig returns the high-availability configuration for this node as determined by the engine.

func (*SeesawEngine) HAState

func (s *SeesawEngine) HAState(args *ipc.HAState, reply *int) error

HAState advises the Engine of the current high-availability state as determined by the Seesaw HA component.

func (*SeesawEngine) HAStatus

func (s *SeesawEngine) HAStatus(ctx *ipc.Context, status *seesaw.HAStatus) error

HAStatus returns the current HA status from the Seesaw Engine.

func (*SeesawEngine) HAUpdate

func (s *SeesawEngine) HAUpdate(args *ipc.HAStatus, failover *bool) error

HAUpdate advises the Engine of the current high-availability status for the Seesaw HA component. The Seesaw Engine may also request a failover in response.

func (*SeesawEngine) HealthState

func (s *SeesawEngine) HealthState(args *healthcheck.HealthState, reply *int) error

HealthState advises the Seesaw Engine of state transitions for a set of healthchecks that are being performed by the Seesaw Healthcheck component.

func (*SeesawEngine) Healthchecks

func (s *SeesawEngine) Healthchecks(ctx *ipc.Context, reply *healthcheck.Checks) error

Healthchecks returns a list of currently configured healthchecks that should be performed by the Seesaw Healthcheck component.

func (*SeesawEngine) OverrideBackend

func (s *SeesawEngine) OverrideBackend(args *ipc.Override, reply *int) error

OverrideBackend passes a BackendOverride to the engine.

func (*SeesawEngine) OverrideDestination

func (s *SeesawEngine) OverrideDestination(args *ipc.Override, reply *int) error

OverrideDestination passes a DestinationOverride to the engine.

func (*SeesawEngine) OverrideVserver

func (s *SeesawEngine) OverrideVserver(args *ipc.Override, reply *int) error

OverrideVserver passes a VserverOverride to the engine.

func (*SeesawEngine) VLANs

func (s *SeesawEngine) VLANs(ctx *ipc.Context, reply *seesaw.VLANs) error

VLANs returns a list of VLANs configured for this cluster.

func (*SeesawEngine) Vservers

func (s *SeesawEngine) Vservers(ctx *ipc.Context, reply *seesaw.VserverMap) error

Vservers returns a list of currently configured vservers.

type SeesawSync

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

SeesawSync provides the synchronisation RPC interface to the Seesaw Engine.

func (*SeesawSync) Config

func (s *SeesawSync) Config(arg int, config *config.Notification) error

Config requests the current configuration from the peer Seesaw node.

func (*SeesawSync) Deregister

func (s *SeesawSync) Deregister(id SyncSessionID, reply *int) error

Deregister deregisters a Seesaw peer for synchronisation.

func (*SeesawSync) Failover

func (s *SeesawSync) Failover(arg int, reply *int) error

Failover requests that we relinquish master state.

func (*SeesawSync) Healthchecks

func (s *SeesawSync) Healthchecks(arg int, reply *int) error

Healthchecks requests the current healthchecks from the peer Seesaw node.

func (*SeesawSync) Poll

func (s *SeesawSync) Poll(id SyncSessionID, sn *SyncNotes) error

Poll returns one or more synchronisation notifications to the caller, blocking until at least one notification becomes available or the poll timeout is reached.

func (*SeesawSync) Register

func (s *SeesawSync) Register(node net.IP, id *SyncSessionID) error

Register registers our Seesaw peer for synchronisation notifications.

type SyncNote

type SyncNote struct {
	Type SyncNoteType

	Config      *config.Notification
	Healthcheck *healthcheck.Notification

	BackendOverride     *seesaw.BackendOverride
	DestinationOverride *seesaw.DestinationOverride
	VserverOverride     *seesaw.VserverOverride
}

SyncNote represents a synchronisation notification.

type SyncNoteType

type SyncNoteType int

SyncNoteType specifies the type of a synchronisation notification.

const (
	SNTHeartbeat SyncNoteType = iota
	SNTDesync
	SNTConfigUpdate
	SNTHealthcheck
	SNTOverride
)

func (SyncNoteType) String

func (snt SyncNoteType) String() string

String returns the string representation of a synchronisation notification type.

type SyncNotes

type SyncNotes struct {
	Notes []SyncNote
}

SyncNotes specifies a collection of SyncNotes.

type SyncSessionID

type SyncSessionID uint64

SyncSessionID specifies a synchronisation session identifier.

Directories

Path Synopsis
Package config implements functions to manage the configuration for a Seesaw v2 engine.
Package config implements functions to manage the configuration for a Seesaw v2 engine.

Jump to

Keyboard shortcuts

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