Documentation ¶
Index ¶
- Variables
- func GetLocalAddrs(ipfs iface.CoreAPI) ([]maddr.Multiaddr, error)
- type Service
- func (s *Service) AddPin(ctx context.Context, thread core.ID, key string, identity did.Token, ...) (*openapi.PinStatus, error)
- func (s *Service) Close() error
- func (s *Service) GetPin(ctx context.Context, thread core.ID, key string, identity did.Token, id string) (*openapi.PinStatus, error)
- func (s *Service) ListPins(ctx context.Context, thread core.ID, key string, identity did.Token, ...) ([]openapi.PinStatus, error)
- func (s *Service) RemovePin(ctx context.Context, thread core.ID, key string, identity did.Token, id string) error
- func (s *Service) ReplacePin(ctx context.Context, thread core.ID, key string, identity did.Token, id string, ...) (*openapi.PinStatus, error)
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 ¶
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) 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.
Click to show internal directories.
Click to hide internal directories.