Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IDFromContext ¶
Types ¶
type StateManager ¶
type StateManager[S State] struct { // contains filtered or unexported fields }
func NewStateManager ¶
func NewStateManager[S State]() *StateManager[S]
func (*StateManager[S]) Close ¶
func (sm *StateManager[S]) Close()
Close the StateManager, cleaning up the background worker. It should not be used after this call.
func (*StateManager[S]) Get ¶
func (sm *StateManager[S]) Get(conID string) (S, bool)
Get a previously saved state for a connection ID. If the connection ID is not present in the map, a blank state will be returned
func (*StateManager[S]) Set ¶
func (sm *StateManager[S]) Set(conID string, state S)
Set state for a connection ID. Previously saved state will be overriden.
Click to show internal directories.
Click to hide internal directories.