session

package module
v0.0.0-...-0e97469 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2022 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

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 Response

type Response any

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()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL