Documentation ¶
Index ¶
- Constants
- func NewApiSessionAddedHandler(sm Manager, binding channel.Binding) *apiSessionAddedHandler
- func NewApiSessionRemovedHandler(sm Manager) *apiSessionRemovedHandler
- func NewApiSessionUpdatedHandler(sm Manager) *apiSessionUpdatedHandler
- func NewDataStateEventHandler(state Manager) channel.TypedReceiveHandler
- func NewSessionRemovedHandler(sm Manager) *sessionRemovedHandler
- type ApiSession
- type DataStateHandler
- type DisconnectCB
- type Env
- type Manager
- type ManagerImpl
- func (sm *ManagerImpl) ActiveApiSessionTokens() []string
- func (sm *ManagerImpl) AddActiveChannel(ch channel.Channel, session *ApiSession)
- func (sm *ManagerImpl) AddApiSession(apiSession *edge_ctrl_pb.ApiSession)
- func (sm *ManagerImpl) AddApiSessionRemovedListener(token string, callBack func(token string)) RemoveListener
- func (sm *ManagerImpl) AddConnectedApiSession(token string)
- func (sm *ManagerImpl) AddConnectedApiSessionWithChannel(token string, removeCB func(), ch channel.Channel)
- func (sm *ManagerImpl) AddEdgeSessionRemovedListener(token string, callBack func(token string)) RemoveListener
- func (sm *ManagerImpl) BindChannel(binding channel.Binding) error
- func (sm *ManagerImpl) DumpApiSessions(c *bufio.ReadWriter) error
- func (sm *ManagerImpl) Enabled() bool
- func (sm *ManagerImpl) GetApiSession(token string) *ApiSession
- func (sm *ManagerImpl) GetApiSessionFromCh(ch channel.Channel) *ApiSession
- func (sm *ManagerImpl) GetApiSessionWithTimeout(token string, timeout time.Duration) *ApiSession
- func (sm *ManagerImpl) GetEnv() Env
- func (sm *ManagerImpl) GetTraceDecoders() []channel.TraceMessageDecoder
- func (sm *ManagerImpl) IsSyncInProgress() bool
- func (sm *ManagerImpl) LoadConfig(cfgmap map[interface{}]interface{}) error
- func (sm *ManagerImpl) LoadRouterModel(filePath string)
- func (sm *ManagerImpl) MarkSessionRecentlyRemoved(token string)
- func (sm *ManagerImpl) MarkSyncInProgress(trackerId string)
- func (sm *ManagerImpl) MarkSyncStopped(trackerId string)
- func (sm *ManagerImpl) NotifyOfReconnect(ch channel.Channel)
- func (sm *ManagerImpl) ParseJwt(jwtStr string) (*jwt.Token, *common.AccessClaims, error)
- func (sm *ManagerImpl) RemoveActiveChannel(ch channel.Channel)
- func (sm *ManagerImpl) RemoveApiSession(token string)
- func (sm *ManagerImpl) RemoveConnectedApiSession(token string)
- func (sm *ManagerImpl) RemoveConnectedApiSessionWithChannel(token string, ch channel.Channel)
- func (sm *ManagerImpl) RemoveEdgeSession(token string)
- func (sm *ManagerImpl) RemoveMissingApiSessions(knownApiSessions []*edge_ctrl_pb.ApiSession, beforeSessionId string)
- func (sm *ManagerImpl) RouterDataModel() *common.RouterDataModel
- func (sm *ManagerImpl) Run(env.RouterEnv) error
- func (sm *ManagerImpl) SessionConnectionClosed(token string)
- func (sm *ManagerImpl) SetRouterDataModel(model *common.RouterDataModel)
- func (sm *ManagerImpl) StartHeartbeat(env env.RouterEnv, intervalSeconds int, closeNotify <-chan struct{})
- func (sm *ManagerImpl) StartRouterModelSave(filePath string, duration time.Duration)
- func (sm *ManagerImpl) UpdateApiSession(apiSession *edge_ctrl_pb.ApiSession)
- func (sm *ManagerImpl) UpdateChApiSession(ch channel.Channel, newApiSession *ApiSession) error
- func (sm *ManagerImpl) ValidateSessions(ch channel.Channel, chunkSize uint32, minInterval, maxInterval time.Duration)
- func (sm *ManagerImpl) VerifyClientCert(cert *x509.Certificate) error
- func (sm *ManagerImpl) WasSessionRecentlyRemoved(token string) bool
- type MapWithMutex
- type RemoveListener
- type TokenProvider
Constants ¶
View Source
const ( EventRemovedEdgeSession = "RemovedEdgeSession" EventAddedApiSession = "AddedApiSession" EventUpdatedApiSession = "UpdatedApiSession" EventRemovedApiSession = "RemovedApiSession" RouterDataModelListerBufferSize = 100 )
Variables ¶
This section is empty.
Functions ¶
func NewApiSessionAddedHandler ¶ added in v1.1.1
func NewApiSessionAddedHandler(sm Manager, binding channel.Binding) *apiSessionAddedHandler
func NewApiSessionRemovedHandler ¶ added in v1.1.1
func NewApiSessionRemovedHandler(sm Manager) *apiSessionRemovedHandler
func NewApiSessionUpdatedHandler ¶ added in v1.1.1
func NewApiSessionUpdatedHandler(sm Manager) *apiSessionUpdatedHandler
func NewDataStateEventHandler ¶ added in v1.1.1
func NewDataStateEventHandler(state Manager) channel.TypedReceiveHandler
func NewSessionRemovedHandler ¶ added in v1.1.1
func NewSessionRemovedHandler(sm Manager) *sessionRemovedHandler
Types ¶
type ApiSession ¶
type ApiSession struct { *edge_ctrl_pb.ApiSession JwtToken *jwt.Token Claims *common.AccessClaims }
func NewApiSessionFromToken ¶ added in v1.1.1
func NewApiSessionFromToken(jwtToken *jwt.Token, accessClaims *common.AccessClaims) *ApiSession
type DataStateHandler ¶ added in v1.1.1
type DataStateHandler struct {
// contains filtered or unexported fields
}
func NewDataStateHandler ¶ added in v1.1.1
func NewDataStateHandler(state Manager) *DataStateHandler
func (*DataStateHandler) ContentType ¶ added in v1.1.1
func (*DataStateHandler) ContentType() int32
func (*DataStateHandler) HandleReceive ¶ added in v1.1.1
func (dsh *DataStateHandler) HandleReceive(msg *channel.Message, ch channel.Channel)
type DisconnectCB ¶
type DisconnectCB func(token string)
type Env ¶ added in v1.1.1
type Env interface { IsHaEnabled() bool GetCloseNotify() <-chan struct{} }
type Manager ¶
type Manager interface { //"Network" Sessions RemoveEdgeSession(token string) AddEdgeSessionRemovedListener(token string, callBack func(token string)) RemoveListener WasSessionRecentlyRemoved(token string) bool MarkSessionRecentlyRemoved(token string) //ApiSessions GetApiSession(token string) *ApiSession GetApiSessionWithTimeout(token string, timeout time.Duration) *ApiSession AddApiSession(apiSession *edge_ctrl_pb.ApiSession) UpdateApiSession(apiSession *edge_ctrl_pb.ApiSession) RemoveApiSession(token string) RemoveMissingApiSessions(knownSessions []*edge_ctrl_pb.ApiSession, beforeSessionId string) AddConnectedApiSession(token string) RemoveConnectedApiSession(token string) AddConnectedApiSessionWithChannel(token string, removeCB func(), ch channel.Channel) RemoveConnectedApiSessionWithChannel(token string, underlay channel.Channel) AddApiSessionRemovedListener(token string, callBack func(token string)) RemoveListener ParseJwt(jwtStr string) (*jwt.Token, *common.AccessClaims, error) RouterDataModel() *common.RouterDataModel SetRouterDataModel(model *common.RouterDataModel) StartHeartbeat(env env.RouterEnv, seconds int, closeNotify <-chan struct{}) ValidateSessions(ch channel.Channel, chunkSize uint32, minInterval, maxInterval time.Duration) DumpApiSessions(c *bufio.ReadWriter) error MarkSyncInProgress(trackerId string) MarkSyncStopped(trackerId string) IsSyncInProgress() bool VerifyClientCert(cert *x509.Certificate) error StartRouterModelSave(path string, duration time.Duration) LoadRouterModel(filePath string) AddActiveChannel(ch channel.Channel, session *ApiSession) RemoveActiveChannel(ch channel.Channel) GetApiSessionFromCh(ch channel.Channel) *ApiSession GetEnv() Env UpdateChApiSession(channel.Channel, *ApiSession) error env.Xrctrl }
func NewManager ¶
type ManagerImpl ¶
type ManagerImpl struct { Hostname string ControllerAddr string ClusterId string NodeId string events.EventEmmiter // contains filtered or unexported fields }
func (*ManagerImpl) ActiveApiSessionTokens ¶
func (sm *ManagerImpl) ActiveApiSessionTokens() []string
func (*ManagerImpl) AddActiveChannel ¶
func (sm *ManagerImpl) AddActiveChannel(ch channel.Channel, session *ApiSession)
func (*ManagerImpl) AddApiSession ¶
func (sm *ManagerImpl) AddApiSession(apiSession *edge_ctrl_pb.ApiSession)
func (*ManagerImpl) AddApiSessionRemovedListener ¶
func (sm *ManagerImpl) AddApiSessionRemovedListener(token string, callBack func(token string)) RemoveListener
func (*ManagerImpl) AddConnectedApiSession ¶
func (sm *ManagerImpl) AddConnectedApiSession(token string)
func (*ManagerImpl) AddConnectedApiSessionWithChannel ¶
func (sm *ManagerImpl) AddConnectedApiSessionWithChannel(token string, removeCB func(), ch channel.Channel)
func (*ManagerImpl) AddEdgeSessionRemovedListener ¶
func (sm *ManagerImpl) AddEdgeSessionRemovedListener(token string, callBack func(token string)) RemoveListener
func (*ManagerImpl) BindChannel ¶ added in v1.1.1
func (sm *ManagerImpl) BindChannel(binding channel.Binding) error
func (*ManagerImpl) DumpApiSessions ¶
func (sm *ManagerImpl) DumpApiSessions(c *bufio.ReadWriter) error
func (*ManagerImpl) Enabled ¶ added in v1.1.1
func (sm *ManagerImpl) Enabled() bool
func (*ManagerImpl) GetApiSession ¶
func (sm *ManagerImpl) GetApiSession(token string) *ApiSession
func (*ManagerImpl) GetApiSessionFromCh ¶
func (sm *ManagerImpl) GetApiSessionFromCh(ch channel.Channel) *ApiSession
func (*ManagerImpl) GetApiSessionWithTimeout ¶
func (sm *ManagerImpl) GetApiSessionWithTimeout(token string, timeout time.Duration) *ApiSession
func (*ManagerImpl) GetEnv ¶ added in v1.1.1
func (sm *ManagerImpl) GetEnv() Env
func (*ManagerImpl) GetTraceDecoders ¶ added in v1.1.1
func (sm *ManagerImpl) GetTraceDecoders() []channel.TraceMessageDecoder
func (*ManagerImpl) IsSyncInProgress ¶
func (sm *ManagerImpl) IsSyncInProgress() bool
func (*ManagerImpl) LoadConfig ¶ added in v1.1.1
func (sm *ManagerImpl) LoadConfig(cfgmap map[interface{}]interface{}) error
func (*ManagerImpl) LoadRouterModel ¶
func (sm *ManagerImpl) LoadRouterModel(filePath string)
func (*ManagerImpl) MarkSessionRecentlyRemoved ¶
func (sm *ManagerImpl) MarkSessionRecentlyRemoved(token string)
func (*ManagerImpl) MarkSyncInProgress ¶
func (sm *ManagerImpl) MarkSyncInProgress(trackerId string)
func (*ManagerImpl) MarkSyncStopped ¶
func (sm *ManagerImpl) MarkSyncStopped(trackerId string)
func (*ManagerImpl) NotifyOfReconnect ¶ added in v1.1.1
func (sm *ManagerImpl) NotifyOfReconnect(ch channel.Channel)
func (*ManagerImpl) ParseJwt ¶
func (sm *ManagerImpl) ParseJwt(jwtStr string) (*jwt.Token, *common.AccessClaims, error)
func (*ManagerImpl) RemoveActiveChannel ¶
func (sm *ManagerImpl) RemoveActiveChannel(ch channel.Channel)
func (*ManagerImpl) RemoveApiSession ¶
func (sm *ManagerImpl) RemoveApiSession(token string)
func (*ManagerImpl) RemoveConnectedApiSession ¶
func (sm *ManagerImpl) RemoveConnectedApiSession(token string)
func (*ManagerImpl) RemoveConnectedApiSessionWithChannel ¶
func (sm *ManagerImpl) RemoveConnectedApiSessionWithChannel(token string, ch channel.Channel)
func (*ManagerImpl) RemoveEdgeSession ¶
func (sm *ManagerImpl) RemoveEdgeSession(token string)
func (*ManagerImpl) RemoveMissingApiSessions ¶
func (sm *ManagerImpl) RemoveMissingApiSessions(knownApiSessions []*edge_ctrl_pb.ApiSession, beforeSessionId string)
RemoveMissingApiSessions removes API Sessions not present in the knownApiSessions argument. If the beforeSessionId value is not empty string, it will be used as a monotonic comparison between it and API session ids. API session ids later than the sync will be ignored.
func (*ManagerImpl) RouterDataModel ¶
func (sm *ManagerImpl) RouterDataModel() *common.RouterDataModel
func (*ManagerImpl) SessionConnectionClosed ¶
func (sm *ManagerImpl) SessionConnectionClosed(token string)
func (*ManagerImpl) SetRouterDataModel ¶
func (sm *ManagerImpl) SetRouterDataModel(model *common.RouterDataModel)
func (*ManagerImpl) StartHeartbeat ¶
func (sm *ManagerImpl) StartHeartbeat(env env.RouterEnv, intervalSeconds int, closeNotify <-chan struct{})
func (*ManagerImpl) StartRouterModelSave ¶
func (sm *ManagerImpl) StartRouterModelSave(filePath string, duration time.Duration)
func (*ManagerImpl) UpdateApiSession ¶
func (sm *ManagerImpl) UpdateApiSession(apiSession *edge_ctrl_pb.ApiSession)
func (*ManagerImpl) UpdateChApiSession ¶ added in v1.1.1
func (sm *ManagerImpl) UpdateChApiSession(ch channel.Channel, newApiSession *ApiSession) error
func (*ManagerImpl) ValidateSessions ¶
func (sm *ManagerImpl) ValidateSessions(ch channel.Channel, chunkSize uint32, minInterval, maxInterval time.Duration)
func (*ManagerImpl) VerifyClientCert ¶
func (sm *ManagerImpl) VerifyClientCert(cert *x509.Certificate) error
func (*ManagerImpl) WasSessionRecentlyRemoved ¶
func (sm *ManagerImpl) WasSessionRecentlyRemoved(token string) bool
type MapWithMutex ¶
func (*MapWithMutex) Put ¶
func (self *MapWithMutex) Put(ch channel.Channel, f func())
func (*MapWithMutex) Visit ¶
func (self *MapWithMutex) Visit(cb func(ch channel.Channel, closeCb func()))
type RemoveListener ¶
type RemoveListener func()
type TokenProvider ¶
type TokenProvider interface { ActiveApiSessionTokens() []string // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.