ws_rpc

package
v2.0.0-...-ee8edaa Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCallMessage

func NewCallMessage(conn Conn) *message

func NewMessage

func NewMessage(data []byte, conn Conn) *message

Types

type CallHandler

type CallHandler interface {
	Call(tp string, args Map) (result []byte, err error)
	HasRead()
	SetMsg(msg *CallMsg)
}

type CallMsg

type CallMsg struct {
	RequestID string

	Args   Map
	Result jsoniter.RawMessage
}

func ValidCallMsg

func ValidCallMsg(data []byte) (msg *CallMsg, ok bool)

type Conn

type Conn interface {
	SendMessage(tp string, data interface{}) (err error)
	AddCallHandler(rid string, handler CallHandler)
	RemoveHandler(rid string)
}

type Map

type Map map[string]interface{}

Jump to

Keyboard shortcuts

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