infura

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: 9 Imported by: 0

Documentation

Overview

Infura is a freemium pinning service that doesn't require any additional setup. Please bear in mind that Infura is a free service, so there is probably a rate-limiting. Docs: https://infura.io/docs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PinFile deprecated

func PinFile(fp string) (string, error)

PinFile alias to *Infura.PinFile, the purpose is to be backwards compatible with the original function.

Deprecated: use `Infura.PinFile` instead.

func PinHash

func PinHash(hash string) (bool, error)

PinHash alias to *Infura.PinHash, the purpose is to be backwards compatible with the original function.

Types

type Infura

type Infura struct {
	*http.Client

	Apikey string
	Secret string
}

Infura represents an Infura configuration. If there is no Apikey or Secret, it will make API calls using anonymous requests.

func (*Infura) PinDir

func (inf *Infura) PinDir(mfr *files.MultiFileReader) (string, error)

PinDir pins a directory to the Infura pinning service.

func (*Infura) PinFile

func (inf *Infura) PinFile(fp string) (string, error)

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

func (*Infura) PinHash

func (inf *Infura) PinHash(hash string) (bool, error)

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

func (*Infura) PinWithBytes

func (inf *Infura) PinWithBytes(buf []byte) (string, error)

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

func (*Infura) PinWithReader

func (inf *Infura) PinWithReader(rd io.Reader) (string, error)

PinWithReader pins content to Infura 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