signaling_rpc

package
v0.30.6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SRPCSignalingServiceID = "signaling.rpc.Signaling"

Variables

View Source
var (
	ErrUserpedSession       = errors.New("signaling: session can only be called once per peer")
	ErrUserpedListen        = errors.New("signaling: listen can only be called once per peer")
	ErrUnexpectedSessionMsg = errors.New("signaling: unexpected session message")
)
View Source
var ProtocolID = protocol.ID("bifrost/signaling")

ProtocolID is the default protocol ID for the signaling server.

Functions

func NewSRPCSignalingHandler

func NewSRPCSignalingHandler(impl SRPCSignalingServer, serviceID string) srpc.Handler

NewSRPCSignalingHandler constructs a new RPC handler. serviceID: if empty, uses default: signaling.rpc.Signaling

func SRPCRegisterSignaling

func SRPCRegisterSignaling(mux srpc.Mux, impl SRPCSignalingServer) error

SRPCRegisterSignaling registers the implementation with the mux. Uses the default serviceID: signaling.rpc.Signaling

Types

type ListenRequest

type ListenRequest struct {
	// contains filtered or unexported fields
}

ListenRequest is the body of the Listen request.

func (*ListenRequest) CloneMessageVT

func (m *ListenRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*ListenRequest) CloneVT

func (m *ListenRequest) CloneVT() *ListenRequest

func (*ListenRequest) EqualMessageVT

func (this *ListenRequest) EqualMessageVT(thatMsg any) bool

func (*ListenRequest) EqualVT

func (this *ListenRequest) EqualVT(that *ListenRequest) bool

func (*ListenRequest) MarshalJSON added in v0.29.0

func (x *ListenRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ListenRequest to JSON.

func (*ListenRequest) MarshalProtoJSON added in v0.29.0

func (x *ListenRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ListenRequest message to JSON.

func (*ListenRequest) MarshalProtoText added in v0.29.2

func (x *ListenRequest) MarshalProtoText() string

func (*ListenRequest) MarshalToSizedBufferVT

func (m *ListenRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ListenRequest) MarshalToVT

func (m *ListenRequest) MarshalToVT(dAtA []byte) (int, error)

func (*ListenRequest) MarshalVT

func (m *ListenRequest) MarshalVT() (dAtA []byte, err error)

func (*ListenRequest) ProtoMessage

func (*ListenRequest) ProtoMessage()

func (*ListenRequest) Reset

func (x *ListenRequest) Reset()

func (*ListenRequest) SizeVT

func (m *ListenRequest) SizeVT() (n int)

func (*ListenRequest) String

func (x *ListenRequest) String() string

func (*ListenRequest) UnmarshalJSON added in v0.29.0

func (x *ListenRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ListenRequest from JSON.

func (*ListenRequest) UnmarshalProtoJSON added in v0.29.0

func (x *ListenRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ListenRequest message from JSON.

func (*ListenRequest) UnmarshalVT

func (m *ListenRequest) UnmarshalVT(dAtA []byte) error

func (*ListenRequest) Validate

func (r *ListenRequest) Validate() error

Validate validates the Listen request.

type ListenResponse

type ListenResponse struct {

	// Body is the body of the response.
	//
	// Types that are assignable to Body:
	//
	//	*ListenResponse_SetPeer
	//	*ListenResponse_ClearPeer
	Body isListenResponse_Body `protobuf_oneof:"body"`
	// contains filtered or unexported fields
}

ListenResponse is a message sent in a stream in response to Listen.

func (*ListenResponse) CloneMessageVT

func (m *ListenResponse) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*ListenResponse) CloneVT

func (m *ListenResponse) CloneVT() *ListenResponse

func (*ListenResponse) EqualMessageVT

func (this *ListenResponse) EqualMessageVT(thatMsg any) bool

func (*ListenResponse) EqualVT

func (this *ListenResponse) EqualVT(that *ListenResponse) bool

func (*ListenResponse) GetBody

func (m *ListenResponse) GetBody() isListenResponse_Body

func (*ListenResponse) GetClearPeer

func (x *ListenResponse) GetClearPeer() string

func (*ListenResponse) GetSetPeer

func (x *ListenResponse) GetSetPeer() string

func (*ListenResponse) MarshalJSON added in v0.29.0

func (x *ListenResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ListenResponse to JSON.

func (*ListenResponse) MarshalProtoJSON added in v0.29.0

func (x *ListenResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ListenResponse message to JSON.

func (*ListenResponse) MarshalProtoText added in v0.29.2

func (x *ListenResponse) MarshalProtoText() string

func (*ListenResponse) MarshalToSizedBufferVT

func (m *ListenResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ListenResponse) MarshalToVT

func (m *ListenResponse) MarshalToVT(dAtA []byte) (int, error)

func (*ListenResponse) MarshalVT

func (m *ListenResponse) MarshalVT() (dAtA []byte, err error)

func (*ListenResponse) ProtoMessage

func (*ListenResponse) ProtoMessage()

func (*ListenResponse) Reset

func (x *ListenResponse) Reset()

func (*ListenResponse) SizeVT

func (m *ListenResponse) SizeVT() (n int)

func (*ListenResponse) String

func (x *ListenResponse) String() string

func (*ListenResponse) UnmarshalJSON added in v0.29.0

func (x *ListenResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ListenResponse from JSON.

func (*ListenResponse) UnmarshalProtoJSON added in v0.29.0

func (x *ListenResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ListenResponse message from JSON.

func (*ListenResponse) UnmarshalVT

func (m *ListenResponse) UnmarshalVT(dAtA []byte) error

type ListenResponse_ClearPeer

type ListenResponse_ClearPeer struct {
	// ClearPeer marks that a remote peer no longer wants a session.
	// The contents of the string is the encoded peer id of the remote peer.
	ClearPeer string `protobuf:"bytes,2,opt,name=clear_peer,json=clearPeer,proto3,oneof"`
}

func (*ListenResponse_ClearPeer) CloneVT

func (*ListenResponse_ClearPeer) EqualVT

func (this *ListenResponse_ClearPeer) EqualVT(thatIface isListenResponse_Body) bool

func (*ListenResponse_ClearPeer) MarshalToSizedBufferVT

func (m *ListenResponse_ClearPeer) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ListenResponse_ClearPeer) MarshalToVT

func (m *ListenResponse_ClearPeer) MarshalToVT(dAtA []byte) (int, error)

func (*ListenResponse_ClearPeer) SizeVT

func (m *ListenResponse_ClearPeer) SizeVT() (n int)

type ListenResponse_SetPeer

type ListenResponse_SetPeer struct {
	// SetPeer marks that a remote peer wants a session.
	// The contents of the string is the encoded peer id of the remote peer.
	SetPeer string `protobuf:"bytes,1,opt,name=set_peer,json=setPeer,proto3,oneof"`
}

func (*ListenResponse_SetPeer) CloneVT

func (*ListenResponse_SetPeer) EqualVT

func (this *ListenResponse_SetPeer) EqualVT(thatIface isListenResponse_Body) bool

func (*ListenResponse_SetPeer) MarshalToSizedBufferVT

func (m *ListenResponse_SetPeer) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ListenResponse_SetPeer) MarshalToVT

func (m *ListenResponse_SetPeer) MarshalToVT(dAtA []byte) (int, error)

func (*ListenResponse_SetPeer) SizeVT

func (m *ListenResponse_SetPeer) SizeVT() (n int)

type SRPCSignalingClient

type SRPCSignalingClient interface {
	SRPCClient() srpc.Client

	Listen(ctx context.Context, in *ListenRequest) (SRPCSignaling_ListenClient, error)
	Session(ctx context.Context) (SRPCSignaling_SessionClient, error)
}

func NewSRPCSignalingClient

func NewSRPCSignalingClient(cc srpc.Client) SRPCSignalingClient

func NewSRPCSignalingClientWithServiceID

func NewSRPCSignalingClientWithServiceID(cc srpc.Client, serviceID string) SRPCSignalingClient

type SRPCSignalingHandler

type SRPCSignalingHandler struct {
	// contains filtered or unexported fields
}

func (SRPCSignalingHandler) GetMethodIDs

func (SRPCSignalingHandler) GetMethodIDs() []string

func (*SRPCSignalingHandler) GetServiceID

func (d *SRPCSignalingHandler) GetServiceID() string

func (*SRPCSignalingHandler) InvokeMethod

func (d *SRPCSignalingHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCSignalingHandler) InvokeMethod_Listen

func (SRPCSignalingHandler) InvokeMethod_Listen(impl SRPCSignalingServer, strm srpc.Stream) error

func (SRPCSignalingHandler) InvokeMethod_Session

func (SRPCSignalingHandler) InvokeMethod_Session(impl SRPCSignalingServer, strm srpc.Stream) error

type SRPCSignalingServer

type SRPCSignalingServer interface {
	Listen(*ListenRequest, SRPCSignaling_ListenStream) error
	Session(SRPCSignaling_SessionStream) error
}

type SRPCSignalingUnimplementedServer

type SRPCSignalingUnimplementedServer struct{}

func (*SRPCSignalingUnimplementedServer) Listen

func (*SRPCSignalingUnimplementedServer) Session

type SRPCSignaling_ListenClient

type SRPCSignaling_ListenClient interface {
	srpc.Stream
	Recv() (*ListenResponse, error)
	RecvTo(*ListenResponse) error
}

type SRPCSignaling_ListenStream

type SRPCSignaling_ListenStream interface {
	srpc.Stream
	Send(*ListenResponse) error
	SendAndClose(*ListenResponse) error
}

type SRPCSignaling_SessionClient

type SRPCSignaling_SessionClient interface {
	srpc.Stream
	Send(*SessionRequest) error
	Recv() (*SessionResponse, error)
	RecvTo(*SessionResponse) error
}

type SRPCSignaling_SessionStream

type SRPCSignaling_SessionStream interface {
	srpc.Stream
	Send(*SessionResponse) error
	SendAndClose(*SessionResponse) error
	Recv() (*SessionRequest, error)
	RecvTo(*SessionRequest) error
}

type SessionInit

type SessionInit struct {

	// PeerId is the remote peer id we want to contact.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// contains filtered or unexported fields
}

SessionInit is a message to init a Session.

func (*SessionInit) CloneMessageVT

func (m *SessionInit) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SessionInit) CloneVT

func (m *SessionInit) CloneVT() *SessionInit

func (*SessionInit) EqualMessageVT

func (this *SessionInit) EqualMessageVT(thatMsg any) bool

func (*SessionInit) EqualVT

func (this *SessionInit) EqualVT(that *SessionInit) bool

func (*SessionInit) GetPeerId

func (x *SessionInit) GetPeerId() string

func (*SessionInit) MarshalJSON added in v0.29.0

func (x *SessionInit) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SessionInit to JSON.

func (*SessionInit) MarshalProtoJSON added in v0.29.0

func (x *SessionInit) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SessionInit message to JSON.

func (*SessionInit) MarshalProtoText added in v0.29.2

func (x *SessionInit) MarshalProtoText() string

func (*SessionInit) MarshalToSizedBufferVT

func (m *SessionInit) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionInit) MarshalToVT

func (m *SessionInit) MarshalToVT(dAtA []byte) (int, error)

func (*SessionInit) MarshalVT

func (m *SessionInit) MarshalVT() (dAtA []byte, err error)

func (*SessionInit) ParsePeerID

func (s *SessionInit) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SessionInit) ProtoMessage

func (*SessionInit) ProtoMessage()

func (*SessionInit) Reset

func (x *SessionInit) Reset()

func (*SessionInit) SizeVT

func (m *SessionInit) SizeVT() (n int)

func (*SessionInit) String

func (x *SessionInit) String() string

func (*SessionInit) UnmarshalJSON added in v0.29.0

func (x *SessionInit) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SessionInit from JSON.

func (*SessionInit) UnmarshalProtoJSON added in v0.29.0

func (x *SessionInit) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SessionInit message from JSON.

func (*SessionInit) UnmarshalVT

func (m *SessionInit) UnmarshalVT(dAtA []byte) error

func (*SessionInit) Validate

func (i *SessionInit) Validate() error

Validate validates the SessionInit.

type SessionMsg

type SessionMsg struct {

	// SignedMsg is the signed message body.
	SignedMsg *peer.SignedMsg `protobuf:"bytes,1,opt,name=signed_msg,json=signedMsg,proto3" json:"signedMsg,omitempty"`
	// Seqno is the message sequence number for clear and ack.
	Seqno uint64 `protobuf:"varint,2,opt,name=seqno,proto3" json:"seqno,omitempty"`
	// contains filtered or unexported fields
}

SessionMsg contains a signed message and a sequence number.

func (*SessionMsg) CloneMessageVT

func (m *SessionMsg) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SessionMsg) CloneVT

func (m *SessionMsg) CloneVT() *SessionMsg

func (*SessionMsg) EqualMessageVT

func (this *SessionMsg) EqualMessageVT(thatMsg any) bool

func (*SessionMsg) EqualVT

func (this *SessionMsg) EqualVT(that *SessionMsg) bool

func (*SessionMsg) GetSeqno

func (x *SessionMsg) GetSeqno() uint64

func (*SessionMsg) GetSignedMsg

func (x *SessionMsg) GetSignedMsg() *peer.SignedMsg

func (*SessionMsg) MarshalJSON added in v0.29.0

func (x *SessionMsg) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SessionMsg to JSON.

func (*SessionMsg) MarshalProtoJSON added in v0.29.0

func (x *SessionMsg) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SessionMsg message to JSON.

func (*SessionMsg) MarshalProtoText added in v0.29.2

func (x *SessionMsg) MarshalProtoText() string

func (*SessionMsg) MarshalToSizedBufferVT

func (m *SessionMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionMsg) MarshalToVT

func (m *SessionMsg) MarshalToVT(dAtA []byte) (int, error)

func (*SessionMsg) MarshalVT

func (m *SessionMsg) MarshalVT() (dAtA []byte, err error)

func (*SessionMsg) ProtoMessage

func (*SessionMsg) ProtoMessage()

func (*SessionMsg) Reset

func (x *SessionMsg) Reset()

func (*SessionMsg) SizeVT

func (m *SessionMsg) SizeVT() (n int)

func (*SessionMsg) String

func (x *SessionMsg) String() string

func (*SessionMsg) UnmarshalJSON added in v0.29.0

func (x *SessionMsg) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SessionMsg from JSON.

func (*SessionMsg) UnmarshalProtoJSON added in v0.29.0

func (x *SessionMsg) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SessionMsg message from JSON.

func (*SessionMsg) UnmarshalVT

func (m *SessionMsg) UnmarshalVT(dAtA []byte) error

func (*SessionMsg) Validate

func (m *SessionMsg) Validate() error

Validate validates the SessionMsg.

type SessionRequest

type SessionRequest struct {

	// SessionSeqno is the session sequence number.
	// If this doesn't match the current session no, this pkt will be dropped.
	// This should be zero for the init packet.
	SessionSeqno uint64 `protobuf:"varint,1,opt,name=session_seqno,json=sessionSeqno,proto3" json:"sessionSeqno,omitempty"`
	// Body is the body of the request.
	//
	// Types that are assignable to Body:
	//
	//	*SessionRequest_Init
	//	*SessionRequest_SendMsg
	//	*SessionRequest_ClearMsg
	//	*SessionRequest_AckMsg
	Body isSessionRequest_Body `protobuf_oneof:"body"`
	// contains filtered or unexported fields
}

SessionRequest is a message sent from the client to the server.

func (*SessionRequest) CloneMessageVT

func (m *SessionRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SessionRequest) CloneVT

func (m *SessionRequest) CloneVT() *SessionRequest

func (*SessionRequest) EqualMessageVT

func (this *SessionRequest) EqualMessageVT(thatMsg any) bool

func (*SessionRequest) EqualVT

func (this *SessionRequest) EqualVT(that *SessionRequest) bool

func (*SessionRequest) GetAckMsg

func (x *SessionRequest) GetAckMsg() uint64

func (*SessionRequest) GetBody

func (m *SessionRequest) GetBody() isSessionRequest_Body

func (*SessionRequest) GetClearMsg

func (x *SessionRequest) GetClearMsg() uint64

func (*SessionRequest) GetInit

func (x *SessionRequest) GetInit() *SessionInit

func (*SessionRequest) GetSendMsg

func (x *SessionRequest) GetSendMsg() *SessionMsg

func (*SessionRequest) GetSessionSeqno

func (x *SessionRequest) GetSessionSeqno() uint64

func (*SessionRequest) MarshalJSON added in v0.29.0

func (x *SessionRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SessionRequest to JSON.

func (*SessionRequest) MarshalProtoJSON added in v0.29.0

func (x *SessionRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SessionRequest message to JSON.

func (*SessionRequest) MarshalProtoText added in v0.29.2

func (x *SessionRequest) MarshalProtoText() string

func (*SessionRequest) MarshalToSizedBufferVT

func (m *SessionRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionRequest) MarshalToVT

func (m *SessionRequest) MarshalToVT(dAtA []byte) (int, error)

func (*SessionRequest) MarshalVT

func (m *SessionRequest) MarshalVT() (dAtA []byte, err error)

func (*SessionRequest) ProtoMessage

func (*SessionRequest) ProtoMessage()

func (*SessionRequest) Reset

func (x *SessionRequest) Reset()

func (*SessionRequest) SizeVT

func (m *SessionRequest) SizeVT() (n int)

func (*SessionRequest) String

func (x *SessionRequest) String() string

func (*SessionRequest) UnmarshalJSON added in v0.29.0

func (x *SessionRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SessionRequest from JSON.

func (*SessionRequest) UnmarshalProtoJSON added in v0.29.0

func (x *SessionRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SessionRequest message from JSON.

func (*SessionRequest) UnmarshalVT

func (m *SessionRequest) UnmarshalVT(dAtA []byte) error

func (*SessionRequest) Validate

func (r *SessionRequest) Validate() error

Validate validates the Session request.

type SessionRequest_AckMsg

type SessionRequest_AckMsg struct {
	// AckMsg acknowledges that the current incoming message was processed.
	// If the id doesn't match the current incoming message seqno, does nothing.
	AckMsg uint64 `protobuf:"varint,5,opt,name=ack_msg,json=ackMsg,proto3,oneof"`
}

func (*SessionRequest_AckMsg) CloneVT

func (*SessionRequest_AckMsg) EqualVT

func (this *SessionRequest_AckMsg) EqualVT(thatIface isSessionRequest_Body) bool

func (*SessionRequest_AckMsg) MarshalToSizedBufferVT

func (m *SessionRequest_AckMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionRequest_AckMsg) MarshalToVT

func (m *SessionRequest_AckMsg) MarshalToVT(dAtA []byte) (int, error)

func (*SessionRequest_AckMsg) SizeVT

func (m *SessionRequest_AckMsg) SizeVT() (n int)

type SessionRequest_ClearMsg

type SessionRequest_ClearMsg struct {
	// ClearMsg clears a previously sent message from the outbox.
	// If the sequence number does not match, does nothing.
	ClearMsg uint64 `protobuf:"varint,4,opt,name=clear_msg,json=clearMsg,proto3,oneof"`
}

func (*SessionRequest_ClearMsg) CloneVT

func (*SessionRequest_ClearMsg) EqualVT

func (this *SessionRequest_ClearMsg) EqualVT(thatIface isSessionRequest_Body) bool

func (*SessionRequest_ClearMsg) MarshalToSizedBufferVT

func (m *SessionRequest_ClearMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionRequest_ClearMsg) MarshalToVT

func (m *SessionRequest_ClearMsg) MarshalToVT(dAtA []byte) (int, error)

func (*SessionRequest_ClearMsg) SizeVT

func (m *SessionRequest_ClearMsg) SizeVT() (n int)

type SessionRequest_Init

type SessionRequest_Init struct {
	// Init initializes the session setting which peer to contact.
	Init *SessionInit `protobuf:"bytes,2,opt,name=init,proto3,oneof"`
}

func (*SessionRequest_Init) CloneVT

func (*SessionRequest_Init) EqualVT

func (this *SessionRequest_Init) EqualVT(thatIface isSessionRequest_Body) bool

func (*SessionRequest_Init) MarshalToSizedBufferVT

func (m *SessionRequest_Init) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionRequest_Init) MarshalToVT

func (m *SessionRequest_Init) MarshalToVT(dAtA []byte) (int, error)

func (*SessionRequest_Init) SizeVT

func (m *SessionRequest_Init) SizeVT() (n int)

type SessionRequest_SendMsg

type SessionRequest_SendMsg struct {
	// SendMsg sends a signed message to the remote peer.
	// The server will buffer at most one message for the remote peer at a time.
	// If there is an existing pending outgoing message this will overwrite it.
	// Wait for the message received ack before sending again to avoid overwriting.
	// The signature must match the peer id associated with the rpc session.
	SendMsg *SessionMsg `protobuf:"bytes,3,opt,name=send_msg,json=sendMsg,proto3,oneof"`
}

func (*SessionRequest_SendMsg) CloneVT

func (*SessionRequest_SendMsg) EqualVT

func (this *SessionRequest_SendMsg) EqualVT(thatIface isSessionRequest_Body) bool

func (*SessionRequest_SendMsg) MarshalToSizedBufferVT

func (m *SessionRequest_SendMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionRequest_SendMsg) MarshalToVT

func (m *SessionRequest_SendMsg) MarshalToVT(dAtA []byte) (int, error)

func (*SessionRequest_SendMsg) SizeVT

func (m *SessionRequest_SendMsg) SizeVT() (n int)

type SessionResponse

type SessionResponse struct {

	// Body is the body of the request.
	//
	// Types that are assignable to Body:
	//
	//	*SessionResponse_Opened
	//	*SessionResponse_Closed
	//	*SessionResponse_RecvMsg
	//	*SessionResponse_ClearMsg
	//	*SessionResponse_AckMsg
	Body isSessionResponse_Body `protobuf_oneof:"body"`
	// contains filtered or unexported fields
}

SessionResponse is a message sent from the server to the client.

func (*SessionResponse) CloneMessageVT

func (m *SessionResponse) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SessionResponse) CloneVT

func (m *SessionResponse) CloneVT() *SessionResponse

func (*SessionResponse) EqualMessageVT

func (this *SessionResponse) EqualMessageVT(thatMsg any) bool

func (*SessionResponse) EqualVT

func (this *SessionResponse) EqualVT(that *SessionResponse) bool

func (*SessionResponse) GetAckMsg

func (x *SessionResponse) GetAckMsg() uint64

func (*SessionResponse) GetBody

func (m *SessionResponse) GetBody() isSessionResponse_Body

func (*SessionResponse) GetClearMsg

func (x *SessionResponse) GetClearMsg() uint64

func (*SessionResponse) GetClosed

func (x *SessionResponse) GetClosed() bool

func (*SessionResponse) GetOpened

func (x *SessionResponse) GetOpened() uint64

func (*SessionResponse) GetRecvMsg

func (x *SessionResponse) GetRecvMsg() *SessionMsg

func (*SessionResponse) MarshalJSON added in v0.29.0

func (x *SessionResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SessionResponse to JSON.

func (*SessionResponse) MarshalProtoJSON added in v0.29.0

func (x *SessionResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SessionResponse message to JSON.

func (*SessionResponse) MarshalProtoText added in v0.29.2

func (x *SessionResponse) MarshalProtoText() string

func (*SessionResponse) MarshalToSizedBufferVT

func (m *SessionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionResponse) MarshalToVT

func (m *SessionResponse) MarshalToVT(dAtA []byte) (int, error)

func (*SessionResponse) MarshalVT

func (m *SessionResponse) MarshalVT() (dAtA []byte, err error)

func (*SessionResponse) ProtoMessage

func (*SessionResponse) ProtoMessage()

func (*SessionResponse) Reset

func (x *SessionResponse) Reset()

func (*SessionResponse) SizeVT

func (m *SessionResponse) SizeVT() (n int)

func (*SessionResponse) String

func (x *SessionResponse) String() string

func (*SessionResponse) UnmarshalJSON added in v0.29.0

func (x *SessionResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SessionResponse from JSON.

func (*SessionResponse) UnmarshalProtoJSON added in v0.29.0

func (x *SessionResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SessionResponse message from JSON.

func (*SessionResponse) UnmarshalVT

func (m *SessionResponse) UnmarshalVT(dAtA []byte) error

func (*SessionResponse) Validate

func (r *SessionResponse) Validate() error

Validate validates the Session response.

NOTE: this checks the signature but not which peer the signature is from. Be sure to additionally check the origin of the signature is what you expect.

type SessionResponse_AckMsg

type SessionResponse_AckMsg struct {
	// AckMsg confirms that the outgoing message was sent and acked.
	AckMsg uint64 `protobuf:"varint,5,opt,name=ack_msg,json=ackMsg,proto3,oneof"`
}

func (*SessionResponse_AckMsg) CloneVT

func (*SessionResponse_AckMsg) EqualVT

func (this *SessionResponse_AckMsg) EqualVT(thatIface isSessionResponse_Body) bool

func (*SessionResponse_AckMsg) MarshalToSizedBufferVT

func (m *SessionResponse_AckMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionResponse_AckMsg) MarshalToVT

func (m *SessionResponse_AckMsg) MarshalToVT(dAtA []byte) (int, error)

func (*SessionResponse_AckMsg) SizeVT

func (m *SessionResponse_AckMsg) SizeVT() (n int)

type SessionResponse_ClearMsg

type SessionResponse_ClearMsg struct {
	// ClearMsg clears a message from the remote peer previously sent with recv_msg.
	// This is sent if the remote peer clears their outgoing message before acked.
	ClearMsg uint64 `protobuf:"varint,4,opt,name=clear_msg,json=clearMsg,proto3,oneof"`
}

func (*SessionResponse_ClearMsg) CloneVT

func (*SessionResponse_ClearMsg) EqualVT

func (this *SessionResponse_ClearMsg) EqualVT(thatIface isSessionResponse_Body) bool

func (*SessionResponse_ClearMsg) MarshalToSizedBufferVT

func (m *SessionResponse_ClearMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionResponse_ClearMsg) MarshalToVT

func (m *SessionResponse_ClearMsg) MarshalToVT(dAtA []byte) (int, error)

func (*SessionResponse_ClearMsg) SizeVT

func (m *SessionResponse_ClearMsg) SizeVT() (n int)

type SessionResponse_Closed

type SessionResponse_Closed struct {
	// Closed indicates the connection w/ the remote peer is closed.
	// This is the assumed initial state.
	Closed bool `protobuf:"varint,2,opt,name=closed,proto3,oneof"`
}

func (*SessionResponse_Closed) CloneVT

func (*SessionResponse_Closed) EqualVT

func (this *SessionResponse_Closed) EqualVT(thatIface isSessionResponse_Body) bool

func (*SessionResponse_Closed) MarshalToSizedBufferVT

func (m *SessionResponse_Closed) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionResponse_Closed) MarshalToVT

func (m *SessionResponse_Closed) MarshalToVT(dAtA []byte) (int, error)

func (*SessionResponse_Closed) SizeVT

func (m *SessionResponse_Closed) SizeVT() (n int)

type SessionResponse_Opened

type SessionResponse_Opened struct {
	// Opened indicates the connection w/ the remote peer is open.
	// Contains the session nonce, incremented if the peer re-connected.
	// If this increments, re-send the outgoing message.
	Opened uint64 `protobuf:"varint,1,opt,name=opened,proto3,oneof"`
}

func (*SessionResponse_Opened) CloneVT

func (*SessionResponse_Opened) EqualVT

func (this *SessionResponse_Opened) EqualVT(thatIface isSessionResponse_Body) bool

func (*SessionResponse_Opened) MarshalToSizedBufferVT

func (m *SessionResponse_Opened) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionResponse_Opened) MarshalToVT

func (m *SessionResponse_Opened) MarshalToVT(dAtA []byte) (int, error)

func (*SessionResponse_Opened) SizeVT

func (m *SessionResponse_Opened) SizeVT() (n int)

type SessionResponse_RecvMsg

type SessionResponse_RecvMsg struct {
	// RecvMsg transfers a message sent by the remote peer.
	// Send ACK once the message has been processed.
	RecvMsg *SessionMsg `protobuf:"bytes,3,opt,name=recv_msg,json=recvMsg,proto3,oneof"`
}

func (*SessionResponse_RecvMsg) CloneVT

func (*SessionResponse_RecvMsg) EqualVT

func (this *SessionResponse_RecvMsg) EqualVT(thatIface isSessionResponse_Body) bool

func (*SessionResponse_RecvMsg) MarshalToSizedBufferVT

func (m *SessionResponse_RecvMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SessionResponse_RecvMsg) MarshalToVT

func (m *SessionResponse_RecvMsg) MarshalToVT(dAtA []byte) (int, error)

func (*SessionResponse_RecvMsg) SizeVT

func (m *SessionResponse_RecvMsg) SizeVT() (n int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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