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
- func ConvertAll(trench *Trench, conduits []*Conduit, streams []*Stream, flows []*Flow, ...) (*nspAPI.Trench, []*nspAPI.Conduit, []*nspAPI.Stream, []*nspAPI.Flow, ...)
- func ConvertAttractors(attractors []*Attractor, trench *nspAPI.Trench, vips []*nspAPI.Vip, ...) []*nspAPI.Attractor
- func ConvertConduits(conduits []*Conduit, trench *nspAPI.Trench, vips []*nspAPI.Vip) []*nspAPI.Conduit
- func ConvertFlows(flows []*Flow, streams []*nspAPI.Stream, vips []*nspAPI.Vip) []*nspAPI.Flow
- func ConvertGateways(gateways []*Gateway, trench *nspAPI.Trench) []*nspAPI.Gateway
- func ConvertPortNats(portNats []*PortNat, vipsAPI []*nspAPI.Vip) []*nspAPI.Conduit_PortNat
- func ConvertStreams(streams []*Stream, conduits []*nspAPI.Conduit) []*nspAPI.Stream
- func ConvertTrench(trench *Trench) *nspAPI.Trench
- func ConvertVips(vips []*Vip, trench *nspAPI.Trench) []*nspAPI.Vip
- func UnmarshalConfig(data map[string]string) (*Trench, []*Conduit, []*Stream, []*Flow, []*Vip, []*Attractor, []*Gateway, ...)
- func ValidByteMatch(byteMatch string) bool
- type Attractor
- type AttractorList
- type BgpAuth
- type Conduit
- type ConduitList
- type Flow
- type FlowList
- type Gateway
- type GatewayList
- type PortNat
- type Stream
- type StreamList
- type Trench
- type Vip
- type VipList
Constants ¶
View Source
const ( TrenchConfigKey = "trench" ConduitsConfigKey = "conduits" StreamsConfigKey = "streams" FlowsConfigKey = "flows" VipsConfigKey = "vips" AttractorsConfigKey = "attractors" GatewaysConfigKey = "gateways" )
View Source
const (
ByteMatchPattern = `^(sctp|tcp|udp)\[[0-9]+ *: *[124]\]( *& *0x[0-9a-f]+)? *= *([0-9]+|0x[0-9a-f]+)$`
)
Variables ¶
This section is empty.
Functions ¶
func ConvertAll ¶
func ConvertAttractors ¶
func ConvertConduits ¶
func ConvertFlows ¶
func ConvertGateways ¶
func ConvertPortNats ¶ added in v0.8.0
func ConvertPortNats(portNats []*PortNat, vipsAPI []*nspAPI.Vip) []*nspAPI.Conduit_PortNat
func ConvertStreams ¶
func ConvertTrench ¶
func UnmarshalConfig ¶
func ValidByteMatch ¶ added in v0.7.0
Types ¶
type Attractor ¶
type Attractor struct { Name string `yaml:"name"` Vips []string `yaml:"vips"` Gateways []string `yaml:"gateways"` Trench string `yaml:"trench"` }
func UnmarshalAttractors ¶
type AttractorList ¶
type AttractorList struct {
Attractors []*Attractor `yaml:"items"`
}
type Conduit ¶
type Conduit struct { Name string `yaml:"name"` Trench string `yaml:"trench"` DestinationPortNats []*PortNat `yaml:"destination-port-nats,omitempty"` }
func UnmarshalConduits ¶
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"` ByteMatches []string `yaml:"byte-matches,omitempty"` }
func UnmarshalFlows ¶
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"` BGPAuth *BgpAuth `yaml:"bgp-auth,omitempty"` }
func UnmarshalGateways ¶
type GatewayList ¶
type GatewayList struct {
Gateways []*Gateway `yaml:"items"`
}
type Stream ¶
type Stream struct { Name string `yaml:"name"` Conduit string `yaml:"conduit"` MaxTargets uint32 `yaml:"max-targets"` }
func UnmarshalStreams ¶
type StreamList ¶
type StreamList struct {
Streams []*Stream `yaml:"items"`
}
Click to show internal directories.
Click to hide internal directories.