pb

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: Apache-2.0, MIT Imports: 4 Imported by: 15

Documentation

Overview

These commands work around namespace conflicts that occur when multiple repositories depend on .proto files with generic filenames. Due to the way protobuf registers files (e.g., foo.proto or pb/foo.proto), naming collisions can occur when the same filename is used across different packages.

The only way to generate a *.pb.go file that includes the full package path (e.g., github.com/org/repo/pb/foo.proto) is to place the .proto file in a directory structure that mirrors its package path.

References:

Index

Constants

This section is empty.

Variables

View Source
var (
	Message_BlockPresenceType_name = map[int32]string{
		0: "Have",
		1: "DontHave",
	}
	Message_BlockPresenceType_value = map[string]int32{
		"Have":     0,
		"DontHave": 1,
	}
)

Enum value maps for Message_BlockPresenceType.

View Source
var (
	Message_Wantlist_WantType_name = map[int32]string{
		0: "Block",
		1: "Have",
	}
	Message_Wantlist_WantType_value = map[string]int32{
		"Block": 0,
		"Have":  1,
	}
)

Enum value maps for Message_Wantlist_WantType.

View Source
var File_github_com_ipfs_boxo_bitswap_message_pb_message_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Message

type Message struct {
	Wantlist       *Message_Wantlist        `protobuf:"bytes,1,opt,name=wantlist,proto3" json:"wantlist,omitempty"`
	Blocks         [][]byte                 `protobuf:"bytes,2,rep,name=blocks,proto3" json:"blocks,omitempty"`   // used to send Blocks in bitswap 1.0.0
	Payload        []*Message_Block         `protobuf:"bytes,3,rep,name=payload,proto3" json:"payload,omitempty"` // used to send Blocks in bitswap 1.1.0
	BlockPresences []*Message_BlockPresence `protobuf:"bytes,4,rep,name=blockPresences,proto3" json:"blockPresences,omitempty"`
	PendingBytes   int32                    `protobuf:"varint,5,opt,name=pendingBytes,proto3" json:"pendingBytes,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBlockPresences

func (x *Message) GetBlockPresences() []*Message_BlockPresence

func (*Message) GetBlocks

func (x *Message) GetBlocks() [][]byte

func (*Message) GetPayload

func (x *Message) GetPayload() []*Message_Block

func (*Message) GetPendingBytes

func (x *Message) GetPendingBytes() int32

func (*Message) GetWantlist

func (x *Message) GetWantlist() *Message_Wantlist

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect added in v0.28.0

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type Message_Block

type Message_Block struct {
	Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` // CID prefix (cid version, multicodec and multihash prefix (type + length)
	Data   []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Message_Block) Descriptor deprecated

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

Deprecated: Use Message_Block.ProtoReflect.Descriptor instead.

func (*Message_Block) GetData

func (x *Message_Block) GetData() []byte

func (*Message_Block) GetPrefix

func (x *Message_Block) GetPrefix() []byte

func (*Message_Block) ProtoMessage

func (*Message_Block) ProtoMessage()

func (*Message_Block) ProtoReflect added in v0.28.0

func (x *Message_Block) ProtoReflect() protoreflect.Message

func (*Message_Block) Reset

func (x *Message_Block) Reset()

func (*Message_Block) String

func (x *Message_Block) String() string

type Message_BlockPresence

type Message_BlockPresence struct {
	Cid  []byte                    `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"`
	Type Message_BlockPresenceType `protobuf:"varint,2,opt,name=type,proto3,enum=ipfs.boxo.bitswap.message.v1.pb.Message_BlockPresenceType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*Message_BlockPresence) Descriptor deprecated

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

Deprecated: Use Message_BlockPresence.ProtoReflect.Descriptor instead.

func (*Message_BlockPresence) GetCid added in v0.28.0

func (x *Message_BlockPresence) GetCid() []byte

func (*Message_BlockPresence) GetType

func (*Message_BlockPresence) ProtoMessage

func (*Message_BlockPresence) ProtoMessage()

func (*Message_BlockPresence) ProtoReflect added in v0.28.0

func (x *Message_BlockPresence) ProtoReflect() protoreflect.Message

func (*Message_BlockPresence) Reset

func (x *Message_BlockPresence) Reset()

func (*Message_BlockPresence) String

func (x *Message_BlockPresence) String() string

type Message_BlockPresenceType

type Message_BlockPresenceType int32
const (
	Message_Have     Message_BlockPresenceType = 0
	Message_DontHave Message_BlockPresenceType = 1
)

func (Message_BlockPresenceType) Descriptor added in v0.28.0

func (Message_BlockPresenceType) Enum added in v0.28.0

func (Message_BlockPresenceType) EnumDescriptor deprecated

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

Deprecated: Use Message_BlockPresenceType.Descriptor instead.

func (Message_BlockPresenceType) Number added in v0.28.0

func (Message_BlockPresenceType) String

func (x Message_BlockPresenceType) String() string

func (Message_BlockPresenceType) Type added in v0.28.0

type Message_Wantlist

type Message_Wantlist struct {
	Entries []*Message_Wantlist_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` // a list of wantlist entries
	Full    bool                      `protobuf:"varint,2,opt,name=full,proto3" json:"full,omitempty"`      // whether this is the full wantlist. default to false
	// contains filtered or unexported fields
}

func (*Message_Wantlist) Descriptor deprecated

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

Deprecated: Use Message_Wantlist.ProtoReflect.Descriptor instead.

func (*Message_Wantlist) GetEntries

func (x *Message_Wantlist) GetEntries() []*Message_Wantlist_Entry

func (*Message_Wantlist) GetFull

func (x *Message_Wantlist) GetFull() bool

func (*Message_Wantlist) ProtoMessage

func (*Message_Wantlist) ProtoMessage()

func (*Message_Wantlist) ProtoReflect added in v0.28.0

func (x *Message_Wantlist) ProtoReflect() protoreflect.Message

func (*Message_Wantlist) Reset

func (x *Message_Wantlist) Reset()

func (*Message_Wantlist) String

func (x *Message_Wantlist) String() string

type Message_Wantlist_Entry

type Message_Wantlist_Entry struct {
	Block    []byte                    `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`        // the block cid (cidV0 in bitswap 1.0.0, cidV1 in bitswap 1.1.0)
	Priority int32                     `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"` // the priority (normalized). default to 1
	Cancel   bool                      `protobuf:"varint,3,opt,name=cancel,proto3" json:"cancel,omitempty"`     // whether this revokes an entry
	WantType Message_Wantlist_WantType ``                                                                       // Note: defaults to enum 0, ie Block
	/* 133-byte string literal not displayed */
	SendDontHave bool `protobuf:"varint,5,opt,name=sendDontHave,proto3" json:"sendDontHave,omitempty"` // Note: defaults to false
	// contains filtered or unexported fields
}

func (*Message_Wantlist_Entry) Descriptor deprecated

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

Deprecated: Use Message_Wantlist_Entry.ProtoReflect.Descriptor instead.

func (*Message_Wantlist_Entry) GetBlock added in v0.28.0

func (x *Message_Wantlist_Entry) GetBlock() []byte

func (*Message_Wantlist_Entry) GetCancel

func (x *Message_Wantlist_Entry) GetCancel() bool

func (*Message_Wantlist_Entry) GetPriority

func (x *Message_Wantlist_Entry) GetPriority() int32

func (*Message_Wantlist_Entry) GetSendDontHave

func (x *Message_Wantlist_Entry) GetSendDontHave() bool

func (*Message_Wantlist_Entry) GetWantType

func (*Message_Wantlist_Entry) ProtoMessage

func (*Message_Wantlist_Entry) ProtoMessage()

func (*Message_Wantlist_Entry) ProtoReflect added in v0.28.0

func (x *Message_Wantlist_Entry) ProtoReflect() protoreflect.Message

func (*Message_Wantlist_Entry) Reset

func (x *Message_Wantlist_Entry) Reset()

func (*Message_Wantlist_Entry) String

func (x *Message_Wantlist_Entry) String() string

type Message_Wantlist_WantType

type Message_Wantlist_WantType int32
const (
	Message_Wantlist_Block Message_Wantlist_WantType = 0
	Message_Wantlist_Have  Message_Wantlist_WantType = 1
)

func (Message_Wantlist_WantType) Descriptor added in v0.28.0

func (Message_Wantlist_WantType) Enum added in v0.28.0

func (Message_Wantlist_WantType) EnumDescriptor deprecated

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

Deprecated: Use Message_Wantlist_WantType.Descriptor instead.

func (Message_Wantlist_WantType) Number added in v0.28.0

func (Message_Wantlist_WantType) String

func (x Message_Wantlist_WantType) String() string

func (Message_Wantlist_WantType) Type added in v0.28.0

Jump to

Keyboard shortcuts

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