Documentation
¶
Index ¶
- Variables
- func NextSessionId() int64
- type Session
- func (s *Session) Bind(uid cherryInterfaces.UID) error
- func (s *Session) Closed()
- func (s *Session) Conn() net.Conn
- func (s *Session) FrontendId() cherryInterfaces.FrontendId
- func (s *Session) Net() cherryInterfaces.INetworkEntity
- func (s *Session) OnClose(listener cherryInterfaces.SessionListener)
- func (s *Session) OnError(listener cherryInterfaces.SessionListener)
- func (s *Session) OnMessage(listener cherryInterfaces.MessageListener)
- func (s *Session) SID() cherryInterfaces.SID
- func (s *Session) Send(msg []byte) error
- func (s *Session) SendBatch(batchMsg ...[]byte)
- func (s *Session) SetStatus(status int)
- func (s *Session) Start()
- func (s *Session) Status() int
- func (s *Session) String() string
- func (s *Session) UID() cherryInterfaces.UID
- type SessionComponent
- type Settings
- func (s *Settings) Clear()
- func (s *Settings) Contains(key string) bool
- func (s *Settings) Data() map[string]interface{}
- func (s *Settings) GetFloat32(key string) float32
- func (s *Settings) GetFloat64(key string) float64
- func (s *Settings) GetInt(key string) int
- func (s *Settings) GetInt8(key string) int8
- func (s *Settings) GetInt16(key string) int16
- func (s *Settings) GetInt32(key string) int32
- func (s *Settings) GetInt64(key string) int64
- func (s *Settings) GetString(key string) string
- func (s *Settings) GetUint(key string) uint
- func (s *Settings) GetUint8(key string) uint8
- func (s *Settings) GetUint16(key string) uint16
- func (s *Settings) GetUint32(key string) uint32
- func (s *Settings) GetUint64(key string) uint64
- func (s *Settings) GetValue(key string) interface{}
- func (s *Settings) Remove(key string)
- func (s *Settings) Restore(data map[string]interface{})
- func (s *Settings) Set(key string, value interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ( INIT = 0 CLOSED = 1 )
View Source
var (
IllegalUID = cherryUtils.Error("illegal uid")
)
Functions ¶
func NextSessionId ¶
func NextSessionId() int64
Types ¶
type Session ¶
type Session struct {
Settings
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(sid cherryInterfaces.SID, conn net.Conn, net cherryInterfaces.INetworkEntity, sessionComponent *SessionComponent) *Session
func (*Session) FrontendId ¶
func (s *Session) FrontendId() cherryInterfaces.FrontendId
type SessionComponent ¶
type SessionComponent struct {
cherryInterfaces.BaseComponent
// contains filtered or unexported fields
}
SessionComponent session sessionComponent
func NewService ¶
func NewService() *SessionComponent
func (*SessionComponent) Bind ¶
func (s *SessionComponent) Bind(sid cherryInterfaces.SID, uid cherryInterfaces.UID) error
func (*SessionComponent) Create ¶
func (s *SessionComponent) Create(conn net.Conn, net cherryInterfaces.INetworkEntity) *Session
func (*SessionComponent) Name ¶
func (s *SessionComponent) Name() string
func (*SessionComponent) Remove ¶
func (s *SessionComponent) Remove(sid cherryInterfaces.SID)
type Settings ¶
func (*Settings) Clear ¶
func (s *Settings) Clear()
Clear releases all settings related to current sessionComponent
func (*Settings) GetFloat32 ¶
Float32 returns the value associated with the key as a float32.
func (*Settings) GetFloat64 ¶
Float64 returns the value associated with the key as a float64.
Click to show internal directories.
Click to hide internal directories.