pinata

package
v1.1.0-no-httpretry-fix Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Pinata is another freemium pinning service. It gives you more control over what's uploaded. You can delete, label and add custom metadata. This service requires signup. https://www.pinata.cloud/documentation

Index

Constants

View Source
const (
	PIN_FILE_URL = "https://api.pinata.cloud/pinning/pinFileToIPFS"
	PIN_HASH_URL = "https://api.pinata.cloud/pinning/pinByHash"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pinata

type Pinata struct {
	*http.Client

	Apikey string
	Secret string
}

Pinata represents a Pinata configuration.

func (*Pinata) PinDir

func (p *Pinata) PinDir(name string) (string, error)

PinDir pins a directory to the Pinata pinning service. It alias to PinFile.

func (*Pinata) PinFile

func (p *Pinata) PinFile(fp string) (string, error)

PinFile pins content to Pinata by providing a file path, it returns an IPFS hash and an error.

func (*Pinata) PinHash

func (p *Pinata) PinHash(hash string) (bool, error)

PinHash pins content to Pinata by giving an IPFS hash, it returns the result and an error.

func (*Pinata) PinWithBytes

func (p *Pinata) PinWithBytes(buf []byte) (string, error)

PinWithBytes pins content to Infura by given byte slice, it returns an IPFS hash and an error.

func (*Pinata) PinWithReader

func (p *Pinata) PinWithReader(rd io.Reader) (string, error)

PinWithReader pins content to Pinata by given io.Reader, it returns an IPFS hash and an error.

Jump to

Keyboard shortcuts

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