Documentation ¶
Index ¶
Constants ¶
View Source
const ( Remote mode = iota // Store files to pinning service Local // Store file on local IPFS node )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
The HandlerFunc type is an adapter to allow the use of ordinary functions as IPFS handlers.
type Locally ¶
type Locally struct {
Pinning
}
type Pinner ¶
type Pinner interface { // Pin implements data transmission to the destination service by given buf. It // returns the content-id returned by the local IPFS server or a remote pinning service. Pin(buf []byte) (string, error) // Pin implements directory transmission to the destination service by given path. It // returns the content-id returned by the local IPFS server or a remote pinning service. PinDir(path string) (string, error) }
Pinner is an interface that wraps the Pin method.
type Pinning ¶
type Pinning struct { // It supports both daemon server and remote pinner, defaults to remote pinner. Mode mode Host string Port int // For pinner mode, which normally requires the apikey and secret of the pinning service. Pinner string Apikey string Secret string // contains filtered or unexported fields }
Pinning provides the configuration of pinning services that will be utilized for data storage.
func Options ¶
func Options(options ...PinningOption) Pinning
type PinningOption ¶
type PinningOption func(*Pinning)
func Apikey ¶
func Apikey(k string) PinningOption
func Host ¶
func Host(h string) PinningOption
func Mode ¶
func Mode(m mode) PinningOption
func Port ¶
func Port(p int) PinningOption
func Secret ¶
func Secret(s string) PinningOption
func Uses ¶
func Uses(p string) PinningOption
Click to show internal directories.
Click to hide internal directories.