Documentation
¶
Index ¶
- Constants
- func GenSocketID() string
- func GetRemoteAddrIP(remoteAddr string) string
- func RegisterPresetFilter()
- type ClientSocket
- func (s *ClientSocket) Close()
- func (s *ClientSocket) GetConn() net.Conn
- func (s *ClientSocket) GetDescr() string
- func (s *ClientSocket) GetID() string
- func (s *ClientSocket) GetIP() string
- func (s *ClientSocket) GetLastActivity() time.Time
- func (s *ClientSocket) GetPacketID() uint32
- func (s *ClientSocket) GetPresetFilter(modelID string) sql.FilterCondCollection
- func (s *ClientSocket) GetSession() session.Session
- func (s *ClientSocket) GetToken() string
- func (s *ClientSocket) GetTokenExpires() time.Time
- func (s *ClientSocket) SetPresetFilter(f PresetFilter) error
- func (s *ClientSocket) SetSession(sess session.Session)
- func (s *ClientSocket) SetToken(token string)
- func (s *ClientSocket) SetTokenExpires(t time.Time)
- func (s *ClientSocket) UpdateLastActivity()
- type ClientSocketList
- type ClientSocketer
- type PresetFilter
Constants ¶
View Source
const SESS_PRESET_FILTER = "PRESET_FILTER"
View Source
const SOCKET_ID_LEN = 32
Variables ¶
This section is empty.
Functions ¶
func GenSocketID ¶
func GenSocketID() string
func GetRemoteAddrIP ¶
func RegisterPresetFilter ¶
func RegisterPresetFilter()
Types ¶
type ClientSocket ¶
type ClientSocket struct {
ID string //emitter unique ID
Conn net.Conn
PacketID uint32
Token string
TokenExpires time.Time
LastActivity time.Time
StartTime time.Time
Session session.Session
// contains filtered or unexported fields
}
func NewClientSocket ¶
************* id string, ID: id,
func (*ClientSocket) Close ¶
func (s *ClientSocket) Close()
func (*ClientSocket) GetConn ¶
func (s *ClientSocket) GetConn() net.Conn
func (*ClientSocket) GetDescr ¶
func (s *ClientSocket) GetDescr() string
func (*ClientSocket) GetID ¶
func (s *ClientSocket) GetID() string
func (*ClientSocket) GetIP ¶
func (s *ClientSocket) GetIP() string
func (*ClientSocket) GetLastActivity ¶
func (s *ClientSocket) GetLastActivity() time.Time
func (*ClientSocket) GetPacketID ¶
func (s *ClientSocket) GetPacketID() uint32
func (*ClientSocket) GetPresetFilter ¶
func (s *ClientSocket) GetPresetFilter(modelID string) sql.FilterCondCollection
func (*ClientSocket) GetSession ¶
func (s *ClientSocket) GetSession() session.Session
func (*ClientSocket) GetToken ¶
func (s *ClientSocket) GetToken() string
func (*ClientSocket) GetTokenExpires ¶
func (s *ClientSocket) GetTokenExpires() time.Time
func (*ClientSocket) SetPresetFilter ¶
func (s *ClientSocket) SetPresetFilter(f PresetFilter) error
func (*ClientSocket) SetSession ¶
func (s *ClientSocket) SetSession(sess session.Session)
func (*ClientSocket) SetToken ¶
func (s *ClientSocket) SetToken(token string)
func (*ClientSocket) SetTokenExpires ¶
func (s *ClientSocket) SetTokenExpires(t time.Time)
func (*ClientSocket) UpdateLastActivity ¶
func (s *ClientSocket) UpdateLastActivity()
type ClientSocketList ¶
type ClientSocketList struct {
// contains filtered or unexported fields
}
Structure for managing client sockets
func NewClientSocketList ¶
func NewClientSocketList() *ClientSocketList
func (*ClientSocketList) Append ¶
func (l *ClientSocketList) Append(socket ClientSocketer)
func (*ClientSocketList) Iter ¶
func (l *ClientSocketList) Iter() <-chan ClientSocketer
Iterates over the events in the concurrent slice
func (ClientSocketList) Len ¶
func (l ClientSocketList) Len() int
func (*ClientSocketList) Remove ¶
func (l *ClientSocketList) Remove(socket ClientSocketer)
type ClientSocketer ¶
type ClientSocketer interface {
GetID() string
GetDescr() string
Close()
GetConn() net.Conn
SetToken(string)
GetToken() string
SetTokenExpires(time.Time)
GetTokenExpires() time.Time
UpdateLastActivity()
SetSession(session.Session)
GetSession() session.Session
GetPacketID() uint32
GetIP() string
GetPresetFilter(string) sql.FilterCondCollection
SetPresetFilter(PresetFilter) error
GetLastActivity() time.Time
}
Interface for client sockets
type PresetFilter ¶
type PresetFilter map[string]sql.FilterCondCollection
Individual global filter
func NewPresetFilter ¶
func NewPresetFilter() PresetFilter
func (*PresetFilter) Add ¶
func (f *PresetFilter) Add(modelID string, conditions sql.FilterCondCollection)
func (*PresetFilter) Get ¶
func (f *PresetFilter) Get(modelID string) sql.FilterCondCollection
Click to show internal directories.
Click to hide internal directories.