Documentation ¶
Index ¶
- type MemorySessionStore
- type RedisSessionStore
- type SessionStore
- type Sock
- func (s *Sock) AddListener(path string)
- func (s *Sock) Delete() error
- func (s *Sock) GetFilter() *types.Filter
- func (s *Sock) HandleMessage(msg *SockMessage)
- func (s *Sock) HasListener(path string) bool
- func (s *Sock) IsExpired() bool
- func (s *Sock) IsPaused() bool
- func (s *Sock) LoadSession()
- func (s *Sock) RemoveListener(path string)
- func (s *Sock) SendLog(lg *_types.Log) error
- func (s *Sock) SetFilter(f *types.Filter)
- func (s *Sock) SetPaused(state bool)
- func (s *Sock) SetStore(store SessionStore)
- type SockMap
- func (sm *SockMap) GetSock(userId int, sockId string) *Sock
- func (sm *SockMap) GetSocks(userId int) *cmap.ConcurrentMap[string, *Sock]
- func (sm *SockMap) Push(lg *_types.Log) int
- func (sm *SockMap) Register(s *Sock)
- func (sm *SockMap) SetFilter(userId int, sockId string, filter *types.Filter) bool
- func (sm *SockMap) SetSessionStore(store SessionStore)
- func (sm *SockMap) String() string
- func (sm *SockMap) Unregister(s *Sock)
- type SockMessage
- type SockSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemorySessionStore ¶
type MemorySessionStore struct{}
func (MemorySessionStore) Del ¶
func (s MemorySessionStore) Del(key string) error
func (MemorySessionStore) Get ¶
func (s MemorySessionStore) Get(key string) (*SockSession, error)
func (MemorySessionStore) Set ¶
func (s MemorySessionStore) Set(key string, value *SockSession) error
type RedisSessionStore ¶
type RedisSessionStore struct {
// contains filtered or unexported fields
}
func NewRedisSessionStore ¶
func (*RedisSessionStore) Del ¶
func (store *RedisSessionStore) Del(key string) error
func (*RedisSessionStore) Get ¶
func (store *RedisSessionStore) Get(key string) (*SockSession, error)
func (*RedisSessionStore) Set ¶
func (store *RedisSessionStore) Set(key string, value *SockSession) error
type SessionStore ¶
type SessionStore interface { Set(key string, value *SockSession) error Get(key string) (*SockSession, error) Del(key string) error }
type Sock ¶
type Sock struct { SockId string `json:"sock_id"` Session *SockSession `json:"session"` Conn io.WriteCloser `json:"conn"` JwtToken string `json:"jwt_token"` *types.User `json:"user"` *jwtservice.Claims `json:"claims"` // contains filtered or unexported fields }
func (*Sock) AddListener ¶
func (*Sock) HandleMessage ¶
func (s *Sock) HandleMessage(msg *SockMessage)
func (*Sock) HasListener ¶
func (*Sock) LoadSession ¶
func (s *Sock) LoadSession()
func (*Sock) RemoveListener ¶
func (*Sock) SetStore ¶
func (s *Sock) SetStore(store SessionStore)
type SockMap ¶
type SockMap struct {
// contains filtered or unexported fields
}
func NewSockMap ¶
func NewSockMap() *SockMap
func (*SockMap) SetSessionStore ¶
func (sm *SockMap) SetSessionStore(store SessionStore)
func (*SockMap) Unregister ¶
type SockMessage ¶
Click to show internal directories.
Click to hide internal directories.