Documentation ¶
Index ¶
- Variables
- 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() interface{}
- func (s *Session) Save()
Constants ¶
This section is empty.
Variables ¶
var PublicKeyBytes []byte
PublicKeyBytes holds PEM RSA Key
Functions ¶
func DeleteAllConnections ¶ added in v0.0.24
func DeleteAllConnections()
DeleteAllConnections deletes all connections from all sessions
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"` AccessToken string `json:"access_token,omitempty"` UserID interface{} `json:"userId"` Connections []*Conn `json:"connections"` LastRequest time.Time `json:"lastRequest"` TTL time.Time `json:"ttl"` V int `json:"__v"` sync.RWMutex }
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