core

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Pinata      PinningService = "pinata"
	Web3Storage PinningService = "web3.storage"
	Other       PinningService = "other"
	// IpfsPinnerVersionMajor is Major version component of the current release
	IpfsPinnerVersionMajor = 1
	// IpfsPinnerVersionMinor is Minor version component of the current release
	IpfsPinnerVersionMinor = 1
	// IpfsPinnerVersionPatch is Patch version component of the current release
	IpfsPinnerVersionPatch = 0
)

Variables

View Source
var IpfsPinnerVersion = func() string {
	return fmt.Sprintf("%d.%d.%d", IpfsPinnerVersionMajor, IpfsPinnerVersionMinor, IpfsPinnerVersionPatch)
}()

IpfsPinnerVersion holds the textual version string.

Functions

func CreateIpfsNode added in v0.1.8

func CreateIpfsNode(ctx context.Context, cidComputeOnly bool) (*core.IpfsNode, error)

returns a go-ipfs node backend CoreAPI instance

func Version added in v0.1.12

func Version()

Version Provides version info on bsp agent binary

Types

type CidGetter

type CidGetter interface {
	GetCid() cid.Cid
}

type PinGetter

type PinGetter interface {
	fmt.Stringer
	json.Marshaler
	// CID to be pinned recursively
	GetCid() cid.Cid
	// Optional name for pinned data; can be used for lookups later
	GetName() string
	// Optional list of multiaddrs known to provide the data
	GetOrigins() []string
	// Optional metadata for pin object
	GetMeta() map[string]string
}

PinGetter Getter for Pin object

type PinStatusGetter

type PinStatusGetter interface {
	fmt.Stringer
	json.Marshaler
	// Globally unique ID of the pin request; can be used to check the status of ongoing pinning, modification of pin object, or pin removal
	GetRequestId() string
	GetStatus() Status
	// Immutable timestamp indicating when a pin request entered a pinning service; can be used for filtering results and pagination
	GetCreated() time.Time
	GetPin() PinGetter
	// List of multiaddrs designated by pinning service for transferring any new data from external peers
	GetDelegates() []multiaddr.Multiaddr
	// Optional info for PinStatus response
	GetInfo() map[string]string
}

PinStatusGetter Getter for Pin object with status

func NewPinStatusGetter

func NewPinStatusGetter(status openapi.PinStatus) PinStatusGetter

type PinataResponseGetter

type PinataResponseGetter interface {
	fmt.Stringer
	json.Marshaler
	CidGetter
	GetPinSize() int32
	GetTimestamp() int64 // epoch in millis
}

PinataResponseGetter Getter for PinataResponse object

func NewPinataResponseGetter

func NewPinataResponseGetter(res openapi.PinataResponse) PinataResponseGetter

type PinningService

type PinningService string

func (PinningService) GetFilePinBaseUrl

func (f PinningService) GetFilePinBaseUrl() string

func (PinningService) GetPinningServiceBaseUrl

func (f PinningService) GetPinningServiceBaseUrl() string

func (PinningService) String

func (f PinningService) String() string

type Status

type Status string
const (
	StatusUnknown Status = ""
	StatusQueued  Status = Status(openapi.QUEUED)
	StatusPinning Status = Status(openapi.PINNING)
	StatusPinned  Status = Status(openapi.PINNED)
	StatusFailed  Status = Status(openapi.FAILED)
)

func (Status) String

func (s Status) String() string

type Web3StorageResponseGetter

type Web3StorageResponseGetter interface {
	fmt.Stringer
	json.Marshaler
	CidGetter
}

PinataResponseGetter Getter for PinataResponse object

Jump to

Keyboard shortcuts

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