Documentation ¶
Index ¶
- Constants
- type DisconnectCB
- type MapWithMutex
- type RemoveListener
- type StateManager
- type StateManagerImpl
- func (sm *StateManagerImpl) ActiveSessionTokens() []string
- func (sm *StateManagerImpl) AddApiSession(apiSession *edge_ctrl_pb.ApiSession)
- func (sm *StateManagerImpl) AddApiSessionRemovedListener(token string, callBack func(token string)) RemoveListener
- func (sm *StateManagerImpl) AddConnectedApiSession(token string, removeCB func(), ch channel2.Channel)
- func (sm *StateManagerImpl) AddSessionRemovedListener(token string, callBack func(token string)) RemoveListener
- func (sm *StateManagerImpl) GetApiSession(token string) *edge_ctrl_pb.ApiSession
- func (sm *StateManagerImpl) GetApiSessionWithTimeout(token string, timeout time.Duration) *edge_ctrl_pb.ApiSession
- func (sm *StateManagerImpl) RemoveApiSession(token string)
- func (sm *StateManagerImpl) RemoveConnectedApiSession(token string, ch channel2.Channel)
- func (sm *StateManagerImpl) RemoveMissingApiSessions(knownApiSessions []*edge_ctrl_pb.ApiSession, beforeSessionId string)
- func (sm *StateManagerImpl) RemoveSession(token string)
- func (sm *StateManagerImpl) SessionConnectionClosed(token string)
- func (sm *StateManagerImpl) StartHeartbeat(ctrl channel2.Channel, intervalSeconds int, closeNotify <-chan struct{})
- func (sm *StateManagerImpl) UpdateApiSession(apiSession *edge_ctrl_pb.ApiSession)
- func (sm *StateManagerImpl) ValidateSessions(ch channel2.Channel, chunkSize uint32, minInterval, maxInterval time.Duration)
- type TokenProvider
Constants ¶
View Source
const ( EventRemovedNetworkSession = "RemovedNetworkSession" EventAddedSession = "AddedSession" EventUpdatedSession = "UpdatedSession" EventRemovedSession = "RemovedSession" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DisconnectCB ¶
type DisconnectCB func(token string)
type MapWithMutex ¶ added in v0.17.60
func (*MapWithMutex) Put ¶ added in v0.17.60
func (self *MapWithMutex) Put(ch channel2.Channel, f func())
type RemoveListener ¶
type RemoveListener func()
type StateManager ¶
type StateManager interface { //"Network" Sessions RemoveSession(token string) AddSessionRemovedListener(token string, callBack func(token string)) RemoveListener //ApiSessions GetApiSession(token string) *edge_ctrl_pb.ApiSession GetApiSessionWithTimeout(token string, timeout time.Duration) *edge_ctrl_pb.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, removeCB func(), ch channel2.Channel) RemoveConnectedApiSession(token string, underlay channel2.Channel) AddApiSessionRemovedListener(token string, callBack func(token string)) RemoveListener StartHeartbeat(channel channel2.Channel, seconds int, closeNotify <-chan struct{}) ValidateSessions(ch channel2.Channel, chunkSize uint32, minInterval, maxInterval time.Duration) }
func NewStateManager ¶ added in v0.19.0
func NewStateManager() StateManager
type StateManagerImpl ¶
type StateManagerImpl struct { Hostname string ControllerAddr string ClusterId string NodeId string events.EventEmmiter // contains filtered or unexported fields }
func (*StateManagerImpl) ActiveSessionTokens ¶
func (sm *StateManagerImpl) ActiveSessionTokens() []string
func (*StateManagerImpl) AddApiSession ¶
func (sm *StateManagerImpl) AddApiSession(apiSession *edge_ctrl_pb.ApiSession)
func (*StateManagerImpl) AddApiSessionRemovedListener ¶ added in v0.17.30
func (sm *StateManagerImpl) AddApiSessionRemovedListener(token string, callBack func(token string)) RemoveListener
func (*StateManagerImpl) AddConnectedApiSession ¶ added in v0.17.30
func (sm *StateManagerImpl) AddConnectedApiSession(token string, removeCB func(), ch channel2.Channel)
func (*StateManagerImpl) AddSessionRemovedListener ¶
func (sm *StateManagerImpl) AddSessionRemovedListener(token string, callBack func(token string)) RemoveListener
func (*StateManagerImpl) GetApiSession ¶ added in v0.17.30
func (sm *StateManagerImpl) GetApiSession(token string) *edge_ctrl_pb.ApiSession
func (*StateManagerImpl) GetApiSessionWithTimeout ¶ added in v0.17.48
func (sm *StateManagerImpl) GetApiSessionWithTimeout(token string, timeout time.Duration) *edge_ctrl_pb.ApiSession
func (*StateManagerImpl) RemoveApiSession ¶
func (sm *StateManagerImpl) RemoveApiSession(token string)
func (*StateManagerImpl) RemoveConnectedApiSession ¶ added in v0.17.30
func (sm *StateManagerImpl) RemoveConnectedApiSession(token string, ch channel2.Channel)
func (*StateManagerImpl) RemoveMissingApiSessions ¶
func (sm *StateManagerImpl) RemoveMissingApiSessions(knownApiSessions []*edge_ctrl_pb.ApiSession, beforeSessionId string)
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 (*StateManagerImpl) RemoveSession ¶
func (sm *StateManagerImpl) RemoveSession(token string)
func (*StateManagerImpl) SessionConnectionClosed ¶ added in v0.19.0
func (sm *StateManagerImpl) SessionConnectionClosed(token string)
func (*StateManagerImpl) StartHeartbeat ¶
func (sm *StateManagerImpl) StartHeartbeat(ctrl channel2.Channel, intervalSeconds int, closeNotify <-chan struct{})
func (*StateManagerImpl) UpdateApiSession ¶
func (sm *StateManagerImpl) UpdateApiSession(apiSession *edge_ctrl_pb.ApiSession)
func (*StateManagerImpl) ValidateSessions ¶ added in v0.19.0
type TokenProvider ¶
type TokenProvider interface {
ActiveSessionTokens() []string
}
Click to show internal directories.
Click to hide internal directories.