user

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(userId string, http *HttpConn)

func CallDealRequest

func CallDealRequest(w http.ResponseWriter, r *http.Request) (bool, net.Conn, string)

func CallNewConn

func CallNewConn(user HttpUser) bool

func DeleteUser

func DeleteUser(userId string, http *HttpConn)

func GetMessageCache

func GetMessageCache(userId string) []*message.Message

func IsMessgeCache

func IsMessgeCache(userId string, message *message.Message) bool

Types

type CallDealRequestFunc

type CallDealRequestFunc func(http.ResponseWriter, *http.Request) (bool, net.Conn, string)

type CallNewConnFunc

type CallNewConnFunc func(HttpUser) bool

type HttpConn

type HttpConn struct {
	*user.UserLite

	Deadline      int
	HttpConnWrite HttpConnWriteFunc
	HttpConnFlush HttpConnFlushFunc
	// contains filtered or unexported fields
}

func (*HttpConn) Add

func (hc *HttpConn) Add()

func (*HttpConn) Close

func (hc *HttpConn) Close(userId string) error

func (*HttpConn) Flush

func (hc *HttpConn) Flush()

func (*HttpConn) IsBreak

func (hc *HttpConn) IsBreak() bool

func (*HttpConn) IsTimeOut

func (hc *HttpConn) IsTimeOut() bool

func (*HttpConn) SendMessage

func (hc *HttpConn) SendMessage(msg *message.Message) (int, error)

func (*HttpConn) SendMessages

func (hc *HttpConn) SendMessages(msgs []*message.Message) (int, error)

type HttpConnFlushFunc

type HttpConnFlushFunc func()

type HttpConnWriteFunc

type HttpConnWriteFunc func(data []byte) (int, error)

type HttpUser

type HttpUser interface {
	Flush()
	SendMessages([]*message.Message) (int, error)
	GetUserId() string
	Start(int, int, string, CallNewConnFunc)
	IsBreak() bool
}

Jump to

Keyboard shortcuts

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