Documentation ¶
Index ¶
- Constants
- type ApiSession
- type DisconnectCB
- type MapWithMutex
- type RemoveListener
- type StateManager
- type StateManagerImpl
- func (sm *StateManagerImpl) ActiveApiSessionTokens() []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)
- func (sm *StateManagerImpl) AddConnectedApiSessionWithChannel(token string, removeCB func(), ch channel.Channel)
- func (sm *StateManagerImpl) AddEdgeSessionRemovedListener(token string, callBack func(token string)) RemoveListener
- func (sm *StateManagerImpl) AddSignerPublicCert(keys [][]byte)
- func (sm *StateManagerImpl) DumpApiSessions(c *bufio.ReadWriter) error
- func (sm *StateManagerImpl) GetApiSession(token string) *ApiSession
- func (sm *StateManagerImpl) GetApiSessionWithTimeout(token string, timeout time.Duration) *ApiSession
- func (sm *StateManagerImpl) IsSyncInProgress() bool
- func (sm *StateManagerImpl) MarkSyncInProgress(trackerId string)
- func (sm *StateManagerImpl) MarkSyncStopped(trackerId string)
- func (sm *StateManagerImpl) RefreshSigners()
- func (sm *StateManagerImpl) RemoveApiSession(token string)
- func (sm *StateManagerImpl) RemoveConnectedApiSession(token string)
- func (sm *StateManagerImpl) RemoveConnectedApiSessionWithChannel(token string, ch channel.Channel)
- func (sm *StateManagerImpl) RemoveEdgeSession(token string)
- func (sm *StateManagerImpl) RemoveMissingApiSessions(knownApiSessions []*edge_ctrl_pb.ApiSession, beforeSessionId string)
- func (sm *StateManagerImpl) SessionConnectionClosed(token string)
- func (sm *StateManagerImpl) StartHeartbeat(env env.RouterEnv, intervalSeconds int, closeNotify <-chan struct{})
- func (sm *StateManagerImpl) UpdateApiSession(apiSession *edge_ctrl_pb.ApiSession)
- func (sm *StateManagerImpl) ValidateSessions(ch channel.Channel, chunkSize uint32, minInterval, maxInterval time.Duration)
- type TokenProvider
Constants ¶
View Source
const ( EventRemovedEdgeSession = "RemovedEdgeSession" EventAddedApiSession = "AddedApiSession" EventUpdatedApiSession = "UpdatedApiSession" EventRemovedApiSession = "RemovedApiSession" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiSession ¶ added in v0.24.373
type ApiSession struct { *edge_ctrl_pb.ApiSession JwtToken *jwt.Token Claims *oidc_auth.AccessClaims }
type DisconnectCB ¶
type DisconnectCB func(token string)
type MapWithMutex ¶
func (*MapWithMutex) Put ¶
func (self *MapWithMutex) Put(ch channel.Channel, f func())
type RemoveListener ¶
type RemoveListener func()
type StateManager ¶
type StateManager interface { //"Network" Sessions RemoveEdgeSession(token string) AddEdgeSessionRemovedListener(token string, callBack func(token string)) RemoveListener //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 AddSignerPublicCert(keys [][]byte) 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 }
func NewStateManager ¶
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) ActiveApiSessionTokens ¶
func (sm *StateManagerImpl) ActiveApiSessionTokens() []string
func (*StateManagerImpl) AddApiSession ¶
func (sm *StateManagerImpl) AddApiSession(apiSession *edge_ctrl_pb.ApiSession)
func (*StateManagerImpl) AddApiSessionRemovedListener ¶
func (sm *StateManagerImpl) AddApiSessionRemovedListener(token string, callBack func(token string)) RemoveListener
func (*StateManagerImpl) AddConnectedApiSession ¶
func (sm *StateManagerImpl) AddConnectedApiSession(token string)
func (*StateManagerImpl) AddConnectedApiSessionWithChannel ¶
func (sm *StateManagerImpl) AddConnectedApiSessionWithChannel(token string, removeCB func(), ch channel.Channel)
func (*StateManagerImpl) AddEdgeSessionRemovedListener ¶ added in v0.19.57
func (sm *StateManagerImpl) AddEdgeSessionRemovedListener(token string, callBack func(token string)) RemoveListener
func (*StateManagerImpl) AddSignerPublicCert ¶ added in v0.24.373
func (sm *StateManagerImpl) AddSignerPublicCert(keys [][]byte)
func (*StateManagerImpl) DumpApiSessions ¶ added in v0.19.133
func (sm *StateManagerImpl) DumpApiSessions(c *bufio.ReadWriter) error
func (*StateManagerImpl) GetApiSession ¶
func (sm *StateManagerImpl) GetApiSession(token string) *ApiSession
func (*StateManagerImpl) GetApiSessionWithTimeout ¶
func (sm *StateManagerImpl) GetApiSessionWithTimeout(token string, timeout time.Duration) *ApiSession
func (*StateManagerImpl) IsSyncInProgress ¶ added in v0.19.133
func (sm *StateManagerImpl) IsSyncInProgress() bool
func (*StateManagerImpl) MarkSyncInProgress ¶ added in v0.19.133
func (sm *StateManagerImpl) MarkSyncInProgress(trackerId string)
func (*StateManagerImpl) MarkSyncStopped ¶ added in v0.19.133
func (sm *StateManagerImpl) MarkSyncStopped(trackerId string)
func (*StateManagerImpl) RefreshSigners ¶ added in v0.24.373
func (sm *StateManagerImpl) RefreshSigners()
func (*StateManagerImpl) RemoveApiSession ¶
func (sm *StateManagerImpl) RemoveApiSession(token string)
func (*StateManagerImpl) RemoveConnectedApiSession ¶
func (sm *StateManagerImpl) RemoveConnectedApiSession(token string)
func (*StateManagerImpl) RemoveConnectedApiSessionWithChannel ¶
func (sm *StateManagerImpl) RemoveConnectedApiSessionWithChannel(token string, ch channel.Channel)
func (*StateManagerImpl) RemoveEdgeSession ¶ added in v0.19.57
func (sm *StateManagerImpl) RemoveEdgeSession(token string)
func (*StateManagerImpl) RemoveMissingApiSessions ¶
func (sm *StateManagerImpl) 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 (*StateManagerImpl) SessionConnectionClosed ¶
func (sm *StateManagerImpl) SessionConnectionClosed(token string)
func (*StateManagerImpl) StartHeartbeat ¶
func (sm *StateManagerImpl) StartHeartbeat(env env.RouterEnv, intervalSeconds int, closeNotify <-chan struct{})
func (*StateManagerImpl) UpdateApiSession ¶
func (sm *StateManagerImpl) UpdateApiSession(apiSession *edge_ctrl_pb.ApiSession)
func (*StateManagerImpl) ValidateSessions ¶
func (sm *StateManagerImpl) ValidateSessions(ch channel.Channel, chunkSize uint32, minInterval, maxInterval time.Duration)
type TokenProvider ¶
type TokenProvider interface { ActiveApiSessionTokens() []string // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.