index

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "filenode.index"

Variables

View Source
var (
	ErrCidsNotExist = errors.New("cids not exist")
)

Functions

This section is empty.

Types

type CidEntries added in v0.5.0

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

func (*CidEntries) Release added in v0.5.0

func (ce *CidEntries) Release()

type FileInfo

type FileInfo struct {
	BytesUsage uint64
	CidsCount  uint64
}

type GroupInfo added in v0.5.0

type GroupInfo struct {
	BytesUsage uint64
	CidsCount  uint64
	SpaceIds   []string
}

type Index

type Index interface {
	FileBind(ctx context.Context, key Key, fileId string, cidEntries *CidEntries) (err error)
	FileUnbind(ctx context.Context, kye Key, fileIds ...string) (err error)
	FileInfo(ctx context.Context, key Key, fileIds ...string) (fileInfo []FileInfo, err error)

	GroupInfo(ctx context.Context, groupId string) (info GroupInfo, err error)
	SpaceInfo(ctx context.Context, key Key) (info SpaceInfo, err error)

	BlocksGetNonExistent(ctx context.Context, bs []blocks.Block) (nonExistent []blocks.Block, err error)
	BlocksLock(ctx context.Context, bs []blocks.Block) (unlock func(), err error)
	BlocksAdd(ctx context.Context, bs []blocks.Block) (err error)

	CidExists(ctx context.Context, c cid.Cid) (ok bool, err error)
	CidEntries(ctx context.Context, cids []cid.Cid) (entries *CidEntries, err error)
	CidEntriesByBlocks(ctx context.Context, bs []blocks.Block) (entries *CidEntries, err error)
	CidExistsInSpace(ctx context.Context, k Key, cids []cid.Cid) (exists []cid.Cid, err error)

	Migrate(ctx context.Context, key Key) error

	SpaceDelete(ctx context.Context, key Key) (ok bool, err error)
	app.ComponentRunnable
}

func New added in v0.5.0

func New() Index

type Key added in v0.5.0

type Key struct {
	GroupId string
	SpaceId string
}

type SpaceInfo

type SpaceInfo struct {
	BytesUsage uint64
	CidsCount  uint64
	FileCount  uint32
}

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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