pb

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthDiscoveryMsg        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDiscoveryMsg          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDiscoveryMsg = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMessageRoutingMsg        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessageRoutingMsg          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMessageRoutingMsg = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPeerInfo        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPeerInfo          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPeerInfo = fmt.Errorf("proto: unexpected end of group")
)
View Source
var DiscoveryMsg_Type_name = map[int32]string{
	0: "Announce",
	1: "FindReq",
	2: "FindRes",
	3: "HEARTBEAT",
	4: "HEARTBEATRes",
}
View Source
var DiscoveryMsg_Type_value = map[string]int32{
	"Announce":     0,
	"FindReq":      1,
	"FindRes":      2,
	"HEARTBEAT":    3,
	"HEARTBEATRes": 4,
}
View Source
var MessageRoutingMsg_Type_name = map[int32]string{
	0: "MsgReq",
	1: "MsgResp",
}
View Source
var MessageRoutingMsg_Type_value = map[string]int32{
	"MsgReq":  0,
	"MsgResp": 1,
}

Functions

This section is empty.

Types

type DiscoveryMsg

type DiscoveryMsg struct {
	Type                 DiscoveryMsg_Type `protobuf:"varint,1,opt,name=type,proto3,enum=dht.DiscoveryMsg_Type" json:"type,omitempty"`
	PInfo                []*PeerInfo       `protobuf:"bytes,2,rep,name=pInfo,proto3" json:"pInfo,omitempty"`
	Size_                uint32            `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

protoc --gofast_out=. ./discovery_msg.proto

func (*DiscoveryMsg) Descriptor

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

func (*DiscoveryMsg) GetPInfo

func (m *DiscoveryMsg) GetPInfo() []*PeerInfo

func (*DiscoveryMsg) GetSize_

func (m *DiscoveryMsg) GetSize_() uint32

func (*DiscoveryMsg) GetType

func (m *DiscoveryMsg) GetType() DiscoveryMsg_Type

func (*DiscoveryMsg) Marshal

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

func (*DiscoveryMsg) MarshalTo

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

func (*DiscoveryMsg) MarshalToSizedBuffer

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

func (*DiscoveryMsg) ProtoMessage

func (*DiscoveryMsg) ProtoMessage()

func (*DiscoveryMsg) Reset

func (m *DiscoveryMsg) Reset()

func (*DiscoveryMsg) Size

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

func (*DiscoveryMsg) String

func (m *DiscoveryMsg) String() string

func (*DiscoveryMsg) Unmarshal

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

func (*DiscoveryMsg) XXX_DiscardUnknown

func (m *DiscoveryMsg) XXX_DiscardUnknown()

func (*DiscoveryMsg) XXX_Marshal

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

func (*DiscoveryMsg) XXX_Merge

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

func (*DiscoveryMsg) XXX_Size

func (m *DiscoveryMsg) XXX_Size() int

func (*DiscoveryMsg) XXX_Unmarshal

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

type DiscoveryMsg_Type

type DiscoveryMsg_Type int32
const (
	DiscoveryMsg_Announce     DiscoveryMsg_Type = 0
	DiscoveryMsg_FindReq      DiscoveryMsg_Type = 1
	DiscoveryMsg_FindRes      DiscoveryMsg_Type = 2
	DiscoveryMsg_HEARTBEAT    DiscoveryMsg_Type = 3
	DiscoveryMsg_HEARTBEATRes DiscoveryMsg_Type = 4
)

func (DiscoveryMsg_Type) EnumDescriptor

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

func (DiscoveryMsg_Type) String

func (x DiscoveryMsg_Type) String() string

type MessageRoutingMsg

type MessageRoutingMsg struct {
	Id                   string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Sender               string                 `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
	From                 *PeerInfo              `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"`
	To                   string                 `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"`
	Type                 MessageRoutingMsg_Type `protobuf:"varint,5,opt,name=type,proto3,enum=dht.MessageRoutingMsg_Type" json:"type,omitempty"`
	CallMe               bool                   `protobuf:"varint,6,opt,name=callMe,proto3" json:"callMe,omitempty"`
	ResponseMe           bool                   `protobuf:"varint,7,opt,name=responseMe,proto3" json:"responseMe,omitempty"`
	Data                 []byte                 `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"`
	HopCount             int64                  `protobuf:"varint,9,opt,name=hopCount,proto3" json:"hopCount,omitempty"`
	SendTime             int64                  `protobuf:"varint,10,opt,name=sendTime,proto3" json:"sendTime,omitempty"`
	RespMsgId            string                 `protobuf:"bytes,11,opt,name=respMsgId,proto3" json:"respMsgId,omitempty"`
	SenderKey            []byte                 `protobuf:"bytes,12,opt,name=SenderKey,proto3" json:"SenderKey,omitempty"`
	SenderSign           []byte                 `protobuf:"bytes,13,opt,name=SenderSign,proto3" json:"SenderSign,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

protoc --go_out=. ./message_routing_msg.proto protoc --gofast_out=. ./message_routing_msg.proto

func (*MessageRoutingMsg) Descriptor

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

func (*MessageRoutingMsg) GetCallMe

func (m *MessageRoutingMsg) GetCallMe() bool

func (*MessageRoutingMsg) GetData

func (m *MessageRoutingMsg) GetData() []byte

func (*MessageRoutingMsg) GetFrom

func (m *MessageRoutingMsg) GetFrom() *PeerInfo

func (*MessageRoutingMsg) GetHopCount

func (m *MessageRoutingMsg) GetHopCount() int64

func (*MessageRoutingMsg) GetId

func (m *MessageRoutingMsg) GetId() string

func (*MessageRoutingMsg) GetRespMsgId

func (m *MessageRoutingMsg) GetRespMsgId() string

func (*MessageRoutingMsg) GetResponseMe

func (m *MessageRoutingMsg) GetResponseMe() bool

func (*MessageRoutingMsg) GetSendTime

func (m *MessageRoutingMsg) GetSendTime() int64

func (*MessageRoutingMsg) GetSender

func (m *MessageRoutingMsg) GetSender() string

func (*MessageRoutingMsg) GetSenderKey

func (m *MessageRoutingMsg) GetSenderKey() []byte

func (*MessageRoutingMsg) GetSenderSign

func (m *MessageRoutingMsg) GetSenderSign() []byte

func (*MessageRoutingMsg) GetTo

func (m *MessageRoutingMsg) GetTo() string

func (*MessageRoutingMsg) GetType

func (*MessageRoutingMsg) Marshal

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

func (*MessageRoutingMsg) MarshalTo

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

func (*MessageRoutingMsg) MarshalToSizedBuffer

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

func (*MessageRoutingMsg) ProtoMessage

func (*MessageRoutingMsg) ProtoMessage()

func (*MessageRoutingMsg) Reset

func (m *MessageRoutingMsg) Reset()

func (*MessageRoutingMsg) Size

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

func (*MessageRoutingMsg) String

func (m *MessageRoutingMsg) String() string

func (*MessageRoutingMsg) Unmarshal

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

func (*MessageRoutingMsg) XXX_DiscardUnknown

func (m *MessageRoutingMsg) XXX_DiscardUnknown()

func (*MessageRoutingMsg) XXX_Marshal

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

func (*MessageRoutingMsg) XXX_Merge

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

func (*MessageRoutingMsg) XXX_Size

func (m *MessageRoutingMsg) XXX_Size() int

func (*MessageRoutingMsg) XXX_Unmarshal

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

type MessageRoutingMsg_Type

type MessageRoutingMsg_Type int32
const (
	MessageRoutingMsg_MsgReq  MessageRoutingMsg_Type = 0
	MessageRoutingMsg_MsgResp MessageRoutingMsg_Type = 1
)

func (MessageRoutingMsg_Type) EnumDescriptor

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

func (MessageRoutingMsg_Type) String

func (x MessageRoutingMsg_Type) String() string

type PeerInfo

type PeerInfo struct {
	Pid                  string   `protobuf:"bytes,1,opt,name=pid,proto3" json:"pid,omitempty"`
	Addrs                []string `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PeerInfo) Descriptor

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

func (*PeerInfo) GetAddrs

func (m *PeerInfo) GetAddrs() []string

func (*PeerInfo) GetPid

func (m *PeerInfo) GetPid() string

func (*PeerInfo) Marshal

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

func (*PeerInfo) MarshalTo

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

func (*PeerInfo) MarshalToSizedBuffer

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

func (*PeerInfo) ProtoMessage

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) Reset

func (m *PeerInfo) Reset()

func (*PeerInfo) Size

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

func (*PeerInfo) String

func (m *PeerInfo) String() string

func (*PeerInfo) Unmarshal

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

func (*PeerInfo) XXX_DiscardUnknown

func (m *PeerInfo) XXX_DiscardUnknown()

func (*PeerInfo) XXX_Marshal

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

func (*PeerInfo) XXX_Merge

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

func (*PeerInfo) XXX_Size

func (m *PeerInfo) XXX_Size() int

func (*PeerInfo) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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