session

package
v0.0.0-...-e58dc6b Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_SESSION_COUNT = 3000
View Source
const SESSION_TIMEOUT int64 = 300

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	sync.Mutex

	TxHashArr []TxHashInfo
	// contains filtered or unexported fields
}

func (*Session) AppendTxHash

func (self *Session) AppendTxHash(txhash string)

func (*Session) Close

func (self *Session) Close()

func (*Session) GetSessionId

func (self *Session) GetSessionId() string

func (*Session) RemoveTimeoverTxHashes

func (self *Session) RemoveTimeoverTxHashes() (remove []TxHashInfo)

func (*Session) Send

func (self *Session) Send(data []byte) error

func (*Session) SessionTimeoverCheck

func (self *Session) SessionTimeoverCheck() bool

func (*Session) UpdateActiveTime

func (self *Session) UpdateActiveTime()

type SessionList

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

func NewSessionList

func NewSessionList() *SessionList

func (*SessionList) CloseSession

func (self *SessionList) CloseSession(session *Session)

func (*SessionList) ForEachSession

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

func (*SessionList) GetSessionById

func (self *SessionList) GetSessionById(sessionId string) *Session

func (*SessionList) GetSessionCount

func (self *SessionList) GetSessionCount() int

func (*SessionList) NewSession

func (self *SessionList) NewSession(wsConn *websocket.Conn) (session *Session, err error)

type TxHashInfo

type TxHashInfo struct {
	TxHash    string
	StartTime int64
}

Jump to

Keyboard shortcuts

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