Documentation ¶
Index ¶
- func Delete(APIKey string)
- func DeleteAllConnections()
- func DeleteAllForUser(userID string)
- func Init()
- func OnSessionDelete(handler func(*Session))
- func OnSessionUpdate(handler func(*Session))
- func PublicKey() *rsa.PublicKey
- func PublicKeyBytes() []byte
- 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 ¶
This section is empty.
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
func PublicKeyBytes ¶ added in v0.0.48
func PublicKeyBytes() []byte
PublicKeyBytes returns PEM RSA Key as []byte
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"` CreatedAt time.Time `json:"createdAt"` 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