protocol

package
v0.0.0-...-129a086 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT 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"}
	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

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

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

func (ConnectRequest) XDRSize

func (o ConnectRequest) XDRSize() int

type JoinRelayRequest

type JoinRelayRequest struct{}

func (JoinRelayRequest) MarshalXDR

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

func (JoinRelayRequest) MarshalXDRInto

func (JoinRelayRequest) MarshalXDRInto(_ *xdr.Marshaller) error

func (JoinRelayRequest) MustMarshalXDR

func (JoinRelayRequest) MustMarshalXDR() []byte

func (*JoinRelayRequest) UnmarshalXDR

func (*JoinRelayRequest) UnmarshalXDR(_ []byte) error

func (*JoinRelayRequest) UnmarshalXDRFrom

func (*JoinRelayRequest) UnmarshalXDRFrom(_ *xdr.Unmarshaller) error

func (JoinRelayRequest) XDRSize

func (JoinRelayRequest) XDRSize() int

type JoinSessionRequest

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

func (JoinSessionRequest) MarshalXDR

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

func (JoinSessionRequest) MarshalXDRInto

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

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

func (JoinSessionRequest) XDRSize

func (o JoinSessionRequest) XDRSize() int

type Ping

type Ping struct{}

func (Ping) MarshalXDR

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

func (Ping) MarshalXDRInto

func (Ping) MarshalXDRInto(_ *xdr.Marshaller) error

func (Ping) MustMarshalXDR

func (Ping) MustMarshalXDR() []byte

func (*Ping) UnmarshalXDR

func (*Ping) UnmarshalXDR(_ []byte) error

func (*Ping) UnmarshalXDRFrom

func (*Ping) UnmarshalXDRFrom(_ *xdr.Unmarshaller) error

func (Ping) XDRSize

func (Ping) XDRSize() int

type Pong

type Pong struct{}

func (Pong) MarshalXDR

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

func (Pong) MarshalXDRInto

func (Pong) MarshalXDRInto(_ *xdr.Marshaller) error

func (Pong) MustMarshalXDR

func (Pong) MustMarshalXDR() []byte

func (*Pong) UnmarshalXDR

func (*Pong) UnmarshalXDR(_ []byte) error

func (*Pong) UnmarshalXDRFrom

func (*Pong) UnmarshalXDRFrom(_ *xdr.Unmarshaller) error

func (Pong) XDRSize

func (Pong) XDRSize() int

type RelayFull

type RelayFull struct{}

func (RelayFull) MarshalXDR

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

func (RelayFull) MarshalXDRInto

func (RelayFull) MarshalXDRInto(_ *xdr.Marshaller) error

func (RelayFull) MustMarshalXDR

func (RelayFull) MustMarshalXDR() []byte

func (*RelayFull) UnmarshalXDR

func (*RelayFull) UnmarshalXDR(_ []byte) error

func (*RelayFull) UnmarshalXDRFrom

func (*RelayFull) UnmarshalXDRFrom(_ *xdr.Unmarshaller) error

func (RelayFull) XDRSize

func (RelayFull) XDRSize() int

type Response

type Response struct {
	Code    int32
	Message string
}

func (Response) MarshalXDR

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

func (Response) MarshalXDRInto

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

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

func (Response) XDRSize

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

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

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

func (SessionInvitation) XDRSize

func (o SessionInvitation) XDRSize() int

Jump to

Keyboard shortcuts

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