Documentation ¶
Index ¶
- type Cache
- type Circuit
- type Controller
- type Controllers
- type InvalidSessionError
- type Link
- type LinkMode
- type LinkState
- type MultipleErrors
- type Network
- func (network *Network) AcceptMetrics(metrics *metrics_pb.MetricsMessage)
- func (network *Network) AddCapability(capability string)
- func (network *Network) AddRouterPresenceHandler(h RouterPresenceHandler)
- func (network *Network) AllConnectedRouters() []*Router
- func (network *Network) ConnectRouter(r *Router)
- func (network *Network) ConnectedRouter(id string) bool
- func (network *Network) CreateCircuit(srcR, dstR *Router) (*Circuit, error)
- func (network *Network) CreateCircuitWithPath(path []*Router) (*Circuit, error)
- func (network *Network) CreateRouter(router *Router) error
- func (network *Network) CreateSession(srcR *Router, clientId *identity.TokenId, serviceId string) (*session, error)
- func (network *Network) Debug() string
- func (network *Network) DisconnectRouter(r *Router)
- func (network *Network) GetAllLinks() []*Link
- func (network *Network) GetAllLinksForRouter(routerId string) []*Link
- func (network *Network) GetAllSessions() []*session
- func (network *Network) GetAppId() *identity.TokenId
- func (network *Network) GetCapabilities() []string
- func (network *Network) GetConnectedRouter(routerId string) *Router
- func (network *Network) GetControllers() *Controllers
- func (network *Network) GetDb() boltz.Db
- func (network *Network) GetLink(linkId *identity.TokenId) (*Link, bool)
- func (network *Network) GetMetricsEventController() metrics.EventController
- func (network *Network) GetRouter(routerId string) (*Router, error)
- func (network *Network) GetServiceCache() Cache
- func (network *Network) GetSession(sessionId *identity.TokenId) (*session, bool)
- func (network *Network) GetSessionLifeCycleController() SessionLifeCycleController
- func (network *Network) GetStores() *db.Stores
- func (network *Network) GetTraceController() trace.Controller
- func (network *Network) GetTraceEventController() trace.EventController
- func (network *Network) LinkChanged(l *Link)
- func (network *Network) LinkConnected(id *identity.TokenId, connected bool) error
- func (network *Network) RemoveSession(sessionId *identity.TokenId, now bool) error
- func (network *Network) RouterChanged(r *Router)
- func (network *Network) Run()
- func (network *Network) Shutdown()
- func (network *Network) StartSessionEgress(sessionId *identity.TokenId) error
- func (network *Network) UpdateCircuit(circuit *Circuit) (*Circuit, error)
- func (network *Network) ValidateTerminators(r *Router)
- type Options
- type PathAndCost
- type Router
- type RouterController
- func (ctrl *RouterController) BaseList(query string) (*models.EntityListResult, error)
- func (ctrl *RouterController) BaseLoad(id string) (models.Entity, error)
- func (ctrl *RouterController) BaseLoadInTx(tx *bbolt.Tx, id string) (models.Entity, error)
- func (ctrl *RouterController) BasePreparedList(query ast.Query) (*models.EntityListResult, error)
- func (ctrl *RouterController) BasePreparedListAssociated(id string, typeLoader models.EntityRetriever, query ast.Query) (*models.EntityListResult, error)
- func (ctrl *RouterController) Create(router *Router) error
- func (ctrl *RouterController) Delete(id string) error
- func (ctrl *RouterController) IsConnected(id string) bool
- func (ctrl *RouterController) Read(id string) (entity *Router, err error)
- type RouterPresenceHandler
- type RoutingTerminator
- type Service
- type ServiceController
- func (ctrl *ServiceController) BaseList(query string) (*models.EntityListResult, error)
- func (ctrl *ServiceController) BaseLoad(id string) (models.Entity, error)
- func (ctrl *ServiceController) BaseLoadInTx(tx *bbolt.Tx, id string) (models.Entity, error)
- func (ctrl *ServiceController) BasePreparedList(query ast.Query) (*models.EntityListResult, error)
- func (ctrl *ServiceController) BasePreparedListAssociated(id string, typeLoader models.EntityRetriever, query ast.Query) (*models.EntityListResult, error)
- func (ctrl *ServiceController) Create(s *Service) error
- func (ctrl *ServiceController) Delete(id string) error
- func (ctrl *ServiceController) Read(id string) (entity *Service, err error)
- func (ctrl *ServiceController) RemoveFromCache(id string)
- func (ctrl *ServiceController) Update(s *Service) error
- type SessionLifeCycleController
- type SessionLifeCycleListener
- type Terminator
- type TerminatorController
- func (ctrl *TerminatorController) BaseList(query string) (*models.EntityListResult, error)
- func (ctrl *TerminatorController) BaseLoad(id string) (models.Entity, error)
- func (ctrl *TerminatorController) BaseLoadInTx(tx *bbolt.Tx, id string) (models.Entity, error)
- func (ctrl *TerminatorController) BasePreparedList(query ast.Query) (*models.EntityListResult, error)
- func (ctrl *TerminatorController) BasePreparedListAssociated(id string, typeLoader models.EntityRetriever, query ast.Query) (*models.EntityListResult, error)
- func (ctrl *TerminatorController) Create(s *Terminator) (string, error)
- func (ctrl *TerminatorController) Delete(id string) error
- func (ctrl *TerminatorController) Patch(terminator *Terminator, checker boltz.FieldChecker) error
- func (ctrl *TerminatorController) Query(query string) (*TerminatorListResult, error)
- func (ctrl *TerminatorController) Read(id string) (entity *Terminator, err error)
- func (ctrl *TerminatorController) Update(terminator *Terminator) error
- type TerminatorListResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Circuit ¶
type Circuit struct { Path []*Router Links []*Link Binding string IngressId string EgressId string }
func (*Circuit) CreateRouteMessages ¶
func (*Circuit) EgressRouter ¶
type Controller ¶ added in v0.11.0
type Controller interface { models.EntityRetriever // contains filtered or unexported methods }
type Controllers ¶ added in v0.11.0
type Controllers struct { Terminators *TerminatorController Routers *RouterController Services *ServiceController // contains filtered or unexported fields }
func NewControllers ¶ added in v0.11.0
func NewControllers(db boltz.Db, stores *db.Stores) *Controllers
type InvalidSessionError ¶ added in v0.11.29
type InvalidSessionError struct {
// contains filtered or unexported fields
}
func (InvalidSessionError) Error ¶ added in v0.11.29
func (err InvalidSessionError) Error() string
type Link ¶
type Link struct { Id *identity.TokenId Src *Router Dst *Router Down bool Cost int SrcLatency int64 DstLatency int64 // contains filtered or unexported fields }
func (*Link) CurrentState ¶
type MultipleErrors ¶ added in v0.11.17
type MultipleErrors []error
func (MultipleErrors) Error ¶ added in v0.11.17
func (e MultipleErrors) Error() string
type Network ¶
type Network struct { *Controllers // contains filtered or unexported fields }
func NewNetwork ¶
func (*Network) AcceptMetrics ¶
func (network *Network) AcceptMetrics(metrics *metrics_pb.MetricsMessage)
func (*Network) AddCapability ¶
func (*Network) AddRouterPresenceHandler ¶
func (network *Network) AddRouterPresenceHandler(h RouterPresenceHandler)
func (*Network) AllConnectedRouters ¶
func (*Network) ConnectRouter ¶
func (*Network) ConnectedRouter ¶
func (*Network) CreateCircuit ¶
func (*Network) CreateCircuitWithPath ¶ added in v0.11.23
func (*Network) CreateRouter ¶
func (*Network) CreateSession ¶
func (*Network) DisconnectRouter ¶
func (*Network) GetAllLinks ¶
func (*Network) GetAllLinksForRouter ¶
func (*Network) GetAllSessions ¶
func (network *Network) GetAllSessions() []*session
func (*Network) GetCapabilities ¶
func (*Network) GetConnectedRouter ¶
func (*Network) GetControllers ¶ added in v0.11.0
func (network *Network) GetControllers() *Controllers
func (*Network) GetMetricsEventController ¶
func (network *Network) GetMetricsEventController() metrics.EventController
func (*Network) GetServiceCache ¶
func (*Network) GetSession ¶
func (*Network) GetSessionLifeCycleController ¶
func (network *Network) GetSessionLifeCycleController() SessionLifeCycleController
func (*Network) GetTraceController ¶
func (network *Network) GetTraceController() trace.Controller
func (*Network) GetTraceEventController ¶
func (network *Network) GetTraceEventController() trace.EventController
func (*Network) LinkChanged ¶
func (*Network) LinkConnected ¶
func (*Network) RemoveSession ¶
func (*Network) RouterChanged ¶
func (*Network) StartSessionEgress ¶
func (*Network) UpdateCircuit ¶
func (*Network) ValidateTerminators ¶ added in v0.11.20
type Options ¶
type Options struct { CycleSeconds uint32 Smart struct { RerouteFraction float32 RerouteCap uint32 } }
func DefaultOptions ¶
func DefaultOptions() *Options
func LoadOptions ¶
type PathAndCost ¶ added in v0.11.23
type PathAndCost struct {
// contains filtered or unexported fields
}
type Router ¶
type Router struct { models.BaseEntity Fingerprint string AdvertisedListener string Control channel2.Channel CostFactor int Connected concurrenz.AtomicBoolean }
type RouterController ¶ added in v0.11.0
type RouterController struct {
// contains filtered or unexported fields
}
func (*RouterController) BaseList ¶ added in v0.11.0
func (ctrl *RouterController) BaseList(query string) (*models.EntityListResult, error)
func (*RouterController) BaseLoadInTx ¶ added in v0.11.0
func (*RouterController) BasePreparedList ¶ added in v0.11.0
func (ctrl *RouterController) BasePreparedList(query ast.Query) (*models.EntityListResult, error)
func (*RouterController) BasePreparedListAssociated ¶ added in v0.11.0
func (ctrl *RouterController) BasePreparedListAssociated(id string, typeLoader models.EntityRetriever, query ast.Query) (*models.EntityListResult, error)
func (*RouterController) Create ¶ added in v0.11.0
func (ctrl *RouterController) Create(router *Router) error
func (*RouterController) Delete ¶ added in v0.11.0
func (ctrl *RouterController) Delete(id string) error
func (*RouterController) IsConnected ¶ added in v0.11.9
func (ctrl *RouterController) IsConnected(id string) bool
type RouterPresenceHandler ¶
type RoutingTerminator ¶ added in v0.11.20
type RoutingTerminator struct { RouteCost uint32 Stats xt.Stats *Terminator }
func (*RoutingTerminator) GetPrecedence ¶ added in v0.11.23
func (r *RoutingTerminator) GetPrecedence() xt.Precedence
func (*RoutingTerminator) GetRouteCost ¶ added in v0.11.23
func (r *RoutingTerminator) GetRouteCost() uint32
func (*RoutingTerminator) GetTerminatorStats ¶ added in v0.11.23
func (r *RoutingTerminator) GetTerminatorStats() xt.Stats
type Service ¶
type Service struct { models.BaseEntity TerminatorStrategy string Terminators []*Terminator }
type ServiceController ¶ added in v0.11.0
type ServiceController struct {
// contains filtered or unexported fields
}
func (*ServiceController) BaseList ¶ added in v0.11.0
func (ctrl *ServiceController) BaseList(query string) (*models.EntityListResult, error)
func (*ServiceController) BaseLoadInTx ¶ added in v0.11.0
func (*ServiceController) BasePreparedList ¶ added in v0.11.0
func (ctrl *ServiceController) BasePreparedList(query ast.Query) (*models.EntityListResult, error)
func (*ServiceController) BasePreparedListAssociated ¶ added in v0.11.0
func (ctrl *ServiceController) BasePreparedListAssociated(id string, typeLoader models.EntityRetriever, query ast.Query) (*models.EntityListResult, error)
func (*ServiceController) Create ¶ added in v0.11.0
func (ctrl *ServiceController) Create(s *Service) error
func (*ServiceController) Delete ¶ added in v0.11.0
func (ctrl *ServiceController) Delete(id string) error
func (*ServiceController) Read ¶ added in v0.11.0
func (ctrl *ServiceController) Read(id string) (entity *Service, err error)
func (*ServiceController) RemoveFromCache ¶ added in v0.11.0
func (ctrl *ServiceController) RemoveFromCache(id string)
func (*ServiceController) Update ¶ added in v0.11.0
func (ctrl *ServiceController) Update(s *Service) error
type SessionLifeCycleController ¶
type SessionLifeCycleController interface { SessionLifeCycleListener // AddListener adds the given listener to the controller AddListener(listener SessionLifeCycleListener) // RemoveListener removes the given listener from the controller RemoveListener(listener SessionLifeCycleListener) // Shutdown stops the controller Shutdown() }
SessionLifeCycleController allows for sending session changes to multiple Listeners
func NewSessionLifeCyleController ¶
func NewSessionLifeCyleController() SessionLifeCycleController
NewSessionLifeCycleController creates a new SessionLifeCycleController instance
type Terminator ¶ added in v0.11.0
type Terminator struct { models.BaseEntity Service string Router string Binding string Address string Cost uint16 PeerData map[uint32][]byte }
func (*Terminator) GetAddress ¶ added in v0.11.20
func (entity *Terminator) GetAddress() string
func (*Terminator) GetBinding ¶ added in v0.11.20
func (entity *Terminator) GetBinding() string
func (*Terminator) GetCost ¶ added in v0.11.20
func (entity *Terminator) GetCost() uint16
func (*Terminator) GetPeerData ¶ added in v0.11.20
func (entity *Terminator) GetPeerData() map[uint32][]byte
func (*Terminator) GetRouterId ¶ added in v0.11.20
func (entity *Terminator) GetRouterId() string
func (*Terminator) GetServiceId ¶ added in v0.11.20
func (entity *Terminator) GetServiceId() string
type TerminatorController ¶ added in v0.11.0
type TerminatorController struct {
// contains filtered or unexported fields
}
func (*TerminatorController) BaseList ¶ added in v0.11.0
func (ctrl *TerminatorController) BaseList(query string) (*models.EntityListResult, error)
func (*TerminatorController) BaseLoadInTx ¶ added in v0.11.0
func (*TerminatorController) BasePreparedList ¶ added in v0.11.0
func (ctrl *TerminatorController) BasePreparedList(query ast.Query) (*models.EntityListResult, error)
func (*TerminatorController) BasePreparedListAssociated ¶ added in v0.11.0
func (ctrl *TerminatorController) BasePreparedListAssociated(id string, typeLoader models.EntityRetriever, query ast.Query) (*models.EntityListResult, error)
func (*TerminatorController) Create ¶ added in v0.11.0
func (ctrl *TerminatorController) Create(s *Terminator) (string, error)
func (*TerminatorController) Delete ¶ added in v0.11.0
func (ctrl *TerminatorController) Delete(id string) error
func (*TerminatorController) Patch ¶ added in v0.11.0
func (ctrl *TerminatorController) Patch(terminator *Terminator, checker boltz.FieldChecker) error
func (*TerminatorController) Query ¶ added in v0.11.20
func (ctrl *TerminatorController) Query(query string) (*TerminatorListResult, error)
func (*TerminatorController) Read ¶ added in v0.11.0
func (ctrl *TerminatorController) Read(id string) (entity *Terminator, err error)
func (*TerminatorController) Update ¶ added in v0.11.0
func (ctrl *TerminatorController) Update(terminator *Terminator) error
type TerminatorListResult ¶ added in v0.11.20
type TerminatorListResult struct { Entities []*Terminator models.QueryMetaData // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.