Documentation ¶
Index ¶
- Constants
- func GetEndpointName() string
- type Action
- type Client
- type Command
- type CompositeEndpointAddons
- type Endpoint
- type IPAM
- type IpamService
- type IpamServiceImpl
- type ProcessEndpoints
- type ProcessInitActions
- type SingleAction
- type SingleEndpoint
- type UniversalCNFBackend
- type UniversalCNFConfig
- type UniversalCNFEndpoint
- func (uce *UniversalCNFEndpoint) Close(ctx context.Context, connection *connection.Connection) (*empty.Empty, error)
- func (uce *UniversalCNFEndpoint) Name() string
- func (uce *UniversalCNFEndpoint) Request(ctx context.Context, request *networkservice.NetworkServiceRequest) (*connection.Connection, error)
Constants ¶
const ( PEER_NAME = "ucnf/peerName" PodName = "nsepod.name" )
Variables ¶
This section is empty.
Functions ¶
func GetEndpointName ¶
func GetEndpointName() string
Types ¶
type Action ¶
type Action struct { Command *Command Client *Client DPConfig *vpp.ConfigData }
Action is a struct to describe exec.Command, a Client initiation or a Forwarder configuration
type CompositeEndpointAddons ¶
type CompositeEndpointAddons interface {
AddCompositeEndpoints(*common.NSConfiguration, *nseconfig.Endpoint) *[]networkservice.NetworkServiceServer
}
type Endpoint ¶
type Endpoint struct { Name string Labels map[string]string IfName string Ipam *IPAM Action *Action NseName string }
Endpoint is a struct to describe a NS Endpoint setup and the related VPP config changes
type IpamService ¶
func NewIpamService ¶
func NewIpamService(ctx context.Context, addr string) (IpamService, error)
type IpamServiceImpl ¶
type IpamServiceImpl struct { IpamAllocator ipprovider.AllocatorClient RegisteredSubnets chan *ipprovider.Subnet }
func (*IpamServiceImpl) AllocateSubnet ¶
func (i *IpamServiceImpl) AllocateSubnet(ucnfEndpoint *nseconfig.Endpoint) (string, error)
func (*IpamServiceImpl) Cleanup ¶
func (i *IpamServiceImpl) Cleanup(subnets map[string]*ipprovider.Subnet) error
type ProcessEndpoints ¶
type ProcessEndpoints struct {
Endpoints []*SingleEndpoint
}
ProcessEndpoints keeps the state of the running network service endpoints
func NewProcessEndpoints ¶
func NewProcessEndpoints(backend UniversalCNFBackend, endpoints []*nseconfig.Endpoint, nsconfig *common.NSConfiguration, ceAddons CompositeEndpointAddons, ctx context.Context) *ProcessEndpoints
NewProcessEndpoints returns a new ProcessInitCommands struct
func (*ProcessEndpoints) Cleanup ¶
func (pe *ProcessEndpoints) Cleanup()
Cleanup - cleans up before exit
func (*ProcessEndpoints) Process ¶
func (pe *ProcessEndpoints) Process() error
Process iterates over the init commands and applies them
type ProcessInitActions ¶
type ProcessInitActions struct {
InitActions []*SingleAction
}
ProcessInitActions keeps the state of the initial setup
func NewProcessInitActions ¶
func NewProcessInitActions(backend UniversalCNFBackend, initactions []*Action, nsConfig *common.NSConfiguration) *ProcessInitActions
NewProcessInitActions returns a new ProcessInitCommands struct
func (*ProcessInitActions) Cleanup ¶
func (pia *ProcessInitActions) Cleanup()
Cleanup - cleans up before exit
func (*ProcessInitActions) Process ¶
func (pia *ProcessInitActions) Process(ctx context.Context, backend UniversalCNFBackend) error
Process iterates over the init commands and applies them
type SingleAction ¶
type SingleAction struct { Action *Action // contains filtered or unexported fields }
SingleClient is a single client instance combining the CNF configuration and the NS Client
type SingleEndpoint ¶
type SingleEndpoint struct { NSConfiguration *common.NSConfiguration NSComposite networkservice.NetworkServiceServer Endpoint *nseconfig.Endpoint Cleanup func() }
SingleEndpoint keeps the state of a single endpoint instance
type UniversalCNFBackend ¶
type UniversalCNFBackend interface { NewDPConfig() *vpp.ConfigData NewUniversalCNFBackend() error ProcessClient(dpconfig interface{}, ifName string, conn *connection.Connection) error ProcessEndpoint(dpconfig interface{}, serviceName, ifName string, conn *connection.Connection) error ProcessDPConfig(dpconfig interface{}, update bool) error }
type UniversalCNFConfig ¶
type UniversalCNFConfig struct { InitActions []*Action Endpoints []*Endpoint // contains filtered or unexported fields }
UniversalCNFConfig hold the CNF configuration
func NewUniversalCNFConfig ¶
func NewUniversalCNFConfig(backend UniversalCNFBackend) (*UniversalCNFConfig, error)
NewUniversalCNFConfig creates an empty CNF configuration
func (*UniversalCNFConfig) Dump ¶
func (c *UniversalCNFConfig) Dump()
Dump dumps the current state of the CNF config using spew
func (*UniversalCNFConfig) GetBackend ¶
func (c *UniversalCNFConfig) GetBackend() UniversalCNFBackend
func (*UniversalCNFConfig) InitConfig ¶
func (c *UniversalCNFConfig) InitConfig(configpath string) error
InitConfig init CNF config from a specified path (or default)
func (*UniversalCNFConfig) InitConfigFromRawYaml ¶
func (c *UniversalCNFConfig) InitConfigFromRawYaml(rawyaml []byte) error
InitConfigFromRawYaml init CNF config from a byte slice
type UniversalCNFEndpoint ¶
type UniversalCNFEndpoint struct {
// contains filtered or unexported fields
}
UniversalCNFEndpoint is a Universal CNF Endpoint composite implementation
func NewUniversalCNFEndpoint ¶
func NewUniversalCNFEndpoint(backend UniversalCNFBackend, e *nseconfig.Endpoint) *UniversalCNFEndpoint
NewUniversalCNFEndpoint creates a MonitorEndpoint
func (*UniversalCNFEndpoint) Close ¶
func (uce *UniversalCNFEndpoint) Close(ctx context.Context, connection *connection.Connection) (*empty.Empty, error)
Close implements the close handler
func (*UniversalCNFEndpoint) Name ¶
func (uce *UniversalCNFEndpoint) Name() string
Name returns the composite name
func (*UniversalCNFEndpoint) Request ¶
func (uce *UniversalCNFEndpoint) Request(ctx context.Context, request *networkservice.NetworkServiceRequest) (*connection.Connection, error)
Request implements the request handler