session

package
v2.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Session) GetAddrStr

func (s *Session) GetAddrStr() *string

func (*Session) GetID

func (s *Session) GetID() []byte

func (*Session) GetLastReadTime

func (s *Session) GetLastReadTime() time.Time

func (*Session) GetPubKey

func (s *Session) GetPubKey() []byte

func (*Session) GetSessionId

func (s *Session) GetSessionId() string

func (*Session) IsClient

func (s *Session) IsClient() bool

func (*Session) IsTlsClient

func (s *Session) IsTlsClient() bool

func (*Session) Ping

func (s *Session) Ping() error

func (*Session) Send

func (s *Session) Send(msgType int, data []byte) error

func (*Session) SendBinary

func (s *Session) SendBinary(data []byte) error

func (*Session) SendText

func (s *Session) SendText(data []byte) error

func (*Session) SetClient

func (s *Session) SetClient(chordID, pubKey []byte, addrStr *string, isTls bool)

func (*Session) SetSessionId

func (s *Session) SetSessionId(sessionId string)

func (*Session) UpdateLastReadTime

func (s *Session) UpdateLastReadTime()

type SessionList

type SessionList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSessionList

func NewSessionList() *SessionList

func (*SessionList) ChangeSessionToClient

func (sl *SessionList) ChangeSessionToClient(sessionId, clientId string) (*Session, error)

func (*SessionList) CloseSession

func (sl *SessionList) CloseSession(session *Session) error

func (*SessionList) ForEachClient

func (sl *SessionList) ForEachClient(visit func(*Session))

func (*SessionList) ForEachSession

func (sl *SessionList) ForEachSession(visit func(*Session))

func (*SessionList) GetSessionCount

func (sl *SessionList) GetSessionCount() int

func (*SessionList) GetSessionsById

func (sl *SessionList) GetSessionsById(sSessionId string) []*Session

func (*SessionList) NewSession

func (sl *SessionList) NewSession(wsConn *websocket.Conn) (*Session, error)

Jump to

Keyboard shortcuts

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