Documentation ¶
Index ¶
- func Delete(APIKey string)
- func DeleteAllConnections()
- func DeleteAllForUser(userID string)
- func Init()
- func OnSessionDelete(handler func(*Session))
- func OnSessionUpdate(handler func(*Session))
- type Conn
- type Session
- func (s *Session) AddSubscription(connID, uri string, extra interface{})
- func (s *Session) Delete()
- func (s *Session) DeleteConnection(connID string)
- func (s *Session) DeleteSubscription(connID, uri string)
- func (s *Session) GetAPIKey() string
- func (s *Session) GetUserID() string
- func (s *Session) Save(noLastRequestUpdate bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAllConnections ¶ added in v0.0.24
func DeleteAllConnections()
func DeleteAllForUser ¶
func DeleteAllForUser(userID string)
DeleteAllForUser removes all sessions for user from store
func OnSessionDelete ¶
func OnSessionDelete(handler func(*Session))
OnSessionDelete registers callback that will called when session deleted
func OnSessionUpdate ¶
func OnSessionUpdate(handler func(*Session))
OnSessionUpdate registers callback that will called when session updated
Types ¶
type Conn ¶
type Conn struct { ConnID string `json:"connId"` Subscriptions map[string]interface{} `json:"subscriptions"` }
Conn represents WAMP connection in session
type Session ¶
type Session struct { APIKey string `json:"apiKey"` UserID string `json:"userId"` Connections []*Conn `json:"connections"` LastRequest time.Time `json:"lastRequest"` V int `json:"__v"` sync.RWMutex // contains filtered or unexported fields }
Session represents user session in Blank
func GetByAPIKey ¶ added in v0.0.15
GetByAPIKey returns point to Session or error if it is not exists.
func GetByUserID ¶
GetByUserID returns point to Session or error if it is not exists.
func (*Session) AddSubscription ¶
AddSubscription adds subscription URI with provided params to user session
func (*Session) DeleteConnection ¶
DeleteConnection deletes WAMP connection from user session
func (*Session) DeleteSubscription ¶
DeleteSubscription deletes subscription from connection of user session
Click to show internal directories.
Click to hide internal directories.