go-ipfs: github.com/ipfs/go-ipfs/core/corerepo Index | Files

package corerepo

import "github.com/ipfs/go-ipfs/core/corerepo"


Package Files

gc.go stat.go


const NoLimit uint64 = math.MaxUint64

NoLimit represents the value for unlimited storage


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

func BestEffortRoots Uses

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

func CollectResult Uses

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

CollectResult collects the output of a garbage collection run and calls the given callback for each object removed. It also collects all errors into a MultiError which is returned after the gc is completed.

func ConditionalGC Uses

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

func GarbageCollect Uses

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

func GarbageCollectAsync Uses

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

func PeriodicGC Uses

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

type GC Uses

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

func NewGC Uses

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

type MultiError Uses

type MultiError struct {
    Errors  []error
    Summary error

MultiError contains the results of multiple errors.

func NewMultiError Uses

func NewMultiError(errs ...error) *MultiError

NewMultiError creates a new MultiError object from a given slice of errors.

func (*MultiError) Error Uses

func (e *MultiError) Error() string

type SizeStat Uses

type SizeStat struct {
    RepoSize   uint64 // size in bytes
    StorageMax uint64 // size in bytes

SizeStat wraps information about the repository size and its limit.

func RepoSize Uses

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

RepoSize returns a *Stat object with the RepoSize and StorageMax fields set.

type Stat Uses

type Stat struct {
    NumObjects uint64
    RepoPath   string
    Version    string

Stat wraps information about the objects stored on disk.

func RepoStat Uses

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

RepoStat returns a *Stat object with all the fields set.

Package corerepo imports 14 packages (graph) and is imported by 98 packages. Updated 2020-02-22. Refresh now. Tools for package owners.