muxrpc

package module
v0.0.0-...-6c1d445 Latest Latest
Warning

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

Go to latest
Published: May 3, 2017 License: GPL-3.0 Imports: 7 Imported by: 12

Documentation

Overview

muxrpc document

muxrpc project muxrpc.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	Done chan struct{}
	// contains filtered or unexported fields
}

func New

func New(c io.ReadWriteCloser, handlers map[string]func(conn *Conn, req int32, args json.RawMessage)) *Conn

func (*Conn) Call

func (mx *Conn) Call(method string, reply interface{}, args ...interface{}) error

func (*Conn) DeregisterReturn

func (mx *Conn) DeregisterReturn(req int32)

func (*Conn) Handle

func (mx *Conn) Handle() error

func (*Conn) RegisterReturn

func (mx *Conn) RegisterReturn(req int32, h func(*codec.Packet))

func (*Conn) Send

func (mx *Conn) Send(p *codec.Packet) error

func (*Conn) Source

func (mx *Conn) Source(method string, reply func(p *codec.Packet), args ...interface{}) error

type Request

type Request struct {
	Name []string      `json:"name"`
	Args []interface{} `json:"args"`
	Type string        `json:"type,omitempty"`
}

Directories

Path Synopsis
Package codec implements readers and writers for https://github.com/dominictarr/packet-stream-codec Packet structure: ( [flags (1byte), length (4 bytes, UInt32BE), req (4 bytes, Int32BE)] # Header [body (length bytes)] ) * [zeros (9 bytes)] Flags: [ignored (4 bits), stream (1 bit), end/err (1 bit), type (2 bits)] type = {0 => Buffer, 1 => String, 2 => JSON} # PacketType
Package codec implements readers and writers for https://github.com/dominictarr/packet-stream-codec Packet structure: ( [flags (1byte), length (4 bytes, UInt32BE), req (4 bytes, Int32BE)] # Header [body (length bytes)] ) * [zeros (9 bytes)] Flags: [ignored (4 bits), stream (1 bit), end/err (1 bit), type (2 bits)] type = {0 => Buffer, 1 => String, 2 => JSON} # PacketType

Jump to

Keyboard shortcuts

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