mpc

package
v0.0.0-...-d3facc5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package mpc contains the type sent thrugh the write

Both the entire message and error are transmitted as a tupple for speed interoperating services beware

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(i interface{}, ret interface{}) error

Unmarshal is a helper function used in all the other packages, it unmarshals msgp.Raw messages into types, the type (argument ret) MUST implement the msgp.Unmarshaler interface

Types

type Error

type Error struct {
	Msg string `msg:"msg"`
}

Error is equivalent to birpc.Error, recreated here for MessagePack en/decoding

func (*Error) DecodeMsg

func (z *Error) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Error) EncodeMsg

func (z Error) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Error) MarshalMsg

func (z Error) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Error) Msgsize

func (z Error) Msgsize() (s int)

func (*Error) UnmarshalMsg

func (z *Error) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Message

type Message struct {
	ID     uint64   `msg:"id"`
	Func   string   `msg:"fn"`
	Args   msgp.Raw `msg:"args"`
	Result msgp.Raw `msg:"result"`
	Error  *Error   `msg:"error"`
}

Message is the equivalent of birpc.Message recreated here for MessagePack en/decoding

func (*Message) DecodeMsg

func (z *Message) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Message) EncodeMsg

func (z *Message) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Message) MarshalMsg

func (z *Message) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Message) Msgsize

func (z *Message) Msgsize() (s int)

func (*Message) UnmarshalMsg

func (z *Message) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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