topo

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) (*tpb.Topology, error)

Load loads a Topology from path.

Types

type Manager

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

Manager is a topology manager for a cluster instance.

func New

func New(topo *tpb.Topology, opts ...Option) (*Manager, error)

New creates a new Manager based on the provided topology. The cluster config passed from the WithClusterConfig option overrides the determined in-cluster config. If neither of these configurations can be used then the kubecfg passed from the WithKubecfg option will be used to determine the cluster config.

func (*Manager) ConfigPush

func (m *Manager) ConfigPush(ctx context.Context, nodeName string, r io.Reader) error

ConfigPush will push config to the provided node. If the node does not fulfill ConfigPusher then status.Unimplemented error will be returned.

func (*Manager) Create added in v0.1.3

func (m *Manager) Create(ctx context.Context, timeout time.Duration) error

Create creates the topology in the cluster.

func (*Manager) Delete

func (m *Manager) Delete(ctx context.Context) error

Delete deletes the topology from the cluster.

func (*Manager) GenerateSelfSigned added in v0.1.3

func (m *Manager) GenerateSelfSigned(ctx context.Context, nodeName string) error

GenerateSelfSigned will create self signed certs on the provided node. If the node does not have cert info then it is a noop. If the node does not fulfill Certer then status.Unimplemented error will be returned.

func (*Manager) Nodes

func (m *Manager) Nodes() map[string]node.Node

Nodes returns a map of node names to implementations in the current topology.

func (*Manager) ResetCfg added in v0.1.3

func (m *Manager) ResetCfg(ctx context.Context, nodeName string) error

ResetCfg will reset the config for the provided node. If the node does not fulfill Resetter then status.Unimplemented error will be returned.

func (*Manager) Resources

func (m *Manager) Resources(ctx context.Context) (*Resources, error)

Resources gets the currently configured resources from the topology.

func (*Manager) Show added in v0.1.3

Show returns the topology information including services and node health.

func (*Manager) Watch

func (m *Manager) Watch(ctx context.Context) error

type Option

type Option func(m *Manager)

func WithBasePath

func WithBasePath(s string) Option

func WithClusterConfig

func WithClusterConfig(r *rest.Config) Option

func WithKubeClient

func WithKubeClient(c kubernetes.Interface) Option

func WithKubecfg added in v0.1.3

func WithKubecfg(k string) Option

func WithTopoClient

func WithTopoClient(c topologyclientv1.Interface) Option

type Resources

type Resources struct {
	Services   map[string][]*corev1.Service
	Pods       map[string][]*corev1.Pod
	ConfigMaps map[string]*corev1.ConfigMap
	Topologies map[string]*topologyv1.Topology
}

Directories

Path Synopsis
lemming
Package lemming contains a node implementation for a lemming device.
Package lemming contains a node implementation for a lemming device.
srl

Jump to

Keyboard shortcuts

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