nftstorage

package
v0.0.0-...-52a59c7 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(name string, opts ...Option) (*client, error)

Types

type ClientConfig

type ClientConfig struct {
	Mimes       []string
	Endpoint    string
	AccessToken string
}

type ErrorDetails

type ErrorDetails struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

type Metadata

type Metadata struct {
	CID     string    `json:"cid"`
	Size    int64     `json:"size"`
	Created string    `json:"created"`
	Type    string    `json:"type"`
	Scope   string    `json:"scope"`
	Pin     PinStatus `json:"pin"`
}

type NftErrorResponse

type NftErrorResponse struct {
	Ok    bool         `json:"ok"`
	Error ErrorDetails `json:"error"`
}

type NftSuccessResponse

type NftSuccessResponse struct {
	Ok    bool     `json:"ok"`
	Value Metadata `json:"value"`
}

type Option

type Option func(*ClientConfig) error

func WithEndpoint

func WithEndpoint(endpoint string) Option

func WithMimes

func WithMimes(mimes ...string) Option

func WithToken

func WithToken(accessToken string) Option

type PinStatus

type PinStatus struct {
	CID     string                 `json:"cid"`
	Size    int64                  `json:"size"`
	Name    string                 `json:"name"`
	Meta    map[string]interface{} `json:"meta"`
	Status  string                 `json:"status"` // [ queued, pinning, pinned, failed ]
	Created string                 `json:"created"`
}

Jump to

Keyboard shortcuts

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