Documentation
¶
Overview ¶
Bifrost interface for Pinata Cloud
Index ¶
- type PinataCloud
- func (p *PinataCloud) Config() *types.BridgeConfig
- func (p *PinataCloud) DeleteFile(fileFace interface{}) error
- func (p *PinataCloud) Disconnect() error
- func (p *PinataCloud) IsConnected() bool
- func (p *PinataCloud) Preflight() error
- func (p *PinataCloud) UploadFile(fileFace interface{}) (*types.UploadedFile, error)
- func (p *PinataCloud) UploadFolder(foldFace interface{}) ([]*types.UploadedFile, error)
- func (p *PinataCloud) UploadMultiFile(multiFace interface{}) ([]*types.UploadedFile, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PinataCloud ¶
type PinataCloud struct { // Provider is the name of the cloud storage service to use. Provider types.Provider // DefaultTimeout is the time-to-live for time-dependent pinata operations DefaultTimeout int64 // PublicRead enables public read access to uploaded files. PublicRead bool // Pinata authorization JWT PinataJWT string // UseAsync enables asynchronous operations with go routines. UseAsync bool // Pinata request client Client *request.Client // EnableDebug enables debug logging. EnableDebug bool }
PinataCloud is the Pinata IPFS struct
func (*PinataCloud) Config ¶
func (p *PinataCloud) Config() *types.BridgeConfig
Config returns the Pinata Cloud configuration.
func (*PinataCloud) DeleteFile ¶ added in v0.0.8
func (p *PinataCloud) DeleteFile(fileFace interface{}) error
DeleteFile deletes a file from Pinata and returns an error if one occurs.
Note: DeleteFile requires that a default bucket be set in bifrost.BridgeConfig.
func (*PinataCloud) Disconnect ¶
func (p *PinataCloud) Disconnect() error
Disconnect closes the Pinata connection and returns an error if one occurs.
Disconnect should only be called when the connection is no longer needed.
func (*PinataCloud) IsConnected ¶
func (p *PinataCloud) IsConnected() bool
IsConnected returns true if the Pinata Cloud connection is non nil.
func (*PinataCloud) Preflight ¶
func (p *PinataCloud) Preflight() error
Preflight attempts to authenticate with Pinata and returns an error if one occurs.
func (*PinataCloud) UploadFile ¶
func (p *PinataCloud) UploadFile(fileFace interface{}) (*types.UploadedFile, error)
UploadFile uploads a file to Pinata and returns an error if one occurs.
func (*PinataCloud) UploadFolder ¶
func (p *PinataCloud) UploadFolder(foldFace interface{}) ([]*types.UploadedFile, error)
UploadFolder uploads a folder to the provider storage and returns an error if one occurs.
Note: for some providers, UploadFolder requires that a default bucket be set in bifrost.BridgeConfig.
func (*PinataCloud) UploadMultiFile ¶
func (p *PinataCloud) UploadMultiFile(multiFace interface{}) ([]*types.UploadedFile, error)
UploadMultiFile