util

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMsgSendFuncNotSet = errors.New("message send func not set")

Functions

func ConvertTLSConfigToDTLSConfig

func ConvertTLSConfigToDTLSConfig(tlsConfig *tls.Config) *dtls.Config

func GetBytesBuf added in v0.3.0

func GetBytesBuf(size int) []byte

func GetMsgType added in v0.3.0

func GetMsgType(m interface{}) arhatgopb.MsgType

func NewCmd added in v0.3.0

func NewCmd(
	marshal types.MarshalFunc,
	kind arhatgopb.CmdType,
	id, seq uint64, body interface{},
) (*arhatgopb.Cmd, error)

func NewMsg added in v0.3.0

func NewMsg(
	marshal types.MarshalFunc,
	kind arhatgopb.MsgType,
	id, ack uint64, body interface{},
) (*arhatgopb.Msg, error)

func PutBytesBuf added in v0.3.0

func PutBytesBuf(b *[]byte)

Types

type BaseHandler added in v0.4.0

type BaseHandler struct {
	// contains filtered or unexported fields
}

func NewBaseHandler added in v0.4.0

func NewBaseHandler(mu *sync.RWMutex) *BaseHandler

func (*BaseHandler) SendMsg added in v0.4.0

func (h *BaseHandler) SendMsg(msg *arhatgopb.Msg) error

func (*BaseHandler) SetMsgSendFunc added in v0.4.0

func (h *BaseHandler) SetMsgSendFunc(sendMsg types.MsgSendFunc)

type StreamManager added in v0.4.0

type StreamManager struct {
	// contains filtered or unexported fields
}

func NewStreamManager added in v0.4.0

func NewStreamManager() *StreamManager

func (*StreamManager) Add added in v0.4.0

func (m *StreamManager) Add(sid uint64, create func() (io.WriteCloser, types.ResizeHandleFunc, error)) error

func (*StreamManager) Del added in v0.4.0

func (m *StreamManager) Del(sid uint64)

func (*StreamManager) Resize added in v0.4.0

func (m *StreamManager) Resize(sid uint64, cols, rows uint32)

func (*StreamManager) Write added in v0.4.0

func (m *StreamManager) Write(sid, seq uint64, data []byte)

Jump to

Keyboard shortcuts

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