protocol

package
v0.12.17 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2016 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolName = "bep-relay"
)

Variables

View Source
var (
	ResponseSuccess           = Response{0, "success"}
	ResponseNotFound          = Response{1, "not found"}
	ResponseAlreadyConnected  = Response{2, "already connected"}
	ResponseInternalError     = Response{99, "internal error"}
	ResponseUnexpectedMessage = Response{100, "unexpected message"}
)

Functions

func ReadMessage

func ReadMessage(r io.Reader) (interface{}, error)

func WriteMessage

func WriteMessage(w io.Writer, message interface{}) error

Types

type ConnectRequest

type ConnectRequest struct {
	ID []byte // max:32
}

func (ConnectRequest) AppendXDR

func (o ConnectRequest) AppendXDR(bs []byte) ([]byte, error)

func (*ConnectRequest) DecodeXDR

func (o *ConnectRequest) DecodeXDR(r io.Reader) error

func (*ConnectRequest) DecodeXDRFrom

func (o *ConnectRequest) DecodeXDRFrom(xr *xdr.Reader) error

func (ConnectRequest) EncodeXDR

func (o ConnectRequest) EncodeXDR(w io.Writer) (int, error)

func (ConnectRequest) EncodeXDRInto

func (o ConnectRequest) EncodeXDRInto(xw *xdr.Writer) (int, error)

func (ConnectRequest) MarshalXDR

func (o ConnectRequest) MarshalXDR() ([]byte, error)

func (ConnectRequest) MustMarshalXDR

func (o ConnectRequest) MustMarshalXDR() []byte

func (*ConnectRequest) UnmarshalXDR

func (o *ConnectRequest) UnmarshalXDR(bs []byte) error

type JoinRelayRequest

type JoinRelayRequest struct{}

func (JoinRelayRequest) AppendXDR

func (o JoinRelayRequest) AppendXDR(bs []byte) ([]byte, error)

func (*JoinRelayRequest) DecodeXDR

func (o *JoinRelayRequest) DecodeXDR(r io.Reader) error

func (*JoinRelayRequest) DecodeXDRFrom

func (o *JoinRelayRequest) DecodeXDRFrom(xr *xdr.Reader) error

func (JoinRelayRequest) EncodeXDR

func (o JoinRelayRequest) EncodeXDR(w io.Writer) (int, error)

func (JoinRelayRequest) EncodeXDRInto

func (o JoinRelayRequest) EncodeXDRInto(xw *xdr.Writer) (int, error)

func (JoinRelayRequest) MarshalXDR

func (o JoinRelayRequest) MarshalXDR() ([]byte, error)

func (JoinRelayRequest) MustMarshalXDR

func (o JoinRelayRequest) MustMarshalXDR() []byte

func (*JoinRelayRequest) UnmarshalXDR

func (o *JoinRelayRequest) UnmarshalXDR(bs []byte) error

type JoinSessionRequest

type JoinSessionRequest struct {
	Key []byte // max:32
}

func (JoinSessionRequest) AppendXDR

func (o JoinSessionRequest) AppendXDR(bs []byte) ([]byte, error)

func (*JoinSessionRequest) DecodeXDR

func (o *JoinSessionRequest) DecodeXDR(r io.Reader) error

func (*JoinSessionRequest) DecodeXDRFrom

func (o *JoinSessionRequest) DecodeXDRFrom(xr *xdr.Reader) error

func (JoinSessionRequest) EncodeXDR

func (o JoinSessionRequest) EncodeXDR(w io.Writer) (int, error)

func (JoinSessionRequest) EncodeXDRInto

func (o JoinSessionRequest) EncodeXDRInto(xw *xdr.Writer) (int, error)

func (JoinSessionRequest) MarshalXDR

func (o JoinSessionRequest) MarshalXDR() ([]byte, error)

func (JoinSessionRequest) MustMarshalXDR

func (o JoinSessionRequest) MustMarshalXDR() []byte

func (*JoinSessionRequest) UnmarshalXDR

func (o *JoinSessionRequest) UnmarshalXDR(bs []byte) error

type Ping

type Ping struct{}

func (Ping) AppendXDR

func (o Ping) AppendXDR(bs []byte) ([]byte, error)

func (*Ping) DecodeXDR

func (o *Ping) DecodeXDR(r io.Reader) error

func (*Ping) DecodeXDRFrom

func (o *Ping) DecodeXDRFrom(xr *xdr.Reader) error

func (Ping) EncodeXDR

func (o Ping) EncodeXDR(w io.Writer) (int, error)

func (Ping) EncodeXDRInto

func (o Ping) EncodeXDRInto(xw *xdr.Writer) (int, error)

func (Ping) MarshalXDR

func (o Ping) MarshalXDR() ([]byte, error)

func (Ping) MustMarshalXDR

func (o Ping) MustMarshalXDR() []byte

func (*Ping) UnmarshalXDR

func (o *Ping) UnmarshalXDR(bs []byte) error

type Pong

type Pong struct{}

func (Pong) AppendXDR

func (o Pong) AppendXDR(bs []byte) ([]byte, error)

func (*Pong) DecodeXDR

func (o *Pong) DecodeXDR(r io.Reader) error

func (*Pong) DecodeXDRFrom

func (o *Pong) DecodeXDRFrom(xr *xdr.Reader) error

func (Pong) EncodeXDR

func (o Pong) EncodeXDR(w io.Writer) (int, error)

func (Pong) EncodeXDRInto

func (o Pong) EncodeXDRInto(xw *xdr.Writer) (int, error)

func (Pong) MarshalXDR

func (o Pong) MarshalXDR() ([]byte, error)

func (Pong) MustMarshalXDR

func (o Pong) MustMarshalXDR() []byte

func (*Pong) UnmarshalXDR

func (o *Pong) UnmarshalXDR(bs []byte) error

type RelayFull added in v0.12.4

type RelayFull struct{}

func (RelayFull) AppendXDR added in v0.12.4

func (o RelayFull) AppendXDR(bs []byte) ([]byte, error)

func (*RelayFull) DecodeXDR added in v0.12.4

func (o *RelayFull) DecodeXDR(r io.Reader) error

func (*RelayFull) DecodeXDRFrom added in v0.12.4

func (o *RelayFull) DecodeXDRFrom(xr *xdr.Reader) error

func (RelayFull) EncodeXDR added in v0.12.4

func (o RelayFull) EncodeXDR(w io.Writer) (int, error)

func (RelayFull) EncodeXDRInto added in v0.12.4

func (o RelayFull) EncodeXDRInto(xw *xdr.Writer) (int, error)

func (RelayFull) MarshalXDR added in v0.12.4

func (o RelayFull) MarshalXDR() ([]byte, error)

func (RelayFull) MustMarshalXDR added in v0.12.4

func (o RelayFull) MustMarshalXDR() []byte

func (*RelayFull) UnmarshalXDR added in v0.12.4

func (o *RelayFull) UnmarshalXDR(bs []byte) error

type Response

type Response struct {
	Code    int32
	Message string
}

func (Response) AppendXDR

func (o Response) AppendXDR(bs []byte) ([]byte, error)

func (*Response) DecodeXDR

func (o *Response) DecodeXDR(r io.Reader) error

func (*Response) DecodeXDRFrom

func (o *Response) DecodeXDRFrom(xr *xdr.Reader) error

func (Response) EncodeXDR

func (o Response) EncodeXDR(w io.Writer) (int, error)

func (Response) EncodeXDRInto

func (o Response) EncodeXDRInto(xw *xdr.Writer) (int, error)

func (Response) MarshalXDR

func (o Response) MarshalXDR() ([]byte, error)

func (Response) MustMarshalXDR

func (o Response) MustMarshalXDR() []byte

func (*Response) UnmarshalXDR

func (o *Response) UnmarshalXDR(bs []byte) error

type SessionInvitation

type SessionInvitation struct {
	From         []byte // max:32
	Key          []byte // max:32
	Address      []byte // max:32
	Port         uint16
	ServerSocket bool
}

func (SessionInvitation) AddressString

func (i SessionInvitation) AddressString() string

func (SessionInvitation) AppendXDR

func (o SessionInvitation) AppendXDR(bs []byte) ([]byte, error)

func (*SessionInvitation) DecodeXDR

func (o *SessionInvitation) DecodeXDR(r io.Reader) error

func (*SessionInvitation) DecodeXDRFrom

func (o *SessionInvitation) DecodeXDRFrom(xr *xdr.Reader) error

func (SessionInvitation) EncodeXDR

func (o SessionInvitation) EncodeXDR(w io.Writer) (int, error)

func (SessionInvitation) EncodeXDRInto

func (o SessionInvitation) EncodeXDRInto(xw *xdr.Writer) (int, error)

func (SessionInvitation) GoString

func (i SessionInvitation) GoString() string

func (SessionInvitation) MarshalXDR

func (o SessionInvitation) MarshalXDR() ([]byte, error)

func (SessionInvitation) MustMarshalXDR

func (o SessionInvitation) MustMarshalXDR() []byte

func (SessionInvitation) String

func (i SessionInvitation) String() string

func (*SessionInvitation) UnmarshalXDR

func (o *SessionInvitation) UnmarshalXDR(bs []byte) error

Jump to

Keyboard shortcuts

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