pinning

package
v0.0.0-...-89def8d Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrPermissionDenied indicates an identity does not have the required athorization.
	ErrPermissionDenied = errors.New("permission denied")

	// PinTimeout is the max time taken to pin a Cid.
	PinTimeout = time.Hour
)

Functions

func GetLocalAddrs

func GetLocalAddrs(ipfs iface.CoreAPI) ([]maddr.Multiaddr, error)

GetLocalAddrs returns a list of addresses announced by the ipfs instance.

Types

type Service

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

Service provides a bucket-based IPFS Pinning Service based on the OpenAPI spec: https://github.com/ipfs/pinning-services-api-spec

func NewService

func NewService(lib *buckets.Buckets, store kt.TxnDatastoreExtended) (*Service, error)

NewService returns a new pinning Service.

func (*Service) AddPin

func (s *Service) AddPin(
	ctx context.Context,
	thread core.ID,
	key string,
	identity did.Token,
	pin openapi.Pin,
) (*openapi.PinStatus, error)

AddPin adds an openapi.Pin to a bucket.

func (*Service) Close

func (s *Service) Close() error

Close the Service.

func (*Service) GetPin

func (s *Service) GetPin(
	ctx context.Context,
	thread core.ID,
	key string,
	identity did.Token,
	id string,
) (*openapi.PinStatus, error)

GetPin returns an openapi.PinStatus.

func (*Service) ListPins

func (s *Service) ListPins(
	ctx context.Context,
	thread core.ID,
	key string,
	identity did.Token,
	query q.Query,
) ([]openapi.PinStatus, error)

ListPins returns a list of openapi.PinStatus matching the Query.

func (*Service) RemovePin

func (s *Service) RemovePin(
	ctx context.Context,
	thread core.ID,
	key string,
	identity did.Token,
	id string,
) error

RemovePin removes an openapi.PinStatus from a bucket.

func (*Service) ReplacePin

func (s *Service) ReplacePin(
	ctx context.Context,
	thread core.ID,
	key string,
	identity did.Token,
	id string,
	pin openapi.Pin,
) (*openapi.PinStatus, error)

ReplacePin replaces an openapi.PinStatus with another.

Directories

Path Synopsis
openapi
go

Jump to

Keyboard shortcuts

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