nftstorage

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PIN_STATUS_QUEUED  = "queued"  // queued
	PIN_STATUS_PINNING = "pinning" // pinning
	PIN_STATUS_PINNED  = "pinned"  // pinned
	PIN_STATUS_FAILED  = "failed"  // failed
)
View Source
const (
	MAX_REQUEST_BODY_SIZE = 1024 * 1024 * 99 // 99 MiB
)

Variables

View Source
var ErrRequestBodyLimit = errors.New("body size max limit 99MiB")

Functions

func NewClient

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

Types

type DealInfo

type DealInfo struct {
	BatchRootCid   string `json:"batchRootCid"`
	LastChange     string `json:"lastChange"`
	Miner          string `json:"miner"`
	Network        string `json:"network"`
	PieceCid       string `json:"pieceCid"`
	Status         string `json:"status"`
	StatusText     string `json:"statusText"`
	ChainDealID    int64  `json:"chainDealID"`
	DealActivation string `json:"dealActivation"`
	DealExpiration string `json:"dealExpiration"`
}

type DeleteResponse200

type DeleteResponse200 struct {
	OK bool `json:"ok"`
}

type FileInfo

type FileInfo struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

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"`
}

type RespErr

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

type RespPut

type RespPut 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"`
	Files   []FileInfo `json:"files"`
	Deals   []DealInfo `json:"deals"`
}

type Response200

type Response200 struct {
	Ok    bool    `json:"ok"`
	Value RespPut `json:"value"`
}

type Response404

type Response404 struct {
	Ok    bool    `json:"ok"`
	Error RespErr `json:"error"`
}

Jump to

Keyboard shortcuts

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