pinningservice

package
v0.43.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(authToken string, svc *PinningService) http.Handler

Types

type AddPinRequest

type AddPinRequest struct {
	CID     string         `json:"cid"`
	Name    string         `json:"name"`
	Origins []string       `json:"origins"`
	Meta    map[string]any `json:"meta"`
}

type ListPinsResponse

type ListPinsResponse struct {
	Count   int          `json:"count"`
	Results []*PinStatus `json:"results"`
}

type Pin

type Pin struct {
	CID     string         `json:"cid"`
	Name    string         `json:"name"`
	Origins []string       `json:"origins"`
	Meta    map[string]any `json:"meta"`
}

type PinStatus

type PinStatus struct {
	M         sync.Mutex
	RequestID string
	Status    string
	Created   time.Time
	Pin       Pin
	Delegates []string
	Info      map[string]any
}

func (*PinStatus) Clone

func (p *PinStatus) Clone() PinStatus

func (*PinStatus) MarshalJSON

func (p *PinStatus) MarshalJSON() ([]byte, error)

type PinningService

type PinningService struct {

	// PinAdded is a callback that is invoked after a new pin is added via the API.
	PinAdded func(*AddPinRequest, *PinStatus)
	// contains filtered or unexported fields
}

PinningService is a basic pinning service that implements the Remote Pinning API, for testing Kubo's integration with remote pinning services. Pins are not persisted, they are just kept in-memory, and this provides callbacks for controlling the behavior of the pinning service.

func New

func New() *PinningService

Jump to

Keyboard shortcuts

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