Documentation ¶
Index ¶
- Constants
- type Client
- func (cl *Client) Equal(other *Client) bool
- func (cl *Client) IsPresent(ctx context.Context, c cid.Cid) (bool, error)
- func (cl *Client) Pin(ctx context.Context, c cid.Cid, k string) error
- func (cl *Client) Unpin(ctx context.Context, c cid.Cid) error
- func (cl *Client) Upload(ctx context.Context, fi fs.File, pro *progress.Tracker) (cid.Cid, error)
- type NewOpt
Constants ¶
const DefaultEndpoint = "https://api.pinata.cloud"
DefaultEndpoint is the default base URL for the Pinata API. It can be overridden with the WithEndpoint option.
const DefaultPSAEndpoint = "https://api.pinata.cloud/psa"
DefaultPSAEndpoint is the default base URL for the Pinata Pinning Service API. It can be overridden with the WithPSAEndpoint option.
const MaxFileSize = 1024 * 1024 * 1024 * 25
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new Client with the given options. The only mandatory option is WithToken; the others have sensible defaults.
type NewOpt ¶
type NewOpt func(options *config) error
NewOpt is an option for the New() function.
func WithEndpoint ¶
WithEndpoint is an option for the New() function which sets the URL of the pinata.cloud endpoint. By default, DefaultEndpoint is used.
func WithHTTPClient ¶
WithHTTPClient is an option for the New() function which sets the http.Client with which to access the endpoint. By default, a new retryablehttp.Client is used.
func WithPSAEndpoint ¶
WithPSAEndpoint is an option for the New() function which sets the URL of the pinata.cloud Pinning Service API endpoint. By default, DefaultPSAEndpoint is used.