Documentation
¶
Index ¶
- Constants
- func ParseFileInfoSortKeys(sortKeysStr string) ([]string, error)
- func SortFileInfos(infos []FileInfo, sortKeys []string) error
- type Attribute
- type CachedPath
- type Chunk
- type FileInfo
- func (f FileInfo) Dev() uint64
- func (fileinfo *FileInfo) Equal(fi *FileInfo) bool
- func (fileinfo *FileInfo) EqualIgnoreSize(fi *FileInfo) bool
- func (f FileInfo) Gid() uint64
- func (f FileInfo) Groupname() string
- func (fileinfo *FileInfo) HumanSize() string
- func (f FileInfo) Ino() uint64
- func (f FileInfo) IsDir() bool
- func (f FileInfo) ModTime() time.Time
- func (f FileInfo) Mode() os.FileMode
- func (f FileInfo) Name() string
- func (f FileInfo) Nlink() uint16
- func (f FileInfo) Size() int64
- func (f FileInfo) Sys() any
- func (fileinfo *FileInfo) Type() string
- func (f FileInfo) Uid() uint64
- func (f FileInfo) Username() string
- type MAC
- type Object
Constants ¶
View Source
const CHUNK_VERSION = "1.0.0"
View Source
const OBJECT_VERSION = "1.0.0"
Variables ¶
This section is empty.
Functions ¶
func ParseFileInfoSortKeys ¶
func SortFileInfos ¶
Types ¶
type CachedPath ¶ added in v1.0.3
type CachedPath struct {
MAC MAC `msgpack:"MAC"`
ObjectMAC MAC `msgpack:"objectMAC"`
FileInfo FileInfo `msgpack:"fileinfo"`
Chunks uint64 `msgpack:"chunks"`
Entropy float64 `msgpack:"entropy"`
ContentType string `msgpack:"content_type"`
}
func NewCachedPathFromBytes ¶ added in v1.0.3
func NewCachedPathFromBytes(serialized []byte) (*CachedPath, error)
func (*CachedPath) Serialize ¶ added in v1.0.3
func (o *CachedPath) Serialize() ([]byte, error)
func (*CachedPath) Stat ¶ added in v1.0.3
func (o *CachedPath) Stat() *FileInfo
type Chunk ¶
type Chunk struct {
Version versioning.Version `msgpack:"version" json:"version"`
ContentMAC MAC `msgpack:"contentMAC" json:"contentMAC"`
Length uint32 `msgpack:"length" json:"length"`
Entropy float64 `msgpack:"entropy" json:"entropy"`
Flags uint32 `msgpack:"flags" json:"flags"`
}
func NewChunkFromBytes ¶
func (*Chunk) MarshalJSON ¶
type FileInfo ¶
type FileInfo struct {
Lname string `json:"name" msgpack:"name"`
Lsize int64 `json:"size" msgpack:"size"`
Lmode fs.FileMode `json:"mode" msgpack:"mode"`
LmodTime time.Time `json:"mod_time" msgpack:"mod_time"`
Ldev uint64 `json:"dev" msgpack:"dev"`
Lino uint64 `json:"ino" msgpack:"ino"`
Luid uint64 `json:"uid" msgpack:"uid"`
Lgid uint64 `json:"gid" msgpack:"gid"`
Lnlink uint16 `json:"nlink" msgpack:"nlink"`
Lusername string `json:"username" msgpack:"username"` // local addition
Lgroupname string `json:"groupname" msgpack:"groupname"` // local addition
// Just in case we need something special to handle special
// OSes.
Flags uint32 `json:"flags" msgpack:"flags"`
}
Danger: If you add any fields here, be sure to adapt the Equal and EqualIgnoreSize methods.
func FileInfoFromStat ¶
func NewFileInfo ¶
func (*FileInfo) EqualIgnoreSize ¶
type MAC ¶
type MAC [32]byte
var (
NilMac MAC
)
func (MAC) MarshalJSON ¶
func (*MAC) UnmarshalJSON ¶
type Object ¶
type Object struct {
Version versioning.Version `msgpack:"version" json:"version"`
ContentMAC MAC `msgpack:"contentMAC" json:"contentMAC"`
Chunks []Chunk `msgpack:"chunks" json:"-"`
ContentType string `msgpack:"content_type,omitempty" json:"content_type"`
Entropy float64 `msgpack:"entropy,omitempty" json:"entropy"`
Flags uint32 `msgpack:"flags" json:"flags"`
}
func NewObjectFromBytes ¶
Click to show internal directories.
Click to hide internal directories.