pinclient

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 12 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 {
	// contains filtered or unexported fields
}

func NewClientRequest

func NewClientRequest(ps core.PinningService) ClientCreateRequest

func (ClientCreateRequest) BearerToken

func (r ClientCreateRequest) BearerToken(token string) ClientCreateRequest

func (ClientCreateRequest) FilePinBaseUrl

func (r ClientCreateRequest) FilePinBaseUrl(url string) ClientCreateRequest

func (ClientCreateRequest) HttpClient

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

func (ClientCreateRequest) PinningServiceBaseUrl

func (r ClientCreateRequest) PinningServiceBaseUrl(url string) ClientCreateRequest

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) PinServiceAPI

Jump to

Keyboard shortcuts

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