pinner

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOpts = &PinManagerOpts{
	MaxActivePerUser: 15,
}

Functions

This section is empty.

Types

type PinManager

type PinManager struct {
	RunPinFunc       PinFunc
	StatusChangeFunc PinStatusFunc
	// contains filtered or unexported fields
}

func NewPinManager

func NewPinManager(pinfunc PinFunc, scf PinStatusFunc, opts *PinManagerOpts) *PinManager

func (*PinManager) Add

func (pm *PinManager) Add(op *PinningOperation)

func (*PinManager) PinQueueSize

func (pm *PinManager) PinQueueSize() int

func (*PinManager) Run

func (pm *PinManager) Run(workers int)

type PinManagerOpts

type PinManagerOpts struct {
	MaxActivePerUser int
}

type PinProgressCB

type PinProgressCB func(int64)

type PinStatusFunc

type PinStatusFunc func(contID uint, location string, status types.PinningStatus) error

type PinningOperation

type PinningOperation struct {
	Obj   cid.Cid
	Name  string
	Peers []*peer.AddrInfo
	Meta  string

	Status types.PinningStatus

	UserId  uint
	ContId  uint
	Replace uint

	LastUpdate time.Time

	Started     time.Time
	NumFetched  int
	SizeFetched int64
	FetchErr    error
	EndTime     time.Time

	Location string

	SkipLimiter bool

	MakeDeal bool
	// contains filtered or unexported fields
}

TODO: some of these fields are overkill for the generalized pin manager thing, but are still in use by the primary estuary node. Should probably find a way to decouple this better

func (*PinningOperation) PinStatus

func (po *PinningOperation) PinStatus() *types.IpfsPinStatusResponse

func (*PinningOperation) SetStatus

func (po *PinningOperation) SetStatus(st types.PinningStatus)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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