models

package
v0.1.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delegates

type Delegates []string

Delegates - List of multiaddrs designated by pinning service that will receive the pin data; see Provider Hints in the docs

type Failure

type Failure struct {
	Error FailureError `json:"error"`
}

Failure - Response for a failed request

func NewAPIError

func NewAPIError(Status int, Details string) Failure

type FailureError

type FailureError struct {

	// Mandatory string identifying the type of error
	Reason string `json:"reason"`

	// Optional, longer description of the error; may include UUID of transaction for support, links to documentation etc
	Details string `json:"details,omitempty"`
}

type Origins

type Origins []string

Origins - Optional list of multiaddrs known to provide the data; see Provider Hints in the docs

type Pin

type Pin struct {

	// Content Identifier (CID) to be pinned recursively
	Cid string `json:"cid"`

	// Optional name for pinned data; can be used for lookups later
	Name string `json:"name,omitempty"`

	Origins Origins `json:"origins,omitempty"`

	Meta PinMeta `json:"meta,omitempty"`
}

Pin - Pin object

type PinMeta

type PinMeta map[string]string

PinMeta - Optional metadata for pin object

type PinResults

type PinResults struct {

	// The total number of pin objects that exist for passed query filters
	Count int32 `json:"count"`

	// An array of PinStatus results
	Results []PinStatus `json:"results"`
}

PinResults - Response used for listing pin objects matching request

type PinStatus

type PinStatus struct {

	// Globally unique identifier of the pin request; can be used to check the status of ongoing pinning, or pin removal
	Requestid string `json:"requestid"`

	Status Status `json:"status"`

	// Immutable timestamp indicating when a pin request entered a pinning service; can be used for filtering results and pagination
	Created time.Time `json:"created"`

	Pin Pin `json:"pin"`

	Delegates Delegates `json:"delegates"`

	Info StatusInfo `json:"info,omitempty"`
}

PinStatus - Pin object with status

type Status

type Status string

Status : Status a pin object can have at a pinning service

const (
	QUEUED  Status = "queued"
	PINNING Status = "pinning"
	PINNED  Status = "pinned"
	FAILED  Status = "failed"
)

List of Status

type StatusInfo

type StatusInfo struct {
}

StatusInfo - Optional info for PinStatus response

type TextMatchingStrategy

type TextMatchingStrategy string

TextMatchingStrategy : Alternative text matching strategy

const (
	EXACT    TextMatchingStrategy = "exact"
	IEXACT   TextMatchingStrategy = "iexact"
	PARTIAL  TextMatchingStrategy = "partial"
	IPARTIAL TextMatchingStrategy = "ipartial"
)

List of TextMatchingStrategy

Jump to

Keyboard shortcuts

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