Documentation ¶
Index ¶
- Constants
- Variables
- func DispatchCreate[T models.Entity](c creator[T], entity T, ctx *change.Context) error
- func DispatchUpdate[T models.Entity](u updater[T], entity T, updatedFields fields.UpdatedFields, ...) error
- func RegisterCommand[MT any, CT any, M CommandMsg[MT], C decodableCommand[CT, M]](managers *Managers, _ C, _ M)
- func RegisterCreateDecoder[T models.Entity](managers *Managers, creator command.EntityCreator[T])
- func RegisterDeleteDecoder(managers *Managers, deleter command.EntityDeleter)
- func RegisterManagerDecoder[T models.Entity](managers *Managers, ctrl command.EntityManager[T])
- func RegisterUpdateDecoder[T models.Entity](managers *Managers, updater command.EntityUpdater[T])
- type Cache
- type Circuit
- type CircuitError
- type CircuitFailureCause
- type CommandManager
- type CommandMsg
- type Config
- type Controller
- type CreateCircuitParams
- type DeleteTerminatorsBatchCommand
- func (self *DeleteTerminatorsBatchCommand) Apply(ctx boltz.MutateContext) error
- func (self *DeleteTerminatorsBatchCommand) Decode(n *Network, msg *cmd_pb.DeleteTerminatorsBatchCommand) error
- func (self *DeleteTerminatorsBatchCommand) Encode() ([]byte, error)
- func (self *DeleteTerminatorsBatchCommand) GetChangeContext() *change.Context
- type ForwardingFaultReport
- type InspectResult
- type InspectResultValue
- type InspectionsManager
- type InvalidCircuitError
- type Link
- func (link *Link) CurrentState() *LinkState
- func (link *Link) GetCost() int64
- func (link *Link) GetDstLatency() int64
- func (link *Link) GetId() string
- func (link *Link) GetSrcLatency() int64
- func (link *Link) GetStaticCost() int32
- func (link *Link) IsDown() bool
- func (link *Link) IsUsable() bool
- func (link *Link) SetDown(down bool)
- func (link *Link) SetDstLatency(latency int64)
- func (link *Link) SetSrcLatency(latency int64)
- func (link *Link) SetStaticCost(cost int32)
- type LinkMode
- type LinkState
- type Listener
- type Managers
- type Network
- func (network *Network) AcceptMetricsMsg(metrics *metrics_pb.MetricsMessage)
- func (network *Network) AddCapability(capability string)
- func (network *Network) AddRouterPresenceHandler(h RouterPresenceHandler)
- func (network *Network) AllConnectedRouters() []*Router
- func (network *Network) CircuitEvent(eventType event.CircuitEventType, circuit *Circuit, ...)
- func (network *Network) CircuitFailedEvent(circuitId string, params CreateCircuitParams, startTime time.Time, path *Path, ...)
- func (network *Network) ConnectRouter(r *Router)
- func (network *Network) ConnectedRouter(id string) bool
- func (network *Network) CreateCircuit(params CreateCircuitParams) (*Circuit, error)
- func (network *Network) CreatePath(srcR, dstR *Router) (*Path, error)
- func (network *Network) CreatePathWithNodes(nodes []*Router) (*Path, CircuitError)
- func (network *Network) DisconnectRouter(r *Router)
- func (network *Network) GetAllCircuits() []*Circuit
- func (network *Network) GetAllLinks() []*Link
- func (network *Network) GetAllLinksForRouter(routerId string) []*Link
- func (network *Network) GetAppId() string
- func (network *Network) GetCapabilities() []string
- func (network *Network) GetCircuit(circuitId string) (*Circuit, bool)
- func (network *Network) GetCloseNotify() <-chan struct{}
- func (network *Network) GetConnectedRouter(routerId string) *Router
- func (network *Network) GetDb() boltz.Db
- func (network *Network) GetEventDispatcher() event.Dispatcher
- func (network *Network) GetLink(linkId string) (*Link, bool)
- func (network *Network) GetManagers() *Managers
- func (network *Network) GetMetricsRegistry() metrics.Registry
- func (network *Network) GetOptions() *Options
- func (network *Network) GetReloadedRouter(routerId string) (*Router, error)
- func (network *Network) GetRouter(routerId string) (*Router, error)
- func (network *Network) GetServiceEventsMetricsRegistry() metrics.UsageRegistry
- func (network *Network) GetStores() *db.Stores
- func (network *Network) GetTraceController() trace.Controller
- func (network *Network) InitServiceCounterDispatch(handler metrics.Handler)
- func (network *Network) Inspect(name string) (*string, error)
- func (network *Network) LinkChanged(l *Link)
- func (network *Network) LinkConnected(msg *ctrl_pb.LinkConnected) error
- func (network *Network) LinkFaulted(id string, dupe bool) error
- func (network *Network) NotifyExistingLink(id, linkProtocol, dialAddress string, srcRouter *Router, dstRouterId string) (bool, error)
- func (network *Network) NotifyLinkConnected(link *Link, msg *ctrl_pb.LinkConnected)
- func (network *Network) NotifyLinkEvent(link *Link, eventType event.LinkEventType)
- func (network *Network) NotifyLinkIdEvent(linkId string, eventType event.LinkEventType)
- func (network *Network) RemoveCircuit(circuitId string, now bool) error
- func (network *Network) RemoveLink(linkId string)
- func (network *Network) ReportForwardingFaults(ffr *ForwardingFaultReport)
- func (network *Network) RestoreSnapshot(cmd *command.SyncSnapshotCommand) error
- func (network *Network) RouteResult(rs *RouteStatus) bool
- func (network *Network) RouterChanged(r *Router)
- func (network *Network) Run()
- func (network *Network) ServiceDialFail(serviceId, terminatorId string)
- func (network *Network) ServiceDialOtherError(serviceId string)
- func (network *Network) ServiceDialSuccess(serviceId, terminatorId string)
- func (network *Network) ServiceDialTimeout(serviceId, terminatorId string)
- func (network *Network) ServiceInvalidTerminator(serviceId, terminatorId string)
- func (network *Network) ServiceMisconfiguredTerminator(serviceId, terminatorId string)
- func (network *Network) ServiceTerminatorConnectionRefused(serviceId, terminatorId string)
- func (network *Network) ServiceTerminatorTimeout(serviceId, terminatorId string)
- func (network *Network) SnapshotDatabase() error
- func (network *Network) SnapshotToRaft() error
- func (network *Network) UpdatePath(path *Path) (*Path, error)
- func (network *Network) ValidateTerminators(r *Router)
- func (network *Network) VerifyLinkSource(targetRouter *Router, linkId string, fingerprints []string) error
- func (network *Network) VerifyRouter(routerId string, fingerprints []string) error
- type Options
- type Path
- type PathAndCost
- type RouteStatus
- type Router
- func (entity *Router) AddLinkListener(addr, linkProtocol string, linkCostTags []string, groups []string)
- func (entity *Router) HasCapability(capability ctrl_pb.RouterCapability) bool
- func (entity *Router) SetLinkListeners(listeners []*ctrl_pb.Listener)
- func (entity *Router) SetMetadata(metadata *ctrl_pb.RouterMetadata)
- type RouterLinks
- type RouterManager
- func (self *RouterManager) ApplyCreate(cmd *command.CreateEntityCommand[*Router], ctx boltz.MutateContext) error
- func (self *RouterManager) ApplyDelete(cmd *command.DeleteEntityCommand, ctx boltz.MutateContext) error
- func (self *RouterManager) ApplyDequiesce(cmd *command.UpdateEntityCommand[*Router], ctx boltz.MutateContext) error
- func (self *RouterManager) ApplyQuiesce(cmd *command.UpdateEntityCommand[*Router], ctx boltz.MutateContext) error
- func (self *RouterManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Router], ctx boltz.MutateContext) error
- func (ctrl *RouterManager) BaseList(query string) (*models.EntityListResult[ME], error)
- func (ctrl *RouterManager) BaseLoad(id string) (ME, error)
- func (ctrl *RouterManager) BaseLoadInTx(tx *bbolt.Tx, id string) (ME, error)
- func (ctrl *RouterManager) BasePreparedList(query ast.Query) (*models.EntityListResult[ME], error)
- func (self *RouterManager) Create(entity *Router, ctx *change.Context) error
- func (self *RouterManager) Delete(id string, ctx *change.Context) error
- func (self *RouterManager) DequiesceRouter(entity *Router, ctx *change.Context) error
- func (self *RouterManager) GetEntityTypeId() string
- func (self *RouterManager) HandleRouterDelete(id string)
- func (self *RouterManager) IsConnected(id string) bool
- func (ctrl *RouterManager) ListWithHandler(queryString string, resultHandler models.ListResultHandler) error
- func (self *RouterManager) Marshall(entity *Router) ([]byte, error)
- func (ctrl *RouterManager) PreparedListAssociatedWithHandler(id string, association string, query ast.Query, ...) error
- func (ctrl *RouterManager) PreparedListWithHandler(query ast.Query, resultHandler models.ListResultHandler) error
- func (self *RouterManager) QuiesceRouter(entity *Router, ctx *change.Context) error
- func (self *RouterManager) Read(id string) (entity *Router, err error)
- func (self *RouterManager) RemoveFromCache(id string)
- func (self *RouterManager) Unmarshall(bytes []byte) (*Router, error)
- func (self *RouterManager) Update(entity *Router, updatedFields fields.UpdatedFields, ctx *change.Context) error
- func (self *RouterManager) UpdateCachedRouter(id string)
- func (self *RouterManager) UpdateTerminators(router *Router, ctx boltz.MutateContext, ...) error
- type RouterMessaging
- type RouterPresenceHandler
- type RoutingTerminator
- type Service
- type ServiceCounters
- type ServiceManager
- func (self *ServiceManager) ApplyCreate(cmd *command.CreateEntityCommand[*Service], ctx boltz.MutateContext) error
- func (self *ServiceManager) ApplyDelete(cmd *command.DeleteEntityCommand, ctx boltz.MutateContext) error
- func (self *ServiceManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Service], ctx boltz.MutateContext) error
- func (ctrl *ServiceManager) BaseList(query string) (*models.EntityListResult[ME], error)
- func (ctrl *ServiceManager) BaseLoad(id string) (ME, error)
- func (ctrl *ServiceManager) BaseLoadInTx(tx *bbolt.Tx, id string) (ME, error)
- func (ctrl *ServiceManager) BasePreparedList(query ast.Query) (*models.EntityListResult[ME], error)
- func (self *ServiceManager) Create(entity *Service, ctx *change.Context) error
- func (self *ServiceManager) Delete(id string, ctx *change.Context) error
- func (self *ServiceManager) GetEntityTypeId() string
- func (self *ServiceManager) GetIdForName(id string) (string, error)
- func (ctrl *ServiceManager) ListWithHandler(queryString string, resultHandler models.ListResultHandler) error
- func (self *ServiceManager) Marshall(entity *Service) ([]byte, error)
- func (self *ServiceManager) NotifyTerminatorChanged(terminator *db.Terminator) *db.Terminator
- func (ctrl *ServiceManager) PreparedListAssociatedWithHandler(id string, association string, query ast.Query, ...) error
- func (ctrl *ServiceManager) PreparedListWithHandler(query ast.Query, resultHandler models.ListResultHandler) error
- func (self *ServiceManager) Read(id string) (entity *Service, err error)
- func (self *ServiceManager) RemoveFromCache(id string)
- func (self *ServiceManager) Unmarshall(bytes []byte) (*Service, error)
- func (self *ServiceManager) Update(entity *Service, updatedFields fields.UpdatedFields, ctx *change.Context) error
- type Terminator
- func (entity *Terminator) GetAddress() string
- func (entity *Terminator) GetBinding() string
- func (entity *Terminator) GetCost() uint16
- func (entity *Terminator) GetHostId() string
- func (entity *Terminator) GetInstanceId() string
- func (entity *Terminator) GetInstanceSecret() []byte
- func (entity *Terminator) GetPeerData() xt.PeerData
- func (entity *Terminator) GetPrecedence() xt.Precedence
- func (entity *Terminator) GetRouterId() string
- func (entity *Terminator) GetServiceId() string
- type TerminatorListResult
- type TerminatorManager
- func (self *TerminatorManager) ApplyCreate(cmd *command.CreateEntityCommand[*Terminator], ctx boltz.MutateContext) error
- func (self *TerminatorManager) ApplyDelete(cmd *command.DeleteEntityCommand, ctx boltz.MutateContext) error
- func (self *TerminatorManager) ApplyDeleteBatch(cmd *DeleteTerminatorsBatchCommand, ctx boltz.MutateContext) error
- func (self *TerminatorManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Terminator], ctx boltz.MutateContext) error
- func (ctrl *TerminatorManager) BaseList(query string) (*models.EntityListResult[ME], error)
- func (ctrl *TerminatorManager) BaseLoad(id string) (ME, error)
- func (ctrl *TerminatorManager) BaseLoadInTx(tx *bbolt.Tx, id string) (ME, error)
- func (ctrl *TerminatorManager) BasePreparedList(query ast.Query) (*models.EntityListResult[ME], error)
- func (self *TerminatorManager) Create(entity *Terminator, ctx *change.Context) error
- func (self *TerminatorManager) Delete(id string, ctx *change.Context) error
- func (self *TerminatorManager) DeleteBatch(ids []string, ctx *change.Context) error
- func (self *TerminatorManager) GetEntityTypeId() string
- func (ctrl *TerminatorManager) ListWithHandler(queryString string, resultHandler models.ListResultHandler) error
- func (self *TerminatorManager) Marshall(entity *Terminator) ([]byte, error)
- func (ctrl *TerminatorManager) PreparedListAssociatedWithHandler(id string, association string, query ast.Query, ...) error
- func (ctrl *TerminatorManager) PreparedListWithHandler(query ast.Query, resultHandler models.ListResultHandler) error
- func (self *TerminatorManager) Query(query string) (*TerminatorListResult, error)
- func (self *TerminatorManager) Read(id string) (entity *Terminator, err error)
- func (self *TerminatorManager) Unmarshall(bytes []byte) (*Terminator, error)
- func (self *TerminatorManager) Update(entity *Terminator, updatedFields fields.UpdatedFields, ctx *change.Context) error
Constants ¶
const ( CreateDecoder = "CreateDecoder" UpdateDecoder = "UpdateDecoder" DeleteDecoder = "DeleteDecoder" )
const ( DefaultOptionsCreateCircuitRetries = 2 DefaultOptionsCycleSeconds = 60 DefaultOptionsEnableLegacyLinkMgmt = true DefaultOptionsInitialLinkLatency = 65 * time.Second DefaultOptionsPendingLinkTimeout = 10 * time.Second DefaultOptionsMetricsReportInterval = time.Minute DefaultOptionsMinRouterCost = 10 DefaultOptionsRouterConnectChurnLimit = time.Minute DefaultOptionsRouterMessagingMaxWorkers = 100 DefaultOptionsRouterMessagingQueueSize = 100 DefaultOptionsRouteTimeout = 10 * time.Second DefaultOptionsSmartRerouteCap = 4 DefaultOptionsSmartRerouteFraction = 0.02 DefaultOptionsSmartRerouteMinCostDelta = 15 OptionsRouterCommMaxQueueSize = 1_000_000 OptionsRouterCommMaxWorkers = 10_000 )
const ( RouterQuiesceFlag uint32 = 1 RouterDequiesceFlag uint32 = 2 )
const SmartRerouteAttempt = 99969996
Variables ¶
var DbSnapshotTooFrequentError = dbSnapshotTooFrequentError{}
Functions ¶
func DispatchCreate ¶ added in v0.18.0
func DispatchUpdate ¶ added in v0.18.0
func RegisterCommand ¶ added in v0.18.0
func RegisterCommand[MT any, CT any, M CommandMsg[MT], C decodableCommand[CT, M]](managers *Managers, _ C, _ M)
RegisterCommand register a decoder for the given command and message pair MT is the message type (ex: cmd_pb.CreateServiceCommand) CT is the command type (ex: CreateServiceCommand) M is the CommandMsg/command.TypedMessage implementation (ex: *cmd_pb.CreateServiceCommand) C is the decodableCommand/command.Command implementation (ex: *CreateServiceCommand)
We only have both types specified so that we can enforce that each is a pointer type. If didn't enforce that the instances were pointer types, we couldn't use new to instantiate new instances.
func RegisterCreateDecoder ¶ added in v0.18.0
func RegisterCreateDecoder[T models.Entity](managers *Managers, creator command.EntityCreator[T])
func RegisterDeleteDecoder ¶ added in v0.18.0
func RegisterDeleteDecoder(managers *Managers, deleter command.EntityDeleter)
func RegisterManagerDecoder ¶ added in v0.18.0
func RegisterManagerDecoder[T models.Entity](managers *Managers, ctrl command.EntityManager[T])
func RegisterUpdateDecoder ¶ added in v0.18.0
func RegisterUpdateDecoder[T models.Entity](managers *Managers, updater command.EntityUpdater[T])
Types ¶
type Circuit ¶
type CircuitError ¶ added in v0.19.0
type CircuitError interface { error Cause() CircuitFailureCause }
type CircuitFailureCause ¶ added in v0.19.0
type CircuitFailureCause string
const ( CircuitFailureInvalidService CircuitFailureCause = "INVALID_SERVICE" CircuitFailureIdGenerationError CircuitFailureCause = "ID_GENERATION_ERR" CircuitFailureNoTerminators CircuitFailureCause = "NO_TERMINATORS" CircuitFailureNoOnlineTerminators CircuitFailureCause = "NO_ONLINE_TERMINATORS" CircuitFailureNoPath CircuitFailureCause = "NO_PATH" CircuitFailurePathMissingLink CircuitFailureCause = "PATH_MISSING_LINK" CircuitFailureInvalidStrategy CircuitFailureCause = "INVALID_STRATEGY" CircuitFailureStrategyError CircuitFailureCause = "STRATEGY_ERR" CircuitFailureRouterResponseTimeout CircuitFailureCause = "ROUTER_RESPONSE_TIMEOUT" CircuitFailureRouterErrGeneric CircuitFailureCause = "ROUTER_ERR_GENERIC" CircuitFailureRouterErrInvalidTerminator CircuitFailureCause = "ROUTER_ERR_INVALID_TERMINATOR" CircuitFailureRouterErrMisconfiguredTerminator CircuitFailureCause = "ROUTER_ERR_MISCONFIGURED_TERMINATOR" CircuitFailureRouterErrDialTimedOut CircuitFailureCause = "ROUTER_ERR_DIAL_TIMED_OUT" CircuitFailureRouterErrDialConnRefused CircuitFailureCause = "ROUTER_ERR_CONN_REFUSED" )
type CommandManager ¶ added in v0.18.0
type CommandMsg ¶ added in v0.18.0
type CommandMsg[T any] interface { cmd_pb.TypedMessage *T }
CommandMsg is a TypedMessage which is also a pointer type.
T is message type. We want to enforce that the TypeMessage implementation is a pointer type so we can use new(T) to create instances of it
type Config ¶ added in v0.18.0
type Config interface { GetId() *identity.TokenId GetMetricsRegistry() metrics.Registry GetOptions() *Options GetCommandDispatcher() command.Dispatcher GetDb() boltz.Db GetVersionProvider() versions.VersionProvider GetEventDispatcher() event.Dispatcher GetCloseNotify() <-chan struct{} }
Config provides the values needed to create a Network instance
type Controller ¶
type Controller[T models.Entity] interface { models.EntityRetriever[T] // contains filtered or unexported methods }
type CreateCircuitParams ¶ added in v0.20.0
type DeleteTerminatorsBatchCommand ¶ added in v0.22.76
type DeleteTerminatorsBatchCommand struct { Context *change.Context Manager *TerminatorManager Ids []string }
func (*DeleteTerminatorsBatchCommand) Apply ¶ added in v0.22.76
func (self *DeleteTerminatorsBatchCommand) Apply(ctx boltz.MutateContext) error
func (*DeleteTerminatorsBatchCommand) Decode ¶ added in v0.22.76
func (self *DeleteTerminatorsBatchCommand) Decode(n *Network, msg *cmd_pb.DeleteTerminatorsBatchCommand) error
func (*DeleteTerminatorsBatchCommand) Encode ¶ added in v0.22.76
func (self *DeleteTerminatorsBatchCommand) Encode() ([]byte, error)
func (*DeleteTerminatorsBatchCommand) GetChangeContext ¶ added in v0.23.0
func (self *DeleteTerminatorsBatchCommand) GetChangeContext() *change.Context
type ForwardingFaultReport ¶ added in v0.15.24
type InspectResult ¶ added in v0.17.9
type InspectResult struct { Success bool Errors []string Results []*InspectResultValue }
type InspectResultValue ¶ added in v0.17.9
type InspectionsManager ¶ added in v0.18.0
type InspectionsManager struct {
// contains filtered or unexported fields
}
func NewInspectionsManager ¶ added in v0.18.0
func NewInspectionsManager(network *Network) *InspectionsManager
func (*InspectionsManager) Inspect ¶ added in v0.18.0
func (self *InspectionsManager) Inspect(appRegex string, values []string) *InspectResult
type InvalidCircuitError ¶ added in v0.16.92
type InvalidCircuitError struct {
// contains filtered or unexported fields
}
func (InvalidCircuitError) Error ¶ added in v0.16.92
func (err InvalidCircuitError) Error() string
type Link ¶
type Link struct { SrcLatency int64 DstLatency int64 Cost int64 Id string Src *Router Dst *Router Protocol string DialAddress string StaticCost int32 // contains filtered or unexported fields }
func (*Link) CurrentState ¶
func (*Link) GetDstLatency ¶ added in v0.13.0
func (*Link) GetSrcLatency ¶ added in v0.13.0
func (*Link) GetStaticCost ¶ added in v0.13.0
func (*Link) SetDstLatency ¶ added in v0.13.0
func (*Link) SetSrcLatency ¶ added in v0.13.0
func (*Link) SetStaticCost ¶ added in v0.13.0
type Managers ¶ added in v0.18.0
type Managers struct { Terminators *TerminatorManager Routers *RouterManager Services *ServiceManager Inspections *InspectionsManager Command *CommandManager Dispatcher command.Dispatcher Registry ioc.Registry RouterMessaging *RouterMessaging // contains filtered or unexported fields }
func NewManagers ¶ added in v0.18.0
func NewManagers(network *Network, dispatcher command.Dispatcher, db boltz.Db, stores *db.Stores, routerCommPool goroutines.Pool) *Managers
type Network ¶
type Network struct { *Managers VersionProvider versions.VersionProvider // contains filtered or unexported fields }
func NewNetwork ¶
func (*Network) AcceptMetricsMsg ¶ added in v0.19.28
func (network *Network) AcceptMetricsMsg(metrics *metrics_pb.MetricsMessage)
func (*Network) AddCapability ¶
func (*Network) AddRouterPresenceHandler ¶
func (network *Network) AddRouterPresenceHandler(h RouterPresenceHandler)
func (*Network) AllConnectedRouters ¶
func (*Network) CircuitEvent ¶ added in v0.17.45
func (*Network) CircuitFailedEvent ¶ added in v0.19.0
func (network *Network) CircuitFailedEvent( circuitId string, params CreateCircuitParams, startTime time.Time, path *Path, t xt.CostedTerminator, cause CircuitFailureCause)
func (*Network) ConnectRouter ¶
func (*Network) ConnectedRouter ¶
func (*Network) CreateCircuit ¶
func (network *Network) CreateCircuit(params CreateCircuitParams) (*Circuit, error)
func (*Network) CreatePath ¶ added in v0.16.92
func (*Network) CreatePathWithNodes ¶ added in v0.16.92
func (network *Network) CreatePathWithNodes(nodes []*Router) (*Path, CircuitError)
func (*Network) DisconnectRouter ¶
func (*Network) GetAllCircuits ¶ added in v0.16.92
func (*Network) GetAllLinks ¶
func (*Network) GetAllLinksForRouter ¶
func (*Network) GetCapabilities ¶
func (*Network) GetCircuit ¶ added in v0.16.92
func (*Network) GetCloseNotify ¶ added in v0.24.0
func (network *Network) GetCloseNotify() <-chan struct{}
func (*Network) GetConnectedRouter ¶
func (*Network) GetEventDispatcher ¶ added in v0.12.1
func (network *Network) GetEventDispatcher() event.Dispatcher
func (*Network) GetManagers ¶ added in v0.18.0
func (*Network) GetMetricsRegistry ¶ added in v0.12.3
func (*Network) GetOptions ¶ added in v0.15.18
func (*Network) GetReloadedRouter ¶ added in v0.21.15
func (*Network) GetServiceEventsMetricsRegistry ¶ added in v0.16.41
func (network *Network) GetServiceEventsMetricsRegistry() metrics.UsageRegistry
func (*Network) GetTraceController ¶
func (network *Network) GetTraceController() trace.Controller
func (*Network) InitServiceCounterDispatch ¶ added in v0.16.23
func (*Network) LinkChanged ¶
func (*Network) LinkConnected ¶
func (network *Network) LinkConnected(msg *ctrl_pb.LinkConnected) error
func (*Network) LinkFaulted ¶ added in v0.19.28
func (*Network) NotifyExistingLink ¶ added in v0.17.60
func (*Network) NotifyLinkConnected ¶ added in v0.19.28
func (network *Network) NotifyLinkConnected(link *Link, msg *ctrl_pb.LinkConnected)
func (*Network) NotifyLinkEvent ¶ added in v0.19.28
func (network *Network) NotifyLinkEvent(link *Link, eventType event.LinkEventType)
func (*Network) NotifyLinkIdEvent ¶ added in v0.19.28
func (network *Network) NotifyLinkIdEvent(linkId string, eventType event.LinkEventType)
func (*Network) RemoveCircuit ¶ added in v0.16.92
func (*Network) RemoveLink ¶ added in v0.17.121
func (*Network) ReportForwardingFaults ¶ added in v0.15.24
func (network *Network) ReportForwardingFaults(ffr *ForwardingFaultReport)
func (*Network) RestoreSnapshot ¶ added in v0.22.4
func (network *Network) RestoreSnapshot(cmd *command.SyncSnapshotCommand) error
func (*Network) RouteResult ¶ added in v0.16.0
func (network *Network) RouteResult(rs *RouteStatus) bool
func (*Network) RouterChanged ¶
func (*Network) ServiceDialFail ¶ added in v0.16.23
func (*Network) ServiceDialOtherError ¶ added in v0.16.23
func (*Network) ServiceDialSuccess ¶ added in v0.16.23
func (*Network) ServiceDialTimeout ¶ added in v0.16.23
func (*Network) ServiceInvalidTerminator ¶ added in v0.17.76
func (*Network) ServiceMisconfiguredTerminator ¶ added in v0.17.76
func (*Network) ServiceTerminatorConnectionRefused ¶ added in v0.17.76
func (*Network) ServiceTerminatorTimeout ¶ added in v0.17.76
func (*Network) SnapshotDatabase ¶ added in v0.11.40
func (*Network) SnapshotToRaft ¶ added in v0.19.48
func (*Network) UpdatePath ¶ added in v0.16.92
func (*Network) ValidateTerminators ¶
func (*Network) VerifyLinkSource ¶ added in v0.16.128
type Options ¶
type Options struct { CreateCircuitRetries uint32 CycleSeconds uint32 EnableLegacyLinkMgmt bool InitialLinkLatency time.Duration IntervalAgeThreshold time.Duration MetricsReportInterval time.Duration MinRouterCost uint16 PendingLinkTimeout time.Duration RouteTimeout time.Duration RouterConnectChurnLimit time.Duration RouterComm struct { QueueSize uint32 MaxWorkers uint32 } Smart struct { RerouteFraction float32 RerouteCap uint32 MinCostDelta uint32 } }
func DefaultOptions ¶
func DefaultOptions() *Options
func LoadOptions ¶
type Path ¶ added in v0.16.92
type Path struct { Nodes []*Router Links []*Link IngressId string EgressId string InitiatorLocalAddr string InitiatorRemoteAddr string TerminatorLocalAddr string TerminatorRemoteAddr string }
func (*Path) CreateRouteMessages ¶ added in v0.16.92
func (*Path) EgressRouter ¶ added in v0.16.92
type PathAndCost ¶
type PathAndCost struct {
// contains filtered or unexported fields
}
type RouteStatus ¶ added in v0.17.76
type Router ¶
type Router struct { models.BaseEntity Name string Fingerprint *string Listeners []*ctrl_pb.Listener Control channel.Channel Connected atomic.Bool ConnectTime time.Time VersionInfo *versions.VersionInfo Cost uint16 NoTraversal bool Disabled bool Metadata *ctrl_pb.RouterMetadata // contains filtered or unexported fields }
func (*Router) AddLinkListener ¶ added in v0.17.60
func (*Router) HasCapability ¶ added in v0.24.0
func (entity *Router) HasCapability(capability ctrl_pb.RouterCapability) bool
func (*Router) SetLinkListeners ¶ added in v0.24.0
func (*Router) SetMetadata ¶ added in v0.24.0
func (entity *Router) SetMetadata(metadata *ctrl_pb.RouterMetadata)
type RouterLinks ¶ added in v0.16.133
func (*RouterLinks) Add ¶ added in v0.16.133
func (self *RouterLinks) Add(link *Link, other *Router)
func (*RouterLinks) Clear ¶ added in v0.16.133
func (self *RouterLinks) Clear()
func (*RouterLinks) GetLinks ¶ added in v0.16.133
func (self *RouterLinks) GetLinks() []*Link
func (*RouterLinks) GetLinksByRouter ¶ added in v0.16.134
func (self *RouterLinks) GetLinksByRouter() map[string][]*Link
func (*RouterLinks) Remove ¶ added in v0.16.133
func (self *RouterLinks) Remove(link *Link, other *Router)
type RouterManager ¶ added in v0.18.0
type RouterManager struct {
// contains filtered or unexported fields
}
func (*RouterManager) ApplyCreate ¶ added in v0.18.0
func (self *RouterManager) ApplyCreate(cmd *command.CreateEntityCommand[*Router], ctx boltz.MutateContext) error
func (*RouterManager) ApplyDelete ¶ added in v0.18.0
func (self *RouterManager) ApplyDelete(cmd *command.DeleteEntityCommand, ctx boltz.MutateContext) error
func (*RouterManager) ApplyDequiesce ¶ added in v0.23.34
func (self *RouterManager) ApplyDequiesce(cmd *command.UpdateEntityCommand[*Router], ctx boltz.MutateContext) error
func (*RouterManager) ApplyQuiesce ¶ added in v0.23.34
func (self *RouterManager) ApplyQuiesce(cmd *command.UpdateEntityCommand[*Router], ctx boltz.MutateContext) error
func (*RouterManager) ApplyUpdate ¶ added in v0.18.0
func (self *RouterManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Router], ctx boltz.MutateContext) error
func (*RouterManager) BaseList ¶ added in v0.18.0
func (ctrl *RouterManager) BaseList(query string) (*models.EntityListResult[ME], error)
func (*RouterManager) BaseLoadInTx ¶ added in v0.18.0
func (*RouterManager) BasePreparedList ¶ added in v0.18.0
func (ctrl *RouterManager) BasePreparedList(query ast.Query) (*models.EntityListResult[ME], error)
func (*RouterManager) Create ¶ added in v0.18.0
func (self *RouterManager) Create(entity *Router, ctx *change.Context) error
func (*RouterManager) DequiesceRouter ¶ added in v0.23.34
func (self *RouterManager) DequiesceRouter(entity *Router, ctx *change.Context) error
DequiesceRouter returns all routers with a saved precedence that are in a failed state back to their saved state
func (*RouterManager) GetEntityTypeId ¶ added in v0.18.0
func (self *RouterManager) GetEntityTypeId() string
func (*RouterManager) HandleRouterDelete ¶ added in v0.18.0
func (self *RouterManager) HandleRouterDelete(id string)
func (*RouterManager) IsConnected ¶ added in v0.18.0
func (self *RouterManager) IsConnected(id string) bool
func (*RouterManager) ListWithHandler ¶ added in v0.19.30
func (ctrl *RouterManager) ListWithHandler(queryString string, resultHandler models.ListResultHandler) error
func (*RouterManager) Marshall ¶ added in v0.18.0
func (self *RouterManager) Marshall(entity *Router) ([]byte, error)
func (*RouterManager) PreparedListAssociatedWithHandler ¶ added in v0.19.30
func (*RouterManager) PreparedListWithHandler ¶ added in v0.19.30
func (ctrl *RouterManager) PreparedListWithHandler(query ast.Query, resultHandler models.ListResultHandler) error
func (*RouterManager) QuiesceRouter ¶ added in v0.23.34
func (self *RouterManager) QuiesceRouter(entity *Router, ctx *change.Context) error
QuiesceRouter marks all terminators on the router as failed, so that new traffic will avoid this router, if there's any alternative path
func (*RouterManager) Read ¶ added in v0.18.0
func (self *RouterManager) Read(id string) (entity *Router, err error)
func (*RouterManager) RemoveFromCache ¶ added in v0.18.0
func (self *RouterManager) RemoveFromCache(id string)
func (*RouterManager) Unmarshall ¶ added in v0.18.0
func (self *RouterManager) Unmarshall(bytes []byte) (*Router, error)
func (*RouterManager) Update ¶ added in v0.18.0
func (self *RouterManager) Update(entity *Router, updatedFields fields.UpdatedFields, ctx *change.Context) error
func (*RouterManager) UpdateCachedRouter ¶ added in v0.18.0
func (self *RouterManager) UpdateCachedRouter(id string)
func (*RouterManager) UpdateTerminators ¶ added in v0.23.34
func (self *RouterManager) UpdateTerminators(router *Router, ctx boltz.MutateContext, f func(terminator *db.Terminator) error) error
type RouterMessaging ¶ added in v0.24.0
type RouterMessaging struct {
// contains filtered or unexported fields
}
func NewRouterMessaging ¶ added in v0.24.0
func NewRouterMessaging(managers *Managers, routerCommPool goroutines.Pool) *RouterMessaging
func (*RouterMessaging) RouterConnected ¶ added in v0.24.0
func (self *RouterMessaging) RouterConnected(r *Router)
func (*RouterMessaging) RouterDeleted ¶ added in v0.24.0
func (self *RouterMessaging) RouterDeleted(routerId string)
func (*RouterMessaging) RouterDisconnected ¶ added in v0.24.0
func (self *RouterMessaging) RouterDisconnected(r *Router)
type RouterPresenceHandler ¶
type RoutingTerminator ¶
type RoutingTerminator struct { RouteCost uint32 *Terminator }
func (*RoutingTerminator) GetRouteCost ¶
func (r *RoutingTerminator) GetRouteCost() uint32
type Service ¶
type Service struct { models.BaseEntity Name string TerminatorStrategy string Terminators []*Terminator }
type ServiceCounters ¶ added in v0.16.23
type ServiceCounters interface { ServiceDialSuccess(serviceId, terminatorId string) ServiceDialFail(serviceId, terminatorId string) ServiceDialTimeout(serviceId, terminatorId string) ServiceDialOtherError(serviceId string) ServiceTerminatorTimeout(serviceId, terminatorId string) ServiceTerminatorConnectionRefused(serviceId, terminatorId string) ServiceInvalidTerminator(serviceId, terminatorId string) ServiceMisconfiguredTerminator(serviceId, terminatorId string) }
type ServiceManager ¶ added in v0.18.0
type ServiceManager struct {
// contains filtered or unexported fields
}
func (*ServiceManager) ApplyCreate ¶ added in v0.18.0
func (self *ServiceManager) ApplyCreate(cmd *command.CreateEntityCommand[*Service], ctx boltz.MutateContext) error
func (*ServiceManager) ApplyDelete ¶ added in v0.18.0
func (self *ServiceManager) ApplyDelete(cmd *command.DeleteEntityCommand, ctx boltz.MutateContext) error
func (*ServiceManager) ApplyUpdate ¶ added in v0.18.0
func (self *ServiceManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Service], ctx boltz.MutateContext) error
func (*ServiceManager) BaseList ¶ added in v0.18.0
func (ctrl *ServiceManager) BaseList(query string) (*models.EntityListResult[ME], error)
func (*ServiceManager) BaseLoadInTx ¶ added in v0.18.0
func (*ServiceManager) BasePreparedList ¶ added in v0.18.0
func (ctrl *ServiceManager) BasePreparedList(query ast.Query) (*models.EntityListResult[ME], error)
func (*ServiceManager) Create ¶ added in v0.18.0
func (self *ServiceManager) Create(entity *Service, ctx *change.Context) error
func (*ServiceManager) GetEntityTypeId ¶ added in v0.18.0
func (self *ServiceManager) GetEntityTypeId() string
func (*ServiceManager) GetIdForName ¶ added in v0.18.0
func (self *ServiceManager) GetIdForName(id string) (string, error)
func (*ServiceManager) ListWithHandler ¶ added in v0.19.30
func (ctrl *ServiceManager) ListWithHandler(queryString string, resultHandler models.ListResultHandler) error
func (*ServiceManager) Marshall ¶ added in v0.18.0
func (self *ServiceManager) Marshall(entity *Service) ([]byte, error)
func (*ServiceManager) NotifyTerminatorChanged ¶ added in v0.18.0
func (self *ServiceManager) NotifyTerminatorChanged(terminator *db.Terminator) *db.Terminator
func (*ServiceManager) PreparedListAssociatedWithHandler ¶ added in v0.19.30
func (*ServiceManager) PreparedListWithHandler ¶ added in v0.19.30
func (ctrl *ServiceManager) PreparedListWithHandler(query ast.Query, resultHandler models.ListResultHandler) error
func (*ServiceManager) Read ¶ added in v0.18.0
func (self *ServiceManager) Read(id string) (entity *Service, err error)
func (*ServiceManager) RemoveFromCache ¶ added in v0.18.0
func (self *ServiceManager) RemoveFromCache(id string)
func (*ServiceManager) Unmarshall ¶ added in v0.18.0
func (self *ServiceManager) Unmarshall(bytes []byte) (*Service, error)
func (*ServiceManager) Update ¶ added in v0.18.0
func (self *ServiceManager) Update(entity *Service, updatedFields fields.UpdatedFields, ctx *change.Context) error
type Terminator ¶
type Terminator struct { models.BaseEntity Service string Router string Binding string Address string InstanceId string InstanceSecret []byte Cost uint16 Precedence xt.Precedence PeerData map[uint32][]byte HostId string SavedPrecedence xt.Precedence }
func (*Terminator) GetAddress ¶
func (entity *Terminator) GetAddress() string
func (*Terminator) GetBinding ¶
func (entity *Terminator) GetBinding() string
func (*Terminator) GetCost ¶
func (entity *Terminator) GetCost() uint16
func (*Terminator) GetHostId ¶ added in v0.20.0
func (entity *Terminator) GetHostId() string
func (*Terminator) GetInstanceId ¶ added in v0.19.0
func (entity *Terminator) GetInstanceId() string
func (*Terminator) GetInstanceSecret ¶ added in v0.19.0
func (entity *Terminator) GetInstanceSecret() []byte
func (*Terminator) GetPeerData ¶
func (entity *Terminator) GetPeerData() xt.PeerData
func (*Terminator) GetPrecedence ¶ added in v0.13.0
func (entity *Terminator) GetPrecedence() xt.Precedence
func (*Terminator) GetRouterId ¶
func (entity *Terminator) GetRouterId() string
func (*Terminator) GetServiceId ¶
func (entity *Terminator) GetServiceId() string
type TerminatorListResult ¶
type TerminatorListResult struct { Entities []*Terminator models.QueryMetaData // contains filtered or unexported fields }
type TerminatorManager ¶ added in v0.18.0
type TerminatorManager struct {
// contains filtered or unexported fields
}
func (*TerminatorManager) ApplyCreate ¶ added in v0.18.0
func (self *TerminatorManager) ApplyCreate(cmd *command.CreateEntityCommand[*Terminator], ctx boltz.MutateContext) error
func (*TerminatorManager) ApplyDelete ¶ added in v0.18.0
func (self *TerminatorManager) ApplyDelete(cmd *command.DeleteEntityCommand, ctx boltz.MutateContext) error
func (*TerminatorManager) ApplyDeleteBatch ¶ added in v0.22.76
func (self *TerminatorManager) ApplyDeleteBatch(cmd *DeleteTerminatorsBatchCommand, ctx boltz.MutateContext) error
func (*TerminatorManager) ApplyUpdate ¶ added in v0.18.0
func (self *TerminatorManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Terminator], ctx boltz.MutateContext) error
func (*TerminatorManager) BaseList ¶ added in v0.18.0
func (ctrl *TerminatorManager) BaseList(query string) (*models.EntityListResult[ME], error)
func (*TerminatorManager) BaseLoadInTx ¶ added in v0.18.0
func (*TerminatorManager) BasePreparedList ¶ added in v0.18.0
func (ctrl *TerminatorManager) BasePreparedList(query ast.Query) (*models.EntityListResult[ME], error)
func (*TerminatorManager) Create ¶ added in v0.18.0
func (self *TerminatorManager) Create(entity *Terminator, ctx *change.Context) error
func (*TerminatorManager) DeleteBatch ¶ added in v0.22.76
func (self *TerminatorManager) DeleteBatch(ids []string, ctx *change.Context) error
func (*TerminatorManager) GetEntityTypeId ¶ added in v0.18.0
func (self *TerminatorManager) GetEntityTypeId() string
func (*TerminatorManager) ListWithHandler ¶ added in v0.19.30
func (ctrl *TerminatorManager) ListWithHandler(queryString string, resultHandler models.ListResultHandler) error
func (*TerminatorManager) Marshall ¶ added in v0.18.0
func (self *TerminatorManager) Marshall(entity *Terminator) ([]byte, error)
func (*TerminatorManager) PreparedListAssociatedWithHandler ¶ added in v0.19.30
func (*TerminatorManager) PreparedListWithHandler ¶ added in v0.19.30
func (ctrl *TerminatorManager) PreparedListWithHandler(query ast.Query, resultHandler models.ListResultHandler) error
func (*TerminatorManager) Query ¶ added in v0.18.0
func (self *TerminatorManager) Query(query string) (*TerminatorListResult, error)
func (*TerminatorManager) Read ¶ added in v0.18.0
func (self *TerminatorManager) Read(id string) (entity *Terminator, err error)
func (*TerminatorManager) Unmarshall ¶ added in v0.18.0
func (self *TerminatorManager) Unmarshall(bytes []byte) (*Terminator, error)
func (*TerminatorManager) Update ¶ added in v0.18.0
func (self *TerminatorManager) Update(entity *Terminator, updatedFields fields.UpdatedFields, ctx *change.Context) error