receive

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Creat

func Creat(path string, perm uint32) (int, error)

func FileMode

func FileMode(m uint32) uint32

Types

type Content

type Content struct {
	Signal chan interface{} `json:"-"`

	// ------------------------------------------
	// stack identify which layer should this content be placed, all the files will be referencing the content
	Stack int64 `json:"t"`

	// offset is non-zero if the file is in the delta bundle body
	Offset int64 `json:"o,omitempty"`

	// size is the size of the compressed content
	Size int64 `json:"s"`

	Chunks []*FileChunk `json:"c"`

	Digest string `json:"d"`
}

func (*Content) GetBaseDir

func (c *Content) GetBaseDir() string

func (*Content) GetPath

func (c *Content) GetPath() string

type DeltaBundle

type DeltaBundle struct {
	Source      *Image `json:"s"`
	Destination *Image `json:"d"`

	// contents and BodyLength are computed by Builder.computeDelta()
	Contents   []*Content `json:"c"`
	BodyLength int64      `json:"bl"`

	// RequestedFiles are all the files in the requested images
	// Use this to reconstruct the file system
	RequestedFiles []*ReferencedFile `json:"rf"`
}

type File

type File struct {
	common.TOCEntry
	Chunks []*FileChunk `json:"c,omitempty"`
	FsId   int64        `json:"-"`
}

type FileChunk

type FileChunk struct {
	Offset         int64 `json:"o"`
	ChunkOffset    int64 `json:"c"`
	ChunkSize      int64 `json:"h"`
	CompressedSize int64 `json:"s"`
}

type Image

type Image struct {
	Serial int64         `json:"s"`
	Layers []*ImageLayer `json:"l"`
}

func (Image) String

func (i Image) String() string

type ImageLayer

type ImageLayer struct {
	Size   int64 `json:"s"`
	Serial int64 `json:"f"`

	// Hash is the digest of the compressed layer
	Hash string `json:"h"`

	// path to the local storage
	Local string
}

func (ImageLayer) String

func (il ImageLayer) String() string

type ReferencedFile

type ReferencedFile struct {
	File

	// Stack in the existing image from bottom to top, 0-indexed
	Stack int64 `json:"S"`

	// if the file is available on the client then ReferenceFsId is non-zero,
	// expecting the file is available on the client and can be accessed using the File.Digest .
	// (This is the Serial index in the database `filesystem.id`)
	ReferenceFsId int64 `json:"R,omitempty"`

	// if the file is not available on the client but on other layers in the requested image,
	// then ReferenceFsId is zero and ReferenceStack is non-zero,
	// expecting the file content in the delta bundle body
	// (This is Stack not Serial, 0-indexed)
	ReferenceStack int64 `json:"T,omitempty"`

	// PayloadOrder is set if the file is not available on the client, then PayloadOrder is non-zero.
	// It indicates the order of the file in the delta bundle body (payload)
	PayloadOrder int `json:"O,omitempty"`

	// if Ready is nil or closed, means the file is ready
	Ready *chan interface{} `json:"-"`
	// contains filtered or unexported fields
}

func (*ReferencedFile) AppendChild

func (r *ReferencedFile) AppendChild(children fs.ReceivedFile)

func (*ReferencedFile) GetAttr

func (r *ReferencedFile) GetAttr(out *fuse.Attr) syscall.Errno

func (*ReferencedFile) GetBaseDir

func (r *ReferencedFile) GetBaseDir() string

func (*ReferencedFile) GetChildren

func (r *ReferencedFile) GetChildren() []fs.ReceivedFile

func (*ReferencedFile) GetLinkName

func (r *ReferencedFile) GetLinkName() string

func (*ReferencedFile) GetName

func (r *ReferencedFile) GetName() string

func (*ReferencedFile) GetRealPath

func (r *ReferencedFile) GetRealPath() string

func (*ReferencedFile) GetStableAttr

func (r *ReferencedFile) GetStableAttr() *fuseFs.StableAttr

func (*ReferencedFile) GetXAttrs

func (r *ReferencedFile) GetXAttrs() map[string][]byte

func (*ReferencedFile) InPayload

func (r *ReferencedFile) InPayload() bool

InPayload returns true if the content of the file is in the delta bundle (payload)

func (*ReferencedFile) InitFuseStableAttr

func (r *ReferencedFile) InitFuseStableAttr()

func (*ReferencedFile) IsReady

func (r *ReferencedFile) IsReady() bool

func (*ReferencedFile) IsReferencingLocalFilesystem added in v0.2.1

func (r *ReferencedFile) IsReferencingLocalFilesystem() (serial int64, yes bool)

func (*ReferencedFile) IsReferencingRequestedImage added in v0.2.1

func (r *ReferencedFile) IsReferencingRequestedImage() (stack int64, yes bool)

func (*ReferencedFile) SetBlockSize

func (r *ReferencedFile) SetBlockSize(out *fuse.Attr)

func (*ReferencedFile) WaitForReady

func (r *ReferencedFile) WaitForReady()

Jump to

Keyboard shortcuts

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