Documentation ¶
Overview ¶
Package wiretype defines the encoding types for the ffs package. Most of this package is generated by the protocol buffer compiler from the schema in file/wiretype/wiretype.proto.
Index ¶
- Variables
- func Load(ctx context.Context, s Getter, key string, msg proto.Message) error
- func Save(ctx context.Context, s Putter, msg proto.Message) (string, error)
- func ToBinary(msg proto.Message) ([]byte, error)
- type Block
- type Child
- type Extent
- func (*Extent) Descriptor() ([]byte, []int)deprecated
- func (x *Extent) GetBase() uint64
- func (x *Extent) GetBlocks() []*Block
- func (x *Extent) GetBytes() uint64
- func (*Extent) ProtoMessage()
- func (x *Extent) ProtoReflect() protoreflect.Message
- func (x *Extent) Reset()
- func (x *Extent) String() string
- type Getter
- type Index
- func (*Index) Descriptor() ([]byte, []int)deprecated
- func (x *Index) GetExtents() []*Extent
- func (x *Index) GetSingle() []byte
- func (x *Index) GetTotalBytes() uint64
- func (x *Index) Normalize()
- func (*Index) ProtoMessage()
- func (x *Index) ProtoReflect() protoreflect.Message
- func (x *Index) Reset()
- func (x *Index) String() string
- type Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetChildren() []*Child
- func (x *Node) GetIndex() *Index
- func (x *Node) GetStat() *Stat
- func (x *Node) GetXAttrs() []*XAttr
- func (n *Node) MarshalJSON() ([]byte, error)
- func (n *Node) Normalize()
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
- type Object
- func (*Object) Descriptor() ([]byte, []int)deprecated
- func (x *Object) GetIndex() *indexpb.Index
- func (x *Object) GetNode() *Node
- func (x *Object) GetRoot() *Root
- func (m *Object) GetValue() isObject_Value
- func (x *Object) GetVersion() uint64
- func (*Object) ProtoMessage()
- func (x *Object) ProtoReflect() protoreflect.Message
- func (x *Object) Reset()
- func (x *Object) String() string
- type Object_Index
- type Object_Node
- type Object_Root
- type Putter
- type Root
- func (*Root) Descriptor() ([]byte, []int)deprecated
- func (x *Root) GetDescription() string
- func (x *Root) GetFileKey() []byte
- func (x *Root) GetIndexKey() []byte
- func (r *Root) MarshalJSON() ([]byte, error)
- func (*Root) ProtoMessage()
- func (x *Root) ProtoReflect() protoreflect.Message
- func (x *Root) Reset()
- func (x *Root) String() string
- type Stat
- func (*Stat) Descriptor() ([]byte, []int)deprecated
- func (x *Stat) GetFileType() Stat_FileType
- func (x *Stat) GetGroup() *Stat_Ident
- func (x *Stat) GetModTime() *Timestamp
- func (x *Stat) GetOwner() *Stat_Ident
- func (x *Stat) GetPermissions() uint32
- func (*Stat) ProtoMessage()
- func (x *Stat) ProtoReflect() protoreflect.Message
- func (x *Stat) Reset()
- func (x *Stat) String() string
- type Stat_FileType
- func (Stat_FileType) Descriptor() protoreflect.EnumDescriptor
- func (x Stat_FileType) Enum() *Stat_FileType
- func (Stat_FileType) EnumDescriptor() ([]byte, []int)deprecated
- func (x Stat_FileType) Number() protoreflect.EnumNumber
- func (x Stat_FileType) String() string
- func (Stat_FileType) Type() protoreflect.EnumType
- type Stat_Ident
- type Timestamp
- type XAttr
Constants ¶
This section is empty.
Variables ¶
var ( Stat_FileType_name = map[int32]string{ 0: "REGULAR", 1: "DIRECTORY", 2: "SYMLINK", 3: "SOCKET", 4: "NAMED_PIPE", 5: "DEVICE", 6: "CHAR_DEVICE", 404: "UNKNOWN", } Stat_FileType_value = map[string]int32{ "REGULAR": 0, "DIRECTORY": 1, "SYMLINK": 2, "SOCKET": 3, "NAMED_PIPE": 4, "DEVICE": 5, "CHAR_DEVICE": 6, "UNKNOWN": 404, } )
Enum value maps for Stat_FileType.
var File_wiretype_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Block ¶
type Block struct { Bytes uint64 `protobuf:"varint,1,opt,name=bytes,proto3" json:"bytes,omitempty"` // the number of bytes in this block Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // the storage key of the block data // contains filtered or unexported fields }
A Block describes the size and storage key of a data blob.
func (*Block) Descriptor
deprecated
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
type Child ¶
type Child struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
A Child records the name and storage key of a child Node.
func (*Child) Descriptor
deprecated
func (*Child) ProtoMessage ¶
func (*Child) ProtoMessage()
func (*Child) ProtoReflect ¶
func (x *Child) ProtoReflect() protoreflect.Message
type Extent ¶
type Extent struct { Base uint64 `protobuf:"varint,1,opt,name=base,proto3" json:"base,omitempty"` // the starting offset Bytes uint64 `protobuf:"varint,2,opt,name=bytes,proto3" json:"bytes,omitempty"` // the number of bytes in this extent Blocks []*Block `protobuf:"bytes,3,rep,name=blocks,proto3" json:"blocks,omitempty"` // contains filtered or unexported fields }
An Extent describes a single contiguous span of stored data.
func (*Extent) Descriptor
deprecated
func (*Extent) ProtoMessage ¶
func (*Extent) ProtoMessage()
func (*Extent) ProtoReflect ¶
func (x *Extent) ProtoReflect() protoreflect.Message
type Index ¶
type Index struct { TotalBytes uint64 `protobuf:"varint,1,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"` Extents []*Extent `protobuf:"bytes,2,rep,name=extents,proto3" json:"extents,omitempty"` // multiple blocks Single []byte `protobuf:"bytes,3,opt,name=single,proto3" json:"single,omitempty"` // a single block // contains filtered or unexported fields }
An Index records the size and storage locations of file data.
func (*Index) Descriptor
deprecated
func (*Index) GetExtents ¶
func (*Index) GetTotalBytes ¶
func (*Index) Normalize ¶
func (x *Index) Normalize()
Normalize updates n in-place so that all fields are in canonical order.
func (*Index) ProtoMessage ¶
func (*Index) ProtoMessage()
func (*Index) ProtoReflect ¶
func (x *Index) ProtoReflect() protoreflect.Message
type Node ¶
type Node struct { Index *Index `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` // file contents Stat *Stat `protobuf:"bytes,2,opt,name=stat,proto3" json:"stat,omitempty"` // stat metadata (optional) XAttrs []*XAttr `protobuf:"bytes,3,rep,name=x_attrs,json=xAttrs,proto3" json:"x_attrs,omitempty"` // extended attributes Children []*Child `protobuf:"bytes,4,rep,name=children,proto3" json:"children,omitempty"` // child file pointers // contains filtered or unexported fields }
A Node is the top-level encoding of a file.
func (*Node) Descriptor
deprecated
func (*Node) GetChildren ¶
func (*Node) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for a *Node, by delegating to the protojson marshaler. This allows a node to be encoded using the encoding/json package transparently.
func (*Node) Normalize ¶
func (n *Node) Normalize()
Normalize updates n in-place so that all fields are in canonical order.
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
type Object ¶
type Object struct { // Types that are assignable to Value: // // *Object_Node // *Object_Root // *Object_Index Value isObject_Value `protobuf_oneof:"value"` // A version marker for the stored object. // Currently 0 is the only known value. Version uint64 `protobuf:"varint,15,opt,name=version,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
An Object is the top-level wrapper for encoded objects.
func (*Object) Descriptor
deprecated
func (*Object) GetVersion ¶
func (*Object) ProtoMessage ¶
func (*Object) ProtoMessage()
func (*Object) ProtoReflect ¶
func (x *Object) ProtoReflect() protoreflect.Message
type Object_Index ¶
type Object_Node ¶
type Object_Node struct {
Node *Node `protobuf:"bytes,1,opt,name=node,proto3,oneof"` // a structured file object
}
type Object_Root ¶
type Object_Root struct {
Root *Root `protobuf:"bytes,2,opt,name=root,proto3,oneof"` // a root pointer
}
type Root ¶
type Root struct { // The storage key of the root of the tree. // The blob contains an Object holding a Node message. // This field must be non-empty for a root to be valid. FileKey []byte `protobuf:"bytes,1,opt,name=file_key,json=fileKey,proto3" json:"file_key,omitempty"` // A human-readable descriptive label for the root. Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // The storage key of a blob index for the root. // The blob contains a Object holding an ffs.index.Index message. IndexKey []byte `protobuf:"bytes,4,opt,name=index_key,json=indexKey,proto3" json:"index_key,omitempty"` // contains filtered or unexported fields }
A Root records the location of a root node of a file tree.
func (*Root) Descriptor
deprecated
func (*Root) GetDescription ¶
func (*Root) GetFileKey ¶
func (*Root) GetIndexKey ¶
func (*Root) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for a *Root, by delegating to the protojson marshaler. This allows a node to be encoded using the encoding/json package transparently.
func (*Root) ProtoMessage ¶
func (*Root) ProtoMessage()
func (*Root) ProtoReflect ¶
func (x *Root) ProtoReflect() protoreflect.Message
type Stat ¶
type Stat struct { // The low-order 12 bits of this field hold the standard Unix permissions, // along with the sticky, setuid, and setgid bits. The rest are reserved and // must be set to zero. In binary: // // owner group other // ... +-+-+-+-----+-----+-----+ S: setuid // |S|G|T|r w x|r w x|r w x| G: setgid // ... +-+-+-+-----+-----+-----+ T: sticky // B A 9 6 3 0 « bit Permissions uint32 `protobuf:"varint,1,opt,name=permissions,proto3" json:"permissions,omitempty"` FileType Stat_FileType `protobuf:"varint,2,opt,name=file_type,json=fileType,proto3,enum=ffs.file.Stat_FileType" json:"file_type,omitempty"` ModTime *Timestamp `protobuf:"bytes,3,opt,name=mod_time,json=modTime,proto3" json:"mod_time,omitempty"` Owner *Stat_Ident `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` Group *Stat_Ident `protobuf:"bytes,5,opt,name=group,proto3" json:"group,omitempty"` // contains filtered or unexported fields }
Stat records POSIX style file metadata. Other than the modification time, these metadata are not interpreted by the file plumbing, but are preserved for the benefit of external tools.
func (*Stat) Descriptor
deprecated
func (*Stat) GetFileType ¶
func (x *Stat) GetFileType() Stat_FileType
func (*Stat) GetGroup ¶
func (x *Stat) GetGroup() *Stat_Ident
func (*Stat) GetModTime ¶
func (*Stat) GetOwner ¶
func (x *Stat) GetOwner() *Stat_Ident
func (*Stat) GetPermissions ¶
func (*Stat) ProtoMessage ¶
func (*Stat) ProtoMessage()
func (*Stat) ProtoReflect ¶
func (x *Stat) ProtoReflect() protoreflect.Message
type Stat_FileType ¶
type Stat_FileType int32
A FileType abstracts the type of a file.
const ( Stat_REGULAR Stat_FileType = 0 // a regular file Stat_DIRECTORY Stat_FileType = 1 // a directory Stat_SYMLINK Stat_FileType = 2 // a symbolic link Stat_SOCKET Stat_FileType = 3 // a Unix-domain socket Stat_NAMED_PIPE Stat_FileType = 4 // a named pipe Stat_DEVICE Stat_FileType = 5 // a (block) device file Stat_CHAR_DEVICE Stat_FileType = 6 // a (character) device file Stat_UNKNOWN Stat_FileType = 404 // nothing is known about the type of this file )
func (Stat_FileType) Descriptor ¶
func (Stat_FileType) Descriptor() protoreflect.EnumDescriptor
func (Stat_FileType) Enum ¶
func (x Stat_FileType) Enum() *Stat_FileType
func (Stat_FileType) EnumDescriptor
deprecated
func (Stat_FileType) EnumDescriptor() ([]byte, []int)
Deprecated: Use Stat_FileType.Descriptor instead.
func (Stat_FileType) Number ¶
func (x Stat_FileType) Number() protoreflect.EnumNumber
func (Stat_FileType) String ¶
func (x Stat_FileType) String() string
func (Stat_FileType) Type ¶
func (Stat_FileType) Type() protoreflect.EnumType
type Stat_Ident ¶
type Stat_Ident struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // numeric ID Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // human-readable name // contains filtered or unexported fields }
An Ident represents the identity of a user or group.
func (*Stat_Ident) Descriptor
deprecated
func (*Stat_Ident) Descriptor() ([]byte, []int)
Deprecated: Use Stat_Ident.ProtoReflect.Descriptor instead.
func (*Stat_Ident) GetId ¶
func (x *Stat_Ident) GetId() uint64
func (*Stat_Ident) GetName ¶
func (x *Stat_Ident) GetName() string
func (*Stat_Ident) ProtoMessage ¶
func (*Stat_Ident) ProtoMessage()
func (*Stat_Ident) ProtoReflect ¶
func (x *Stat_Ident) ProtoReflect() protoreflect.Message
func (*Stat_Ident) Reset ¶
func (x *Stat_Ident) Reset()
func (*Stat_Ident) String ¶
func (x *Stat_Ident) String() string
type Timestamp ¶
type Timestamp struct { Seconds uint64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` Nanos uint32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` // contains filtered or unexported fields }
Time is the encoding of a timestamp, in seconds and nanoseconds elapsed since the Unix epoch in UTC.
func (*Timestamp) Descriptor
deprecated
func (*Timestamp) GetSeconds ¶
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
func (*Timestamp) ProtoReflect ¶
func (x *Timestamp) ProtoReflect() protoreflect.Message
type XAttr ¶
type XAttr struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
An XAttr records the name and value of an extended attribute. The contents of the value are not interpreted.
func (*XAttr) Descriptor
deprecated
func (*XAttr) ProtoMessage ¶
func (*XAttr) ProtoMessage()
func (*XAttr) ProtoReflect ¶
func (x *XAttr) ProtoReflect() protoreflect.Message