objects

package
v0.4.22-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Checksum [32]byte
	Length   uint32
}

type CustomMetadata

type CustomMetadata struct {
	Key   string
	Value []byte
}

type Directory

type Directory struct {
	Checksum [32]byte
	FileInfo FileInfo
}

func NewDirectory

func NewDirectory(checksum [32]byte, fileInfo FileInfo) *Directory

func NewDirectoryFromBytes

func NewDirectoryFromBytes(serialized []byte) (*Directory, error)

func (*Directory) Serialize

func (d *Directory) Serialize() ([]byte, error)

type File

type File struct {
	Checksum [32]byte
	FileInfo FileInfo
}

func NewFile

func NewFile(checksum [32]byte, fileInfo FileInfo) *File

func NewFileFromBytes

func NewFileFromBytes(serialized []byte) (*File, error)

func (*File) Serialize

func (f *File) Serialize() ([]byte, error)

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:"ModTime" msgpack:"ModTime"`
	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"`
}

func FileInfoFromStat

func FileInfoFromStat(stat os.FileInfo) FileInfo

func NewFileInfo

func NewFileInfo(name string, size int64, mode os.FileMode, modTime time.Time, dev uint64, ino uint64, uid uint64, gid uint64, nlink uint16) FileInfo

func (FileInfo) Dev

func (f FileInfo) Dev() uint64

func (*FileInfo) Equal

func (fileinfo *FileInfo) Equal(fi *FileInfo) bool

func (FileInfo) Gid

func (f FileInfo) Gid() uint64

func (*FileInfo) HumanSize

func (fileinfo *FileInfo) HumanSize() string

func (FileInfo) Ino

func (f FileInfo) Ino() uint64

func (FileInfo) IsDir

func (f FileInfo) IsDir() bool

func (FileInfo) ModTime

func (f FileInfo) ModTime() time.Time

func (FileInfo) Mode

func (f FileInfo) Mode() os.FileMode

func (FileInfo) Name

func (f FileInfo) Name() string
func (f FileInfo) Nlink() uint16

func (FileInfo) Size

func (f FileInfo) Size() int64

func (FileInfo) Sys

func (f FileInfo) Sys() any

func (FileInfo) Uid

func (f FileInfo) Uid() uint64

type Object

type Object struct {
	Checksum       [32]byte
	Chunks         []Chunk
	ContentType    string
	CustomMetadata []CustomMetadata
	Tags           []string
}

func NewObject

func NewObject() *Object

func NewObjectFromBytes

func NewObjectFromBytes(serialized []byte) (*Object, error)

func (*Object) Serialize

func (o *Object) Serialize() ([]byte, error)

Jump to

Keyboard shortcuts

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