clients

package
v0.4.19 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAgent string

Functions

This section is empty.

Types

type BaseClient

type BaseClient struct {
	*http.Client
	BaseUrl     string
	BaseHeaders map[string]string
}

func (*BaseClient) DoRequest

func (c *BaseClient) DoRequest(ctx context.Context, r Request, output interface{}) error

type HTTPStatusError

type HTTPStatusError struct {
	Status int
	Body   string
}

func (*HTTPStatusError) Error

func (e *HTTPStatusError) Error() string

type IPFS

type IPFS interface {
	PinContent(ctx context.Context, name, contentType string, data io.Reader) (cid string, metadata interface{}, err error)
	Unpin(ctx context.Context, cid string) error
	List(ctx context.Context, pageSize, pageOffset int) (*PinList, int, error)
}

func NewPinataClientAPIKey

func NewPinataClientAPIKey(apiKey, apiSecret string, filesMetadata map[string]string) IPFS

func NewPinataClientJWT

func NewPinataClientJWT(jwt string, filesMetadata map[string]string) IPFS

type PinInfo added in v0.4.13

type PinInfo struct {
	ID          string `json:"id"`
	IPFSPinHash string `json:"ipfs_pin_hash"`
	Size        int64  `json:"size"`
	Metadata    struct {
		Name      string            `json:"name"`
		KeyValues map[string]string `json:"keyvalues"`
	} `json:"metadata"`
}

type PinList added in v0.4.13

type PinList struct {
	Count int64     `json:"count"`
	Pins  []PinInfo `json:"rows"`
}

type Request

type Request struct {
	Method, URL string
	Body        io.Reader
	ContentType string
	Headers     map[string]string
}

Jump to

Keyboard shortcuts

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