protocol

package
v1.20.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MPL-2.0 Imports: 6 Imported by: 7

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"}
	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) MarshalXDR

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

func (ConnectRequest) MarshalXDRInto added in v0.13.0

func (o ConnectRequest) MarshalXDRInto(m *xdr.Marshaller) error

func (ConnectRequest) MustMarshalXDR

func (o ConnectRequest) MustMarshalXDR() []byte

func (*ConnectRequest) UnmarshalXDR

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

func (*ConnectRequest) UnmarshalXDRFrom added in v0.13.0

func (o *ConnectRequest) UnmarshalXDRFrom(u *xdr.Unmarshaller) error

func (ConnectRequest) XDRSize added in v0.13.0

func (o ConnectRequest) XDRSize() int

type JoinRelayRequest

type JoinRelayRequest struct{}

func (JoinRelayRequest) MarshalXDR

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

func (JoinRelayRequest) MarshalXDRInto added in v0.13.0

func (o JoinRelayRequest) MarshalXDRInto(m *xdr.Marshaller) error

func (JoinRelayRequest) MustMarshalXDR

func (o JoinRelayRequest) MustMarshalXDR() []byte

func (*JoinRelayRequest) UnmarshalXDR

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

func (*JoinRelayRequest) UnmarshalXDRFrom added in v0.13.0

func (o *JoinRelayRequest) UnmarshalXDRFrom(u *xdr.Unmarshaller) error

func (JoinRelayRequest) XDRSize added in v0.13.0

func (o JoinRelayRequest) XDRSize() int

type JoinSessionRequest

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

func (JoinSessionRequest) MarshalXDR

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

func (JoinSessionRequest) MarshalXDRInto added in v0.13.0

func (o JoinSessionRequest) MarshalXDRInto(m *xdr.Marshaller) error

func (JoinSessionRequest) MustMarshalXDR

func (o JoinSessionRequest) MustMarshalXDR() []byte

func (*JoinSessionRequest) UnmarshalXDR

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

func (*JoinSessionRequest) UnmarshalXDRFrom added in v0.13.0

func (o *JoinSessionRequest) UnmarshalXDRFrom(u *xdr.Unmarshaller) error

func (JoinSessionRequest) XDRSize added in v0.13.0

func (o JoinSessionRequest) XDRSize() int

type Ping

type Ping struct{}

func (Ping) MarshalXDR

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

func (Ping) MarshalXDRInto added in v0.13.0

func (o Ping) MarshalXDRInto(m *xdr.Marshaller) error

func (Ping) MustMarshalXDR

func (o Ping) MustMarshalXDR() []byte

func (*Ping) UnmarshalXDR

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

func (*Ping) UnmarshalXDRFrom added in v0.13.0

func (o *Ping) UnmarshalXDRFrom(u *xdr.Unmarshaller) error

func (Ping) XDRSize added in v0.13.0

func (o Ping) XDRSize() int

type Pong

type Pong struct{}

func (Pong) MarshalXDR

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

func (Pong) MarshalXDRInto added in v0.13.0

func (o Pong) MarshalXDRInto(m *xdr.Marshaller) error

func (Pong) MustMarshalXDR

func (o Pong) MustMarshalXDR() []byte

func (*Pong) UnmarshalXDR

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

func (*Pong) UnmarshalXDRFrom added in v0.13.0

func (o *Pong) UnmarshalXDRFrom(u *xdr.Unmarshaller) error

func (Pong) XDRSize added in v0.13.0

func (o Pong) XDRSize() int

type RelayFull added in v0.12.4

type RelayFull struct{}

func (RelayFull) MarshalXDR added in v0.12.4

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

func (RelayFull) MarshalXDRInto added in v0.13.0

func (o RelayFull) MarshalXDRInto(m *xdr.Marshaller) 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

func (*RelayFull) UnmarshalXDRFrom added in v0.13.0

func (o *RelayFull) UnmarshalXDRFrom(u *xdr.Unmarshaller) error

func (RelayFull) XDRSize added in v0.13.0

func (o RelayFull) XDRSize() int

type Response

type Response struct {
	Code    int32
	Message string
}

func (Response) MarshalXDR

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

func (Response) MarshalXDRInto added in v0.13.0

func (o Response) MarshalXDRInto(m *xdr.Marshaller) error

func (Response) MustMarshalXDR

func (o Response) MustMarshalXDR() []byte

func (*Response) UnmarshalXDR

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

func (*Response) UnmarshalXDRFrom added in v0.13.0

func (o *Response) UnmarshalXDRFrom(u *xdr.Unmarshaller) error

func (Response) XDRSize added in v0.13.0

func (o Response) XDRSize() int

type SessionInvitation

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

func (SessionInvitation) GoString

func (i SessionInvitation) GoString() string

func (SessionInvitation) MarshalXDR

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

func (SessionInvitation) MarshalXDRInto added in v0.13.0

func (o SessionInvitation) MarshalXDRInto(m *xdr.Marshaller) 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

func (*SessionInvitation) UnmarshalXDRFrom added in v0.13.0

func (o *SessionInvitation) UnmarshalXDRFrom(u *xdr.Unmarshaller) error

func (SessionInvitation) XDRSize added in v0.13.0

func (o SessionInvitation) XDRSize() int

Jump to

Keyboard shortcuts

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