Documentation ¶
Index ¶
- Constants
- Variables
- func DispatchCreate[T models.Entity](c creator[T], entity T) 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 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, clientId string, serviceId string, instanceId string, ...)
- 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) CreateRouter(router *Router) error
- 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) 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) 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
- func (network *Network) LinkChanged(l *Link)
- func (network *Network) LinkConnected(msg *ctrl_pb.LinkConnected) error
- func (network *Network) LinkFaulted(id string) 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) 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
- type RouterLinks
- type RouterManager
- func (self *RouterManager) ApplyCreate(cmd *command.CreateEntityCommand[*Router]) error
- func (self *RouterManager) ApplyDelete(cmd *command.DeleteEntityCommand) error
- func (self *RouterManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Router]) error
- func (ctrl *RouterManager) BaseList(query string) (*models.EntityListResult[T], error)
- func (ctrl *RouterManager) BaseLoad(id string) (T, error)
- func (ctrl *RouterManager) BaseLoadInTx(tx *bbolt.Tx, id string) (T, error)
- func (ctrl *RouterManager) BasePreparedList(query ast.Query) (*models.EntityListResult[T], error)
- func (self *RouterManager) Create(entity *Router) error
- func (self *RouterManager) Delete(id string) 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) 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) error
- func (self *RouterManager) UpdateCachedRouter(id string)
- type RouterPresenceHandler
- type RoutingTerminator
- type Service
- type ServiceCounters
- type ServiceManager
- func (self *ServiceManager) ApplyCreate(cmd *command.CreateEntityCommand[*Service]) error
- func (self *ServiceManager) ApplyDelete(cmd *command.DeleteEntityCommand) error
- func (self *ServiceManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Service]) error
- func (ctrl *ServiceManager) BaseList(query string) (*models.EntityListResult[T], error)
- func (ctrl *ServiceManager) BaseLoad(id string) (T, error)
- func (ctrl *ServiceManager) BaseLoadInTx(tx *bbolt.Tx, id string) (T, error)
- func (ctrl *ServiceManager) BasePreparedList(query ast.Query) (*models.EntityListResult[T], error)
- func (self *ServiceManager) Create(entity *Service) error
- func (self *ServiceManager) Delete(id string) 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) 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]) error
- func (self *TerminatorManager) ApplyDelete(cmd *command.DeleteEntityCommand) error
- func (self *TerminatorManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Terminator]) error
- func (ctrl *TerminatorManager) BaseList(query string) (*models.EntityListResult[T], error)
- func (ctrl *TerminatorManager) BaseLoad(id string) (T, error)
- func (ctrl *TerminatorManager) BaseLoadInTx(tx *bbolt.Tx, id string) (T, error)
- func (ctrl *TerminatorManager) BasePreparedList(query ast.Query) (*models.EntityListResult[T], error)
- func (self *TerminatorManager) Create(entity *Terminator) error
- func (self *TerminatorManager) Delete(id string) 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) error
Constants ¶
const ( CreateDecoder = "CreateDecoder" UpdateDecoder = "UpdateDecoder" DeleteDecoder = "DeleteDecoder" )
const ( DefaultNetworkOptionsCycleSeconds = 60 DefaultNetworkOptionsRouteTimeout = 10 * time.Second DefaultNetworkOptionsCreateCircuitRetries = 2 DefaultNetworkOptionsCtrlChanLatencyInterval = 10 * time.Second DefaultNetworkOptionsPendingLinkTimeout = 10 * time.Second DefaultNetworkOptionsMinRouterCost = 10 DefaultNetworkOptionsRouterConnectChurnLimit = time.Minute DefaultNetworkOptionsSmartRerouteFraction = 0.02 DefaultNetworkOptionsSmartRerouteCap = 4 DefaultNetworkOptionsInitialLinkLatency = 65 * time.Second DefaultNetworkOptionsMetricsReportInterval = time.Minute )
const SmartRerouteAttempt = 99969996
Variables ¶
var DbSnapshotTooFrequentError = dbSnapshotTooFrequentError{}
Functions ¶
func DispatchCreate ¶ added in v0.18.0
func DispatchUpdate ¶ added in v0.18.0
func DispatchUpdate[T models.Entity](u updater[T], entity T, updatedFields fields.UpdatedFields) error
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" 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 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 { Id string Src *Router Dst *Router Protocol string DialAddress string StaticCost int32 SrcLatency int64 DstLatency int64 Cost int64 // 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 // contains filtered or unexported fields }
func NewManagers ¶ added in v0.18.0
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) 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) CreateRouter ¶
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) 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) 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) 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 { CycleSeconds uint32 Smart struct { RerouteFraction float32 RerouteCap uint32 } RouteTimeout time.Duration CreateCircuitRetries uint32 CtrlChanLatencyInterval time.Duration PendingLinkTimeout time.Duration MinRouterCost uint16 RouterConnectChurnLimit time.Duration InitialLinkLatency time.Duration MetricsReportInterval time.Duration }
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 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 []Listener Control channel.Channel Connected atomic.Bool ConnectTime time.Time VersionInfo *versions.VersionInfo Cost uint16 NoTraversal bool // contains filtered or unexported fields }
func (*Router) AddLinkListener ¶ added in v0.17.60
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]) error
func (*RouterManager) ApplyDelete ¶ added in v0.18.0
func (self *RouterManager) ApplyDelete(cmd *command.DeleteEntityCommand) error
func (*RouterManager) ApplyUpdate ¶ added in v0.18.0
func (self *RouterManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Router]) error
func (*RouterManager) BaseList ¶ added in v0.18.0
func (ctrl *RouterManager) BaseList(query string) (*models.EntityListResult[T], 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[T], error)
func (*RouterManager) Create ¶ added in v0.18.0
func (self *RouterManager) Create(entity *Router) error
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) 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) error
func (*RouterManager) UpdateCachedRouter ¶ added in v0.18.0
func (self *RouterManager) UpdateCachedRouter(id string)
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]) error
func (*ServiceManager) ApplyDelete ¶ added in v0.18.0
func (self *ServiceManager) ApplyDelete(cmd *command.DeleteEntityCommand) error
func (*ServiceManager) ApplyUpdate ¶ added in v0.18.0
func (self *ServiceManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Service]) error
func (*ServiceManager) BaseList ¶ added in v0.18.0
func (ctrl *ServiceManager) BaseList(query string) (*models.EntityListResult[T], 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[T], error)
func (*ServiceManager) Create ¶ added in v0.18.0
func (self *ServiceManager) Create(entity *Service) 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) 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 }
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]) error
func (*TerminatorManager) ApplyDelete ¶ added in v0.18.0
func (self *TerminatorManager) ApplyDelete(cmd *command.DeleteEntityCommand) error
func (*TerminatorManager) ApplyUpdate ¶ added in v0.18.0
func (self *TerminatorManager) ApplyUpdate(cmd *command.UpdateEntityCommand[*Terminator]) error
func (*TerminatorManager) BaseList ¶ added in v0.18.0
func (ctrl *TerminatorManager) BaseList(query string) (*models.EntityListResult[T], 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[T], error)
func (*TerminatorManager) Create ¶ added in v0.18.0
func (self *TerminatorManager) Create(entity *Terminator) 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) error