Documentation ¶
Index ¶
- Variables
- type ClientSession
- type Response
- type ServerSession
- type SessionMap
- func (s *SessionMap) CreateSession(id int64) (newSession *ServerSession, err error)
- func (s *SessionMap) DeepCopy() *SessionMap
- func (s *SessionMap) GetResponse(request *pb.SessionHeader) (proto.Message, error)
- func (s *SessionMap) HasSession(id int64) bool
- func (s *SessionMap) HaveProcessed(request pb.SessionHeader) bool
- func (s *SessionMap) IsDuplicate(request *pb.SessionHeader) bool
- func (s *SessionMap) Lock()
- func (s *SessionMap) Merge(from map[int64]*pb.ServerSession)
- func (s *SessionMap) ProtoMessage() map[int64]*pb.ServerSession
- func (s *SessionMap) ResetLock()
- func (s *SessionMap) SetResponse(request *pb.SessionHeader, resp proto.Message) error
- func (s *SessionMap) SetSession(id int64, session *ServerSession)
- func (s *SessionMap) Unlock()
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicateSession error = errors.New(pb.ERR_DUPLICATE.String())
View Source
var ErrReturned error = errors.New(pb.ERR_RETURNED.String())
Functions ¶
This section is empty.
Types ¶
type ClientSession ¶
type ClientSession struct { ProcessedSeq uint64 NextSeq uint64 // contains filtered or unexported fields }
func NewClientSession ¶
func NewClientSession(id int64) *ClientSession
func (*ClientSession) NextHeader ¶
func (c *ClientSession) NextHeader() *pb.SessionHeader
type ServerSession ¶
type ServerSession struct {
// contains filtered or unexported fields
}
func NewServerSession ¶
func NewServerSession(id int64) *ServerSession
func NewServerSessionFrom ¶
func NewServerSessionFrom(session *pb.ServerSession) *ServerSession
func (*ServerSession) ProcessedSeq ¶
func (s *ServerSession) ProcessedSeq() uint64
func (*ServerSession) ProtoMessage ¶
func (s *ServerSession) ProtoMessage() *pb.ServerSession
type SessionMap ¶
type SessionMap struct { Map map[int64]*ServerSession // contains filtered or unexported fields }
func NewSessionMap ¶
func NewSessionMap() *SessionMap
func (*SessionMap) CreateSession ¶
func (s *SessionMap) CreateSession(id int64) (newSession *ServerSession, err error)
func (*SessionMap) DeepCopy ¶
func (s *SessionMap) DeepCopy() *SessionMap
func (*SessionMap) GetResponse ¶
func (s *SessionMap) GetResponse(request *pb.SessionHeader) (proto.Message, error)
func (*SessionMap) HasSession ¶
func (s *SessionMap) HasSession(id int64) bool
func (*SessionMap) HaveProcessed ¶
func (s *SessionMap) HaveProcessed(request pb.SessionHeader) bool
func (*SessionMap) IsDuplicate ¶
func (s *SessionMap) IsDuplicate(request *pb.SessionHeader) bool
func (*SessionMap) Lock ¶
func (s *SessionMap) Lock()
func (*SessionMap) Merge ¶
func (s *SessionMap) Merge(from map[int64]*pb.ServerSession)
func (*SessionMap) ProtoMessage ¶
func (s *SessionMap) ProtoMessage() map[int64]*pb.ServerSession
func (*SessionMap) ResetLock ¶
func (s *SessionMap) ResetLock()
ResetLock Calling after decoding to reset a Mutex/ Should be called before any other methods
func (*SessionMap) SetResponse ¶
func (s *SessionMap) SetResponse(request *pb.SessionHeader, resp proto.Message) error
func (*SessionMap) SetSession ¶
func (s *SessionMap) SetSession(id int64, session *ServerSession)
func (*SessionMap) Unlock ¶
func (s *SessionMap) Unlock()
Click to show internal directories.
Click to hide internal directories.