pb

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthPubsubcollect        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPubsubcollect          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPubsubcollect = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Msg_MsgType_name = map[int32]string{
	0: "Unknown",
	1: "Request",
	2: "Response",
	3: "Hit",
}
View Source
var Msg_MsgType_value = map[string]int32{
	"Unknown":  0,
	"Request":  1,
	"Response": 2,
	"Hit":      3,
}

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
}

func (*Error) Descriptor

func (*Error) Descriptor() ([]byte, []int)

func (*Error) Marshal

func (m *Error) Marshal() (dAtA []byte, err error)

func (*Error) MarshalTo

func (m *Error) MarshalTo(dAtA []byte) (int, error)

func (*Error) MarshalToSizedBuffer

func (m *Error) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) Size

func (m *Error) Size() (n int)

func (*Error) String

func (m *Error) String() string

func (*Error) Unmarshal

func (m *Error) Unmarshal(dAtA []byte) error

func (*Error) XXX_DiscardUnknown

func (m *Error) XXX_DiscardUnknown()

func (*Error) XXX_Marshal

func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Error) XXX_Merge

func (m *Error) XXX_Merge(src proto.Message)

func (*Error) XXX_Size

func (m *Error) XXX_Size() int

func (*Error) XXX_Unmarshal

func (m *Error) XXX_Unmarshal(b []byte) error

type Intermediate

type Intermediate struct {
	// hit decides whether send back to the root node
	// if hit is true, means that the current node has the wanted answer.
	Hit bool `protobuf:"varint,1,opt,name=hit,proto3" json:"hit,omitempty"`
	// response payload, which will be assembled into a response
	// be aware that THIS IS NOT response.marshal() result
	Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// Error Message
	Error *Error `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
}

func (*Intermediate) Descriptor

func (*Intermediate) Descriptor() ([]byte, []int)

func (*Intermediate) Marshal

func (m *Intermediate) Marshal() (dAtA []byte, err error)

func (*Intermediate) MarshalTo

func (m *Intermediate) MarshalTo(dAtA []byte) (int, error)

func (*Intermediate) MarshalToSizedBuffer

func (m *Intermediate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Intermediate) ProtoMessage

func (*Intermediate) ProtoMessage()

func (*Intermediate) Reset

func (m *Intermediate) Reset()

func (*Intermediate) Size

func (m *Intermediate) Size() (n int)

func (*Intermediate) String

func (m *Intermediate) String() string

func (*Intermediate) Unmarshal

func (m *Intermediate) Unmarshal(dAtA []byte) error

func (*Intermediate) XXX_DiscardUnknown

func (m *Intermediate) XXX_DiscardUnknown()

func (*Intermediate) XXX_Marshal

func (m *Intermediate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Intermediate) XXX_Merge

func (m *Intermediate) XXX_Merge(src proto.Message)

func (*Intermediate) XXX_Size

func (m *Intermediate) XXX_Size() int

func (*Intermediate) XXX_Unmarshal

func (m *Intermediate) XXX_Unmarshal(b []byte) error

type Msg

type Msg struct {
	Type     Msg_MsgType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.Msg_MsgType" json:"type,omitempty"`
	Request  *Request    `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
	Response *Response   `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"`
}

func (*Msg) Descriptor

func (*Msg) Descriptor() ([]byte, []int)

func (*Msg) Marshal

func (m *Msg) Marshal() (dAtA []byte, err error)

func (*Msg) MarshalTo

func (m *Msg) MarshalTo(dAtA []byte) (int, error)

func (*Msg) MarshalToSizedBuffer

func (m *Msg) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Msg) ProtoMessage

func (*Msg) ProtoMessage()

func (*Msg) Reset

func (m *Msg) Reset()

func (*Msg) Size

func (m *Msg) Size() (n int)

func (*Msg) String

func (m *Msg) String() string

func (*Msg) Unmarshal

func (m *Msg) Unmarshal(dAtA []byte) error

func (*Msg) XXX_DiscardUnknown

func (m *Msg) XXX_DiscardUnknown()

func (*Msg) XXX_Marshal

func (m *Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Msg) XXX_Merge

func (m *Msg) XXX_Merge(src proto.Message)

func (*Msg) XXX_Size

func (m *Msg) XXX_Size() int

func (*Msg) XXX_Unmarshal

func (m *Msg) XXX_Unmarshal(b []byte) error

type Msg_MsgType

type Msg_MsgType int32
const (
	Msg_Unknown  Msg_MsgType = 0
	Msg_Request  Msg_MsgType = 1
	Msg_Response Msg_MsgType = 2
	Msg_Hit      Msg_MsgType = 3
)

func (Msg_MsgType) EnumDescriptor

func (Msg_MsgType) EnumDescriptor() ([]byte, []int)

func (Msg_MsgType) String

func (x Msg_MsgType) String() string

type Request

type Request struct {
	// control is the routing messages.
	Control RequestControl `protobuf:"bytes,1,opt,name=control,proto3" json:"control"`
	Payload []byte         `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
}

Request is the structure transmit in overlay network, to perform a broadcast query.

func (*Request) Descriptor

func (*Request) Descriptor() ([]byte, []int)

func (*Request) Marshal

func (m *Request) Marshal() (dAtA []byte, err error)

func (*Request) MarshalTo

func (m *Request) MarshalTo(dAtA []byte) (int, error)

func (*Request) MarshalToSizedBuffer

func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) Size

func (m *Request) Size() (n int)

func (*Request) String

func (m *Request) String() string

func (*Request) Unmarshal

func (m *Request) Unmarshal(dAtA []byte) error

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Request) XXX_Merge

func (m *Request) XXX_Merge(src proto.Message)

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

func (m *Request) XXX_Unmarshal(b []byte) error

type RequestControl

type RequestControl struct {
	// requester is the peerid of the origin node
	Requester github_com_libp2p_go_libp2p_core_peer.ID `protobuf:"bytes,1,opt,name=requester,proto3,casttype=github.com/libp2p/go-libp2p/core/peer.ID" json:"requester,omitempty"`
	// sender is the node who gives you this request
	Sender github_com_libp2p_go_libp2p_core_peer.ID `protobuf:"bytes,2,opt,name=sender,proto3,casttype=github.com/libp2p/go-libp2p/core/peer.ID" json:"sender,omitempty"`
	// seqno is the sequence number helps to generate request id
	Seqno uint64 `protobuf:"varint,3,opt,name=seqno,proto3" json:"seqno,omitempty"`
	Hops  uint32 `protobuf:"varint,4,opt,name=hops,proto3" json:"hops,omitempty"`
	Topic string `protobuf:"bytes,5,opt,name=topic,proto3" json:"topic,omitempty"`
}

func (*RequestControl) Descriptor

func (*RequestControl) Descriptor() ([]byte, []int)

func (*RequestControl) Marshal

func (m *RequestControl) Marshal() (dAtA []byte, err error)

func (*RequestControl) MarshalTo

func (m *RequestControl) MarshalTo(dAtA []byte) (int, error)

func (*RequestControl) MarshalToSizedBuffer

func (m *RequestControl) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RequestControl) ProtoMessage

func (*RequestControl) ProtoMessage()

func (*RequestControl) Reset

func (m *RequestControl) Reset()

func (*RequestControl) Size

func (m *RequestControl) Size() (n int)

func (*RequestControl) String

func (m *RequestControl) String() string

func (*RequestControl) Unmarshal

func (m *RequestControl) Unmarshal(dAtA []byte) error

func (*RequestControl) XXX_DiscardUnknown

func (m *RequestControl) XXX_DiscardUnknown()

func (*RequestControl) XXX_Marshal

func (m *RequestControl) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestControl) XXX_Merge

func (m *RequestControl) XXX_Merge(src proto.Message)

func (*RequestControl) XXX_Size

func (m *RequestControl) XXX_Size() int

func (*RequestControl) XXX_Unmarshal

func (m *RequestControl) XXX_Unmarshal(b []byte) error

type RequestID

type RequestID string

RequestID .

func (RequestID) String

func (r RequestID) String() string

type Response

type Response struct {
	// control is the routing messages.
	Control ResponseControl `protobuf:"bytes,1,opt,name=control,proto3" json:"control"`
	Payload []byte          `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// Error Message
	Error *Error `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
}

Response is the structure transmit in overlay network, to answer a broadcast query.

func (*Response) Descriptor

func (*Response) Descriptor() ([]byte, []int)

func (*Response) Marshal

func (m *Response) Marshal() (dAtA []byte, err error)

func (*Response) MarshalTo

func (m *Response) MarshalTo(dAtA []byte) (int, error)

func (*Response) MarshalToSizedBuffer

func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) Size

func (m *Response) Size() (n int)

func (*Response) String

func (m *Response) String() string

func (*Response) Unmarshal

func (m *Response) Unmarshal(dAtA []byte) error

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Response) XXX_Merge

func (m *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

func (m *Response) XXX_Unmarshal(b []byte) error

type ResponseControl

type ResponseControl struct {
	// response related request id.
	RequestId RequestID `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"`
	// requester is the node who send the request
	Requester github_com_libp2p_go_libp2p_core_peer.ID `protobuf:"bytes,2,opt,name=requester,proto3,casttype=github.com/libp2p/go-libp2p/core/peer.ID" json:"requester,omitempty"`
	// responser is the node who generate the current response
	Responser github_com_libp2p_go_libp2p_core_peer.ID `protobuf:"bytes,3,opt,name=responser,proto3,casttype=github.com/libp2p/go-libp2p/core/peer.ID" json:"responser,omitempty"`
	// sender is the node who send you this response
	Sender github_com_libp2p_go_libp2p_core_peer.ID `protobuf:"bytes,4,opt,name=sender,proto3,casttype=github.com/libp2p/go-libp2p/core/peer.ID" json:"sender,omitempty"`
	Topic  string                                   `protobuf:"bytes,5,opt,name=topic,proto3" json:"topic,omitempty"`
}

func (*ResponseControl) Descriptor

func (*ResponseControl) Descriptor() ([]byte, []int)

func (*ResponseControl) Marshal

func (m *ResponseControl) Marshal() (dAtA []byte, err error)

func (*ResponseControl) MarshalTo

func (m *ResponseControl) MarshalTo(dAtA []byte) (int, error)

func (*ResponseControl) MarshalToSizedBuffer

func (m *ResponseControl) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ResponseControl) ProtoMessage

func (*ResponseControl) ProtoMessage()

func (*ResponseControl) Reset

func (m *ResponseControl) Reset()

func (*ResponseControl) Size

func (m *ResponseControl) Size() (n int)

func (*ResponseControl) String

func (m *ResponseControl) String() string

func (*ResponseControl) Unmarshal

func (m *ResponseControl) Unmarshal(dAtA []byte) error

func (*ResponseControl) XXX_DiscardUnknown

func (m *ResponseControl) XXX_DiscardUnknown()

func (*ResponseControl) XXX_Marshal

func (m *ResponseControl) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResponseControl) XXX_Merge

func (m *ResponseControl) XXX_Merge(src proto.Message)

func (*ResponseControl) XXX_Size

func (m *ResponseControl) XXX_Size() int

func (*ResponseControl) XXX_Unmarshal

func (m *ResponseControl) XXX_Unmarshal(b []byte) error

type Responses

type Responses struct {
	Responses []*Responses `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"`
}

func (*Responses) Descriptor

func (*Responses) Descriptor() ([]byte, []int)

func (*Responses) Marshal

func (m *Responses) Marshal() (dAtA []byte, err error)

func (*Responses) MarshalTo

func (m *Responses) MarshalTo(dAtA []byte) (int, error)

func (*Responses) MarshalToSizedBuffer

func (m *Responses) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Responses) ProtoMessage

func (*Responses) ProtoMessage()

func (*Responses) Reset

func (m *Responses) Reset()

func (*Responses) Size

func (m *Responses) Size() (n int)

func (*Responses) String

func (m *Responses) String() string

func (*Responses) Unmarshal

func (m *Responses) Unmarshal(dAtA []byte) error

func (*Responses) XXX_DiscardUnknown

func (m *Responses) XXX_DiscardUnknown()

func (*Responses) XXX_Marshal

func (m *Responses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Responses) XXX_Merge

func (m *Responses) XXX_Merge(src proto.Message)

func (*Responses) XXX_Size

func (m *Responses) XXX_Size() int

func (*Responses) XXX_Unmarshal

func (m *Responses) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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