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) []*nspAPI.Conduit
- func ConvertFlows(flows []*Flow, streams []*nspAPI.Stream, vips []*nspAPI.Vip) []*nspAPI.Flow
- func ConvertGateways(gateways []*Gateway, trench *nspAPI.Trench) []*nspAPI.Gateway
- 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 Conduit
- type ConduitList
- type Flow
- type FlowList
- type Gateway
- type GatewayList
- 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 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 ¶
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"` LocalPort uint16 `yaml:"local-port,omitempty"` 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"` }
func UnmarshalGateways ¶
type GatewayList ¶
type GatewayList struct {
Gateways []*Gateway `yaml:"items"`
}
type Stream ¶
func UnmarshalStreams ¶
type StreamList ¶
type StreamList struct {
Streams []*Stream `yaml:"items"`
}
Click to show internal directories.
Click to hide internal directories.