registry

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Trench = iota
	Conduit
	Stream
	Flow
	Vip
	Attractor
	Gateway
)

types of resource

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationEvent

type ConfigurationEvent struct {
	ResourceType ResourceType
}

ConfigurationEvent reprensent the struct which will be sent on any resource modification

type ConfigurationRegistry

type ConfigurationRegistry struct {
	// Chan is the channel which will send the event on any
	// resource modification
	Chan chan<- *ConfigurationEvent
	// contains filtered or unexported fields
}

ConfigurationRegistry is a memory registry for the meridio configuration. It can register and get all resources: trench conduits, streams, flows, vips, attractors and gateways. On any resource modification, a event is sent via a channel

func New

func New(configurationEventChan chan<- *ConfigurationEvent) *ConfigurationRegistry

New is the constructor of ConfigurationRegistry.

func (*ConfigurationRegistry) GetAttractors

func (cr *ConfigurationRegistry) GetAttractors(attractor *nspAPI.Attractor) []*nspAPI.Attractor

GetAttractors returns attractors with the same name (ignored if empty) and the same parent as the one in parameter. If the attractor in parameter is nil, all attractors will be returned

func (*ConfigurationRegistry) GetConduits

func (cr *ConfigurationRegistry) GetConduits(conduit *nspAPI.Conduit) []*nspAPI.Conduit

GetConduits returns conduits with the same name (ignored if empty) and the same parent as the one in parameter. If the conduit in parameter is nil, all conduits will be returned

func (*ConfigurationRegistry) GetFlows

func (cr *ConfigurationRegistry) GetFlows(flow *nspAPI.Flow) []*nspAPI.Flow

GetFlows returns flows with the same name (ignored if empty) and the same parent as the one in parameter. If the flow in parameter is nil, all flows will be returned

func (*ConfigurationRegistry) GetGateways

func (cr *ConfigurationRegistry) GetGateways(gateway *nspAPI.Gateway) []*nspAPI.Gateway

GetGateways returns gateways with the same name (ignored if empty) and the same parent as the one in parameter. If the gateway in parameter is nil, all gateways will be returned

func (*ConfigurationRegistry) GetStreams

func (cr *ConfigurationRegistry) GetStreams(stream *nspAPI.Stream) []*nspAPI.Stream

GetStreams returns streams with the same name (ignored if empty) and the same parent as the one in parameter. If the stream in parameter is nil, all streams will be returned

func (*ConfigurationRegistry) GetTrench

func (cr *ConfigurationRegistry) GetTrench(trench *nspAPI.Trench) *nspAPI.Trench

GetTrench returns a trench with the same name as the one in parameter if existing. If the trench in parameter is nil, the registered trench will be returned

func (*ConfigurationRegistry) GetVips

func (cr *ConfigurationRegistry) GetVips(vip *nspAPI.Vip) []*nspAPI.Vip

GetVips returns vips with the same name (ignored if empty) and the same parent as the one in parameter. If the vip in parameter is nil, all vips will be returned

func (*ConfigurationRegistry) SetAttractors

func (cr *ConfigurationRegistry) SetAttractors(attractors []*nspAPI.Attractor)

SetAttractors sets the attractors and notifies the change via the channel with the resource type as Attractor

func (*ConfigurationRegistry) SetConduits

func (cr *ConfigurationRegistry) SetConduits(conduits []*nspAPI.Conduit)

SetConduits sets the conduits and notifies the change via the channel with the resource type as Conduit

func (*ConfigurationRegistry) SetFlows

func (cr *ConfigurationRegistry) SetFlows(flows []*nspAPI.Flow)

SetFlows sets the flows and notifies the change via the channel with the resource type as Flow

func (*ConfigurationRegistry) SetGateways

func (cr *ConfigurationRegistry) SetGateways(gateways []*nspAPI.Gateway)

SetGateways sets the gateways and notifies the change via the channel with the resource type as Gateway

func (*ConfigurationRegistry) SetStreams

func (cr *ConfigurationRegistry) SetStreams(streams []*nspAPI.Stream)

SetStreams sets the streams and notifies the change via the channel with the resource type as Stream

func (*ConfigurationRegistry) SetTrench

func (cr *ConfigurationRegistry) SetTrench(trench *nspAPI.Trench)

SetTrench sets the trench and notifies the change via the channel with the resource type as Trench

func (*ConfigurationRegistry) SetVips

func (cr *ConfigurationRegistry) SetVips(vips []*nspAPI.Vip)

SetVips sets the vips and notifies the change via the channel with the resource type as Vip

type ResourceType

type ResourceType int

Jump to

Keyboard shortcuts

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