common

package
v0.0.0-...-939bb7a Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ClipHeaderLength            = 54
	ClipFileFormatVersion uint8 = 0x01
)

Variables

View Source
var (
	ErrFileHeaderMismatch = errors.New("unexpected file header")
	ErrCrcMismatch        = errors.New("crc64 mismatch")
	ErrMissingArchiveRoot = errors.New("no root node found")
)
View Source
var ClipFileStartBytes []byte = []byte{0x89, 0x43, 0x4C, 0x49, 0x50, 0x0D, 0x0A, 0x1A, 0x0A}

Functions

This section is empty.

Types

type BlockType

type BlockType byte
const (
	BlockTypeFile BlockType = iota
)

type ClipArchiveHeader

type ClipArchiveHeader struct {
	StartBytes            [9]byte
	ClipFileFormatVersion uint8
	IndexLength           int64
	IndexPos              int64
	StorageInfoLength     int64
	StorageInfoPos        int64
	StorageInfoType       [12]byte
}

type ClipArchiveMetadata

type ClipArchiveMetadata struct {
	Header      ClipArchiveHeader
	Index       *btree.BTree
	StorageInfo ClipStorageInfo
}

func (*ClipArchiveMetadata) Get

func (m *ClipArchiveMetadata) Get(path string) *ClipNode

func (*ClipArchiveMetadata) Insert

func (m *ClipArchiveMetadata) Insert(node *ClipNode)

func (*ClipArchiveMetadata) ListDirectory

func (m *ClipArchiveMetadata) ListDirectory(path string) []fuse.DirEntry

type ClipNode

type ClipNode struct {
	NodeType    ClipNodeType
	Path        string
	Attr        fuse.Attr
	Target      string
	ContentHash string
	DataPos     int64 // Position of the nodes data in the final binary
	DataLen     int64 // Length of the nodes data
}

func (*ClipNode) IsDir

func (n *ClipNode) IsDir() bool

IsDir returns true if the ClipNode represents a directory.

func (n *ClipNode) IsSymlink() bool

IsSymlink returns true if the ClipNode represents a symlink.

type ClipNodeType

type ClipNodeType string
const (
	DirNode     ClipNodeType = "dir"
	FileNode    ClipNodeType = "file"
	SymLinkNode ClipNodeType = "symlink"
)

type ClipStorageInfo

type ClipStorageInfo interface {
	Type() string
	Encode() ([]byte, error)
}

type S3StorageInfo

type S3StorageInfo struct {
	Bucket string
	Region string
	Key    string
}

Storage Info Implementations

func (S3StorageInfo) Encode

func (ssi S3StorageInfo) Encode() ([]byte, error)

func (S3StorageInfo) Type

func (ssi S3StorageInfo) Type() string

type StorageInfoWrapper

type StorageInfoWrapper struct {
	Type string
	Data []byte
}

Storage info is a structure containing data describing remote storage config

Jump to

Keyboard shortcuts

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