pb

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 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 (
	Data_DataType_name = map[int32]string{
		0: "Raw",
		1: "Directory",
		2: "File",
		3: "Metadata",
		4: "Symlink",
		5: "HAMTShard",
	}
	Data_DataType_value = map[string]int32{
		"Raw":       0,
		"Directory": 1,
		"File":      2,
		"Metadata":  3,
		"Symlink":   4,
		"HAMTShard": 5,
	}
)

Enum value maps for Data_DataType.

View Source
var File_github_com_ipfs_boxo_ipld_unixfs_pb_unixfs_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Data

type Data struct {
	Type       *Data_DataType `protobuf:"varint,1,req,name=Type,enum=ipfs.boxo.ipld.unixfs.pb.Data_DataType" json:"Type,omitempty"`
	Data       []byte         `protobuf:"bytes,2,opt,name=Data" json:"Data,omitempty"`
	Filesize   *uint64        `protobuf:"varint,3,opt,name=filesize" json:"filesize,omitempty"`
	Blocksizes []uint64       `protobuf:"varint,4,rep,name=blocksizes" json:"blocksizes,omitempty"`
	HashType   *uint64        `protobuf:"varint,5,opt,name=hashType" json:"hashType,omitempty"`
	Fanout     *uint64        `protobuf:"varint,6,opt,name=fanout" json:"fanout,omitempty"`
	Mode       *uint32        `protobuf:"varint,7,opt,name=mode" json:"mode,omitempty"`
	Mtime      *IPFSTimestamp `protobuf:"bytes,8,opt,name=mtime" json:"mtime,omitempty"`
	// contains filtered or unexported fields
}

func (*Data) Descriptor deprecated

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

Deprecated: Use Data.ProtoReflect.Descriptor instead.

func (*Data) GetBlocksizes

func (x *Data) GetBlocksizes() []uint64

func (*Data) GetData

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

func (*Data) GetFanout

func (x *Data) GetFanout() uint64

func (*Data) GetFilesize

func (x *Data) GetFilesize() uint64

func (*Data) GetHashType

func (x *Data) GetHashType() uint64

func (*Data) GetMode added in v0.23.0

func (x *Data) GetMode() uint32

func (*Data) GetMtime added in v0.23.0

func (x *Data) GetMtime() *IPFSTimestamp

func (*Data) GetType

func (x *Data) GetType() Data_DataType

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) ProtoReflect added in v0.28.0

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

func (*Data) Reset

func (x *Data) Reset()

func (*Data) String

func (x *Data) String() string

type Data_DataType

type Data_DataType int32
const (
	Data_Raw       Data_DataType = 0
	Data_Directory Data_DataType = 1
	Data_File      Data_DataType = 2
	Data_Metadata  Data_DataType = 3
	Data_Symlink   Data_DataType = 4
	Data_HAMTShard Data_DataType = 5
)

func (Data_DataType) Descriptor added in v0.28.0

func (Data_DataType) Enum

func (x Data_DataType) Enum() *Data_DataType

func (Data_DataType) EnumDescriptor deprecated

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

Deprecated: Use Data_DataType.Descriptor instead.

func (Data_DataType) Number added in v0.28.0

func (Data_DataType) String

func (x Data_DataType) String() string

func (Data_DataType) Type added in v0.28.0

func (*Data_DataType) UnmarshalJSON deprecated

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

Deprecated: Do not use.

type IPFSTimestamp added in v0.23.0

type IPFSTimestamp struct {

	// Represents seconds of UTC time since Unix epoch
	// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
	// 9999-12-31T23:59:59Z inclusive.
	Seconds *int64 `protobuf:"varint,1,req,name=seconds" json:"seconds,omitempty"`
	// Non-negative fractions of a second at nanosecond resolution. Negative
	// second values with fractions must still have non-negative nanos values
	// that count forward in time. Must be from 0 to 999,999,999
	// inclusive.
	Nanos *uint32 `protobuf:"fixed32,2,opt,name=nanos" json:"nanos,omitempty"`
	// contains filtered or unexported fields
}

mostly copied from proto 3 - with int32 nanos changed to fixed32 for js-ipfs compatibility https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto

func (*IPFSTimestamp) Descriptor deprecated added in v0.23.0

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

Deprecated: Use IPFSTimestamp.ProtoReflect.Descriptor instead.

func (*IPFSTimestamp) GetNanos added in v0.23.0

func (x *IPFSTimestamp) GetNanos() uint32

func (*IPFSTimestamp) GetSeconds added in v0.23.0

func (x *IPFSTimestamp) GetSeconds() int64

func (*IPFSTimestamp) ProtoMessage added in v0.23.0

func (*IPFSTimestamp) ProtoMessage()

func (*IPFSTimestamp) ProtoReflect added in v0.28.0

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

func (*IPFSTimestamp) Reset added in v0.23.0

func (x *IPFSTimestamp) Reset()

func (*IPFSTimestamp) String added in v0.23.0

func (x *IPFSTimestamp) String() string

type Metadata

type Metadata struct {
	MimeType *string `protobuf:"bytes,1,opt,name=MimeType" json:"MimeType,omitempty"`
	// contains filtered or unexported fields
}

func (*Metadata) Descriptor deprecated

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

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetMimeType

func (x *Metadata) GetMimeType() string

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect added in v0.28.0

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

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

Jump to

Keyboard shortcuts

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