pinner

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Apache-2.0, MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColDir string = "dir"
)

Variables

View Source
var DefaultOpts = &PinManagerOpts{
	MaxActivePerUser: 15,
	QueueDataDir:     "/tmp/",
}

Functions

func GetPin added in v0.3.9

func GetPin(param GetPinParam) (*types.IpfsPinStatusResponse, error)

GetPinStatus returns the status of a pin operation

func PinCidAndRequestMakeDeal added in v0.3.9

func PinCidAndRequestMakeDeal(param PinCidParam) (*types.IpfsPinStatusResponse, *operation.PinningOperation, error)

PinCidAndQueue adds a cid to the pin queue, and pins it if possible

Types

type EstuaryPinManager added in v0.3.0

type EstuaryPinManager struct {
	*PinManager
	// contains filtered or unexported fields
}

func NewEstuaryPinManager added in v0.3.0

func NewEstuaryPinManager(pinfunc PinFunc, scf PinStatusFunc, opts *PinManagerOpts, cm *contentmgr.ContentManager, shuttleMgr shuttle.IManager) *EstuaryPinManager

func (*EstuaryPinManager) RunPinningRetryWorker added in v0.3.0

func (pm *EstuaryPinManager) RunPinningRetryWorker(ctx context.Context, db *gorm.DB, cfg *config.Estuary)

RunPinningRetryWorker re-attempt pinning contents that have not yet been pinned after a period of time

type GetPinParam added in v0.3.9

type GetPinParam struct {
	Ctx      echo.Context
	CM       *contentmgr.ContentManager
	Db       *gorm.DB
	User     *util.User
	CidToGet string
}

type PinCidParam added in v0.3.9

type PinCidParam struct {
	Ctx              echo.Context
	CM               *contentmgr.ContentManager
	Db               *gorm.DB
	User             *util.User
	CidToPin         types.IpfsPin
	Overwrite        bool
	IgnoreDuplicates bool
	MakeDeal         bool `default:"true"`
}

type PinManager

type PinManager struct {
	RunPinFunc       PinFunc
	StatusChangeFunc PinStatusFunc

	QueueDataDir string
	// contains filtered or unexported fields
}

func NewShuttlePinManager added in v0.3.0

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

func (*PinManager) Add

func (pm *PinManager) Add(op *operation.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
	QueueDataDir     string
}

type PinStatusFunc

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

type PinningHelperError added in v0.3.9

type PinningHelperError struct {
	Reason  string
	Details string
	// contains filtered or unexported fields
}

type PinningOperationData added in v0.1.11

type PinningOperationData struct {
	ContId uint64
}

type ShuttleManager added in v0.3.0

type ShuttleManager struct {
	*PinManager
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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