reader

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 2 Imported by: 6

Documentation

Overview

Package reader provides an implementation to read the meridio configmap and convert it to Network Service Platform (NSP) API stucture instances.

Index

Constants

View Source
const (
	TrenchConfigKey     = "trench"
	ConduitsConfigKey   = "conduits"
	StreamsConfigKey    = "streams"
	FlowsConfigKey      = "flows"
	VipsConfigKey       = "vips"
	AttractorsConfigKey = "attractors"
	GatewaysConfigKey   = "gateways"
)

Variables

This section is empty.

Functions

func ConvertAll

func ConvertAll(
	trench *Trench,
	conduits []*Conduit,
	streams []*Stream,
	flows []*Flow,
	vips []*Vip,
	attractors []*Attractor,
	gateways []*Gateway,
) (
	*nspAPI.Trench,
	[]*nspAPI.Conduit,
	[]*nspAPI.Stream,
	[]*nspAPI.Flow,
	[]*nspAPI.Vip,
	[]*nspAPI.Attractor,
	[]*nspAPI.Gateway,
)

func ConvertAttractors

func ConvertAttractors(attractors []*Attractor, trench *nspAPI.Trench, vips []*nspAPI.Vip, gateways []*nspAPI.Gateway) []*nspAPI.Attractor

func ConvertConduits

func ConvertConduits(conduits []*Conduit, trench *nspAPI.Trench) []*nspAPI.Conduit

func ConvertFlows

func ConvertFlows(flows []*Flow, streams []*nspAPI.Stream, vips []*nspAPI.Vip) []*nspAPI.Flow

func ConvertGateways

func ConvertGateways(gateways []*Gateway, trench *nspAPI.Trench) []*nspAPI.Gateway

func ConvertStreams

func ConvertStreams(streams []*Stream, conduits []*nspAPI.Conduit) []*nspAPI.Stream

func ConvertTrench

func ConvertTrench(trench *Trench) *nspAPI.Trench

func ConvertVips

func ConvertVips(vips []*Vip, trench *nspAPI.Trench) []*nspAPI.Vip

func UnmarshalConfig

func UnmarshalConfig(data map[string]string) (
	*Trench,
	[]*Conduit,
	[]*Stream,
	[]*Flow,
	[]*Vip,
	[]*Attractor,
	[]*Gateway,
	error)

Types

type Attractor

type Attractor struct {
	Name     string   `yaml:"name"`
	Vips     []string `yaml:"vips"`
	Gateways []string `yaml:"gateways"`
	Trench   string   `yaml:"trench"`
}

func UnmarshalAttractors

func UnmarshalAttractors(c string) ([]*Attractor, error)

type AttractorList

type AttractorList struct {
	Attractors []*Attractor `yaml:"items"`
}

type Conduit

type Conduit struct {
	Name   string `yaml:"name"`
	Trench string `yaml:"trench"`
}

func UnmarshalConduits

func UnmarshalConduits(c string) ([]*Conduit, error)

type ConduitList

type ConduitList struct {
	Conduits []*Conduit `yaml:"items"`
}

type Flow

type Flow struct {
	Name                  string   `yaml:"name"`
	SourceSubnets         []string `yaml:"source-subnets"`
	DestinationPortRanges []string `yaml:"destination-port-ranges"`
	SourcePortRanges      []string `yaml:"source-port-ranges"`
	Protocols             []string `yaml:"protocols"`
	Vips                  []string `yaml:"vips"`
	Priority              int32    `yaml:"priority"`
	Stream                string   `yaml:"stream"`
}

func UnmarshalFlows

func UnmarshalFlows(c string) ([]*Flow, error)

type FlowList

type FlowList struct {
	Flows []*Flow `yaml:"items"`
}

type Gateway

type Gateway struct {
	Name       string `yaml:"name"`
	Address    string `yaml:"address"`
	RemoteASN  uint32 `yaml:"remote-asn,omitempty"`
	LocalASN   uint32 `yaml:"local-asn,omitempty"`
	RemotePort uint16 `yaml:"remote-port,omitempty"`
	LocalPort  uint16 `yaml:"local-port,omitempty"`
	IPFamily   string `yaml:"ip-family"`
	BFD        bool   `yaml:"bfd"`
	Protocol   string `yaml:"protocol"`
	HoldTime   uint   `yaml:"hold-time,omitempty"`
	MinTx      uint   `yaml:"min-tx,omitempty"`
	MinRx      uint   `yaml:"min-rx,omitempty"`
	Multiplier uint   `yaml:"multiplier,omitempty"`
	Trench     string `yaml:"trench"`
}

func UnmarshalGateways

func UnmarshalGateways(c string) ([]*Gateway, error)

type GatewayList

type GatewayList struct {
	Gateways []*Gateway `yaml:"items"`
}

type Stream

type Stream struct {
	Name    string `yaml:"name"`
	Conduit string `yaml:"conduit"`
}

func UnmarshalStreams

func UnmarshalStreams(c string) ([]*Stream, error)

type StreamList

type StreamList struct {
	Streams []*Stream `yaml:"items"`
}

type Trench

type Trench struct {
	Name string `yaml:"name"`
}

func UnmarshalTrench

func UnmarshalTrench(c string) (*Trench, error)

type Vip

type Vip struct {
	Name    string `yaml:"name"`
	Address string `yaml:"address"`
	Trench  string `yaml:"trench"`
}

func UnmarshalVips

func UnmarshalVips(c string) ([]*Vip, error)

type VipList

type VipList struct {
	Vips []*Vip `yaml:"items"`
}

Jump to

Keyboard shortcuts

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