corerepo

package
v0.0.0-...-7fe9760 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const NoLimit uint64 = math.MaxUint64

nolimit表示无限存储的值

Variables

View Source
var ErrMaxStorageExceeded = errors.New("maximum storage limit exceeded. Try to unpin some files")

Functions

func BestEffortRoots

func BestEffortRoots(filesRoot *mfs.Root) ([]cid.Cid, error)

func CollectResult

func CollectResult(ctx context.Context, gcOut <-chan gc.Result, cb func(cid.Cid)) error

CollectResult收集垃圾收集运行的输出并调用 为删除的每个对象提供回调。它还将所有错误收集到 GC完成后返回的多错误。

func ConditionalGC

func ConditionalGC(ctx context.Context, node *core.IpfsNode, offset uint64) error

func GarbageCollect

func GarbageCollect(n *core.IpfsNode, ctx context.Context) error

func GarbageCollectAsync

func GarbageCollectAsync(n *core.IpfsNode, ctx context.Context) <-chan gc.Result

func PeriodicGC

func PeriodicGC(ctx context.Context, node *core.IpfsNode) error

func Pin

func Pin(pinning pin.Pinner, api iface.CoreAPI, ctx context.Context, paths []string, recursive bool) ([]cid.Cid, error)

func Unpin

func Unpin(pinning pin.Pinner, api iface.CoreAPI, ctx context.Context, paths []string, recursive bool) ([]cid.Cid, error)

Types

type GC

type GC struct {
	Node       *core.IpfsNode
	Repo       repo.Repo
	StorageMax uint64
	StorageGC  uint64
	SlackGB    uint64
	Storage    uint64
}

func NewGC

func NewGC(n *core.IpfsNode) (*GC, error)

type MultiError

type MultiError struct {
	Errors  []error
	Summary error
}

多错误包含多个错误的结果。

func NewMultiError

func NewMultiError(errs ...error) *MultiError

newmultiError从给定的错误切片创建新的multiError对象。

func (*MultiError) Error

func (e *MultiError) Error() string

type SizeStat

type SizeStat struct {
	RepoSize   uint64 //字节大小
	StorageMax uint64 //字节大小
}

sizestat包装有关存储库大小及其限制的信息。

func RepoSize

func RepoSize(ctx context.Context, n *core.IpfsNode) (SizeStat, error)

type Stat

type Stat struct {
	SizeStat
	NumObjects uint64
	RepoPath   string
	Version    string
}

stat包装有关存储在磁盘上的对象的信息。

func RepoStat

func RepoStat(ctx context.Context, n *core.IpfsNode) (Stat, error)

repostat返回一个设置了所有字段的*stat对象。

Jump to

Keyboard shortcuts

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