Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidUserTypes = userTypes{ UserTypeIBRL, UserTypeIBRLWithAllocatedIP, UserTypeEdgeFiltering, UserTypeMulticast, }
Functions ¶
func ServeRoutesHandler ¶ added in v0.7.2
func ServeRoutesHandler(nlr bgp.RouteReaderWriter, lm LivenessManager, db DBReader, networkConfig *config.NetworkConfig) http.HandlerFunc
Types ¶
type ApiServer ¶
func NewApiServer ¶
type DBReader ¶ added in v0.7.2
type DBReader interface {
GetState(userTypes ...UserType) []*ProvisionRequest
}
type KernelState ¶ added in v0.7.2
type KernelState string
const ( KernelStateUnknown KernelState = "unknown" KernelStatePresent KernelState = "present" KernelStateAbsent KernelState = "absent" )
func (KernelState) String ¶ added in v0.7.2
func (r KernelState) String() string
type LivenessManager ¶ added in v0.7.2
type LivenessManager interface {
GetSessions() []liveness.SessionSnapshot
}
type Option ¶
type Option func(*ApiServer)
func WithBaseContext ¶
func WithHandler ¶
func WithSockFile ¶
type ProvisionRequest ¶
type ProvisionRequest struct {
UserType UserType `json:"user_type"`
TunnelSrc net.IP `json:"tunnel_src"`
TunnelDst net.IP `json:"tunnel_dst"`
TunnelNet *net.IPNet `json:"tunnel_net"`
DoubleZeroIP net.IP `json:"doublezero_ip"`
DoubleZeroPrefixes []*net.IPNet `json:"doublezero_prefixes"`
MulticastSubGroups []net.IP `json:"mcast_sub_groups"`
MulticastPubGroups []net.IP `json:"mcast_pub_groups"`
BgpLocalAsn uint32 `json:"bgp_local_asn"`
BgpRemoteAsn uint32 `json:"bgp_remote_asn"`
}
func (*ProvisionRequest) MarshalJSON ¶
func (p *ProvisionRequest) MarshalJSON() ([]byte, error)
func (*ProvisionRequest) UnmarshalJSON ¶
func (p *ProvisionRequest) UnmarshalJSON(data []byte) error
func (*ProvisionRequest) Validate ¶
func (p *ProvisionRequest) Validate() error
type RemoveRequest ¶
type RemoveRequest struct {
UserType UserType `json:"user_type"`
}
func (*RemoveRequest) Validate ¶
func (r *RemoveRequest) Validate() error
type Route ¶ added in v0.7.2
type Route struct {
Network string `json:"network"`
UserType UserType `json:"user_type"`
LocalIP string `json:"local_ip"`
PeerIP string `json:"peer_ip"`
KernelState KernelState `json:"kernel_state"`
LivenessLastUpdated string `json:"liveness_last_updated,omitempty"`
LivenessState string `json:"liveness_state,omitempty"`
LivenessStateReason string `json:"liveness_state_reason,omitempty"`
}
type StatusRequest ¶
type StatusRequest struct {
}
type StatusResponse ¶
type UserType ¶
type UserType int
func (UserType) FromString ¶
func (UserType) MarshalJSON ¶
func (*UserType) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.