ecu

package
v0.0.0-...-1cdf2d7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Overview

Package ecu implements the Seesaw v2 ECU component, which provides an externally accessible interface to monitor and control the Seesaw Node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	// AuthInit will be called once when the ECU is run to set up required
	// resources for authentication. If nothing is needed, it should simply
	// return nil. If an error is returned, a warning will be
	// logged but the ECU will continue to run, so implementations should ensure
	// Authenticate does not crash if AuthInit fails.
	AuthInit() error

	// Authenticate inspects the provided context (particularly ctx.AuthToken)
	// and either returns an error or creates a child context treated as
	// authenticated (ctx.AuthType == ipc.ATSSO) and fields needed for
	// authorization checks (ctx.User).
	Authenticate(ctx *ipc.Context) (*ipc.Context, error)
}

Authenticator types provide functionality for authenticating users and adding the authenticated information to a context.

type Config

type Config struct {
	Authenticator   Authenticator
	CACertsFile     string
	ControlAddress  string
	ECUCertFile     string
	ECUKeyFile      string
	EngineSocket    string
	MonitorAddress  string
	StatsPublishers []Publisher
	UpdateInterval  time.Duration
}

Config provides configuration details for a Seesaw ECU.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default ECU configuration.

type DefaultAuthenticator

type DefaultAuthenticator struct{}

DefaultAuthenticator implements a "default-deny authenticator" that denies all authentications. Using this prevents remote connections to the ECU.

func (DefaultAuthenticator) AuthInit

func (DefaultAuthenticator) AuthInit() error

AuthInit does nothing and returns nil.

func (DefaultAuthenticator) Authenticate

func (DefaultAuthenticator) Authenticate(ctx *ipc.Context) (*ipc.Context, error)

Authenticate returns a "default deny" error.

type ECU

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

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

func New

func New(cfg *Config) *ECU

New returns an initialised ECU struct.

func (*ECU) Run

func (e *ECU) Run()

Run starts the ECU.

func (*ECU) Shutdown

func (e *ECU) Shutdown()

Shutdown notifies the ECU to shutdown.

type Publisher

type Publisher interface {
	Update(s *Stats)
}

Publisher is an interface for a statistics publisher. Publishers are notified of updates to the statistics with the Update method.

type SeesawECU

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

SeesawECU provides the RPC interface to the Seesaw ECU.

func (*SeesawECU) BGPNeighbors

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

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

func (*SeesawECU) Backends

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

Backends returns a list of currently configured Backends.

func (*SeesawECU) ClusterStatus

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

ClusterStatus returns status information about this Seesaw Cluster.

func (*SeesawECU) ConfigReload

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

ConfigReload requests a configuration reload.

func (*SeesawECU) ConfigSource

func (s *SeesawECU) 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 (*SeesawECU) ConfigStatus

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

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

func (*SeesawECU) Failover

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

Failover requests the Seesaw Engine to relinquish master state.

func (*SeesawECU) HAStatus

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

HAStatus returns the current HA status from the Seesaw Engine.

func (*SeesawECU) OverrideBackend

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

OverrideBackend requests that the specified BackendOverride be applied.

func (*SeesawECU) OverrideDestination

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

OverrideDestination requests that the specified DestinationOverride be applied.

func (*SeesawECU) OverrideVserver

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

OverrideVserver requests that the specified VserverOverride be applied.

func (*SeesawECU) VLANs

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

VLANs returns a list of currently configured VLANs.

func (*SeesawECU) Vservers

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

Vservers returns a list of currently configured vservers.

type Stats

type Stats struct {
	LastUpdate  time.Time
	LastSuccess time.Time

	ClusterStatus seesaw.ClusterStatus
	ConfigStatus  seesaw.ConfigStatus
	HAStatus      seesaw.HAStatus
	Neighbors     []*quagga.Neighbor
	VLANs         []*seesaw.VLAN
	Vservers      map[string]*seesaw.Vserver
}

Stats contains the statistics collected from the Seesaw Engine.

Jump to

Keyboard shortcuts

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