Documentation ¶
Index ¶
- func Delete(APIKey string)
- func DeleteAllForUser(userID string)
- func Init()
- func OnSessionDelete(handler func(*Session))
- func OnSessionUpdate(handler func(*Session))
- func UpdateUser(userID string, user interface{})
- 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 OnSessionDelete ¶
func OnSessionDelete(handler func(*Session))
func OnSessionUpdate ¶
func OnSessionUpdate(handler func(*Session))
func UpdateUser ¶
func UpdateUser(userID string, user interface{})
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"` User interface{} `json:"user"` sync.RWMutex // contains filtered or unexported fields }
Session represents user session in Blank
func GetByApiKey ¶
GetByApiKey returns point to Session or error if it is not exists.
func GetByUserID ¶
GetByApiKey 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.