fileinfo

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidNameOrAddress = errors.New("invalid name or address")
	ErrNoResolver           = errors.New("no resolver connected")
	ErrNotFound             = errors.New("manifest: not found")
	ErrServerError          = errors.New("manifest: ServerError")
)

Functions

This section is empty.

Types

type ChunkInfoSource

type ChunkInfoSource struct {
	Len         int                      `json:"len"`
	ChunkSource []address.ChunkSourceApi `json:"chunkSource"`
}

type FileInfo

type FileInfo struct {
	// contains filtered or unexported fields
}

func (*FileInfo) AddFile

func (f *FileInfo) AddFile(rootCid boson.Address) error

func (*FileInfo) AddFileMirror added in v1.2.1

func (f *FileInfo) AddFileMirror(next, rootCid boson.Address, ope filestore.Operation) error

func (*FileInfo) DeleteFile

func (f *FileInfo) DeleteFile(rootCid boson.Address) error

func (*FileInfo) DeletedFileMirror added in v1.2.1

func (f *FileInfo) DeletedFileMirror(reference boson.Address) error

func (*FileInfo) FileCounter added in v1.2.1

func (f *FileInfo) FileCounter(rootCid boson.Address) error

func (*FileInfo) GetChunkInfoDiscoverOverlays

func (f *FileInfo) GetChunkInfoDiscoverOverlays(rootCid boson.Address) []address.ChunkInfoOverlay

func (*FileInfo) GetChunkInfoServerOverlays

func (f *FileInfo) GetChunkInfoServerOverlays(rootCid boson.Address) []address.ChunkInfoOverlay

func (*FileInfo) GetChunkInfoSource

func (f *FileInfo) GetChunkInfoSource(rootCid boson.Address) ChunkInfoSource

func (*FileInfo) GetFileList

func (f *FileInfo) GetFileList(page filestore.Page, filter []filestore.Filter, sort filestore.Sort) ([]FileView, int)

func (*FileInfo) GetFileSize

func (f *FileInfo) GetFileSize(rootCid boson.Address) (int64, error)

func (*FileInfo) ManifestView

func (f *FileInfo) ManifestView(ctx context.Context, nameOrHex string, pathVar string, depth int) (*ManifestNode, error)

func (*FileInfo) PinFile

func (f *FileInfo) PinFile(rootCid boson.Address, pinned bool) error

func (*FileInfo) RegisterFile

func (f *FileInfo) RegisterFile(rootCid boson.Address, registered bool) error

func (*FileInfo) Rollback added in v1.2.1

func (f *FileInfo) Rollback(reference, rollback boson.Address) error

type FileView

type FileView struct {
	filestore.FileView
	BvLen int
	Bv    []byte
}

type Interface

type Interface interface {
	GetFileList(page filestore.Page, filter []filestore.Filter, sort filestore.Sort) ([]FileView, int)
	GetFileSize(rootCid boson.Address) (int64, error)
	ManifestView(ctx context.Context, nameOrHex string, pathVar string, depth int) (*ManifestNode, error)
	AddFile(rootCid boson.Address) error
	DeleteFile(rootCid boson.Address) error
	PinFile(rootCid boson.Address, pinned bool) error
	RegisterFile(rootCid boson.Address, registered bool) error
	GetChunkInfoDiscoverOverlays(rootCid boson.Address) []address.ChunkInfoOverlay
	GetChunkInfoServerOverlays(rootCid boson.Address) []address.ChunkInfoOverlay
	GetChunkInfoSource(rootCid boson.Address) ChunkInfoSource
	AddFileMirror(next, rootCid boson.Address, ope filestore.Operation) error
	FileCounter(rootCid boson.Address) error
}

func New

func New(addr boson.Address, db *localstore.DB, logger logging.Logger, resolver resolver.Interface) Interface

type ManifestNode

type ManifestNode struct {
	Type          string                   `json:"type"`
	Hash          string                   `json:"hash,omitempty"`
	Name          string                   `json:"name,omitempty"`
	Size          uint64                   `json:"size,omitempty"`
	Extension     string                   `json:"ext,omitempty"`
	Default       string                   `json:"default,omitempty"`
	ErrDefault    string                   `json:"errDefault,omitempty"`
	MimeType      string                   `json:"mime,omitempty"`
	ReferenceLink string                   `json:"referenceLink,omitempty"`
	Nodes         map[string]*ManifestNode `json:"sub,omitempty"`
}

Jump to

Keyboard shortcuts

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