pinclient

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

contains client to register and interact with a IPFS remote pinning service + with the custom endpoints for file/car upload for supported service TODO: might want to separate out the custom endpoints

Index

Constants

View Source
const UserAgent = "ipfs-pinner"

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOption

type AddOption func(options *addSettings) error

type Client

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

func (*Client) Add

func (c *Client) Add(ctx context.Context, cid cid.Cid, opts ...AddOption) (core.PinStatusGetter, error)

func (*Client) IsIPFSSupportedFor

func (c *Client) IsIPFSSupportedFor(ps core.PinningService) bool

func (*Client) ServiceType

func (c *Client) ServiceType() core.PinningService

func (*Client) UploadFile

func (c *Client) UploadFile(ctx context.Context, file *os.File) (cid.Cid, error)

type ClientCreateRequest

type ClientCreateRequest struct {
	W3_AgentKey            string
	W3_AgentDid            did.DID
	W3_DelegationProofPath string
	GC_Enable              bool
	// contains filtered or unexported fields
}

func NewClientRequest

func NewClientRequest(ps core.PinningService) ClientCreateRequest

func (ClientCreateRequest) DelegationProofPath added in v1.0.0

func (r ClientCreateRequest) DelegationProofPath(proofPath string) ClientCreateRequest

func (ClientCreateRequest) FilePinBaseUrl

func (r ClientCreateRequest) FilePinBaseUrl(url string) ClientCreateRequest

func (ClientCreateRequest) GcEnable added in v1.1.0

func (r ClientCreateRequest) GcEnable(gcEnable bool) ClientCreateRequest

func (ClientCreateRequest) HttpClient

func (r ClientCreateRequest) HttpClient(client http.Client) ClientCreateRequest

func (ClientCreateRequest) PinningServiceBaseUrl

func (r ClientCreateRequest) PinningServiceBaseUrl(url string) ClientCreateRequest

func (ClientCreateRequest) W3AgentDid added in v1.0.0

func (r ClientCreateRequest) W3AgentDid(did did.DID) ClientCreateRequest

func (ClientCreateRequest) W3AgentKey added in v1.0.0

type PinServiceAPI

type PinServiceAPI interface {
	IsIPFSSupportedFor(ps core.PinningService) bool
	Add(ctx context.Context, cid cid.Cid, opts ...AddOption) (core.PinStatusGetter, error)
	UploadFile(ctx context.Context, file *os.File) (cid.Cid, error)
	ServiceType() core.PinningService
}

func NewClient

func NewClient(request ClientCreateRequest, cidVersion int, w3up *w3up.W3up) PinServiceAPI

Jump to

Keyboard shortcuts

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