pin

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PinCmd = &cmds.Command{
	Helptext: cmds.HelpText{
		Tagline: "Pin (and unpin) objects to local storage.",
	},

	Subcommands: map[string]*cmds.Command{
		"add":    addPinCmd,
		"rm":     rmPinCmd,
		"ls":     listPinCmd,
		"verify": verifyPinCmd,
		"update": updatePinCmd,
		"remote": remotePinCmd,
	},
}

Functions

This section is empty.

Types

type AddPinOutput

type AddPinOutput struct {
	Pins     []string `json:",omitempty"`
	Progress int      `json:",omitempty"`
}

type BadNode

type BadNode struct {
	Cid string
	Err string
}

BadNode is used in PinVerifyRes

type PinCount

type PinCount struct {
	Queued  int
	Pinning int
	Pinned  int
	Failed  int
}

type PinLsList

type PinLsList struct {
	Keys map[string]PinLsType `json:",omitempty"`
}

PinLsList is a set of pins with their type

type PinLsObject

type PinLsObject struct {
	Cid  string `json:",omitempty"`
	Name string `json:",omitempty"`
	Type string `json:",omitempty"`
}

PinLsObject contains the description of a pin

type PinLsOutputWrapper

type PinLsOutputWrapper struct {
	PinLsList
	PinLsObject
}

PinLsOutputWrapper is the output type of the pin ls command. Pin ls needs to output two different type depending on if it's streamed or not. We use this to bypass the cmds lib refusing to have interface{}

type PinLsType

type PinLsType struct {
	Type string
	Name string
}

PinLsType contains the type of a pin

type PinOutput

type PinOutput struct {
	Pins []string
}

type PinServicesList

type PinServicesList struct {
	RemoteServices []ServiceDetails
}

Struct returned by ipfs pin remote service ls --enc=json | jq

func (PinServicesList) Len

func (l PinServicesList) Len() int

func (PinServicesList) Less

func (l PinServicesList) Less(i, j int) bool

func (PinServicesList) Swap

func (l PinServicesList) Swap(i, j int)

type PinStatus

type PinStatus struct {
	Ok       bool      `json:",omitempty"`
	BadNodes []BadNode `json:",omitempty"`
}

PinStatus is part of PinVerifyRes, do not use directly

type PinVerifyRes

type PinVerifyRes struct {
	Cid string `json:",omitempty"`
	Err string `json:",omitempty"`
	PinStatus
}

PinVerifyRes is the result returned for each pin checked in "pin verify"

func (PinVerifyRes) Format

func (r PinVerifyRes) Format(out io.Writer)

Format formats PinVerifyRes

type RemotePinOutput

type RemotePinOutput struct {
	Status string
	Cid    string
	Name   string
}

type ServiceDetails

type ServiceDetails struct {
	Service     string
	ApiEndpoint string //nolint
	Stat        *Stat  `json:",omitempty"` // present only when --stat not passed
}

type Stat

type Stat struct {
	Status   string
	PinCount *PinCount `json:",omitempty"` // missing when --stat is passed but the service is offline
}

Jump to

Keyboard shortcuts

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