internal

package
v0.0.0-...-3303c59 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolName = "ipfs"

Variables

This section is empty.

Functions

func CIDFromHash

func CIDFromHash(hash []byte, cidType uint64) (cid.Cid, error)

func DetectPartialFile

func DetectPartialFile(ctx context.Context, block blocks.Block) (bool, error)

func IsPartialFile

func IsPartialFile(info *NodeInfo) bool

func NewIPFSHash

func NewIPFSHash(c cid.Cid) core.StorageHash

func PinStatusToRequestStatus

func PinStatusToRequestStatus(status db.PinningStatus) models.RequestStatusType

func RequestStatusToPinStatus

func RequestStatusToPinStatus(statusType models.RequestStatusType) db.PinningStatus

Types

type NodeInfo

type NodeInfo struct {
	Name             string
	CID              cid.Cid
	Type             NodeInfoType
	UnixFSType       pb.Data_DataType
	Size             uint64
	Links            []*format.Link
	IsUnixFS         bool
	IsFileRoot       bool
	DataSize         uint64
	UnixFSBlockSizes []uint64
}

func AnalyzeNode

func AnalyzeNode(ctx context.Context, block blocks.Block) (*NodeInfo, error)

type NodeInfoType

type NodeInfoType string
const (
	NodeTypeRaw      NodeInfoType = "raw"
	NodeTypeProtobuf NodeInfoType = "protobuf"
	NodeTypeUnknown  NodeInfoType = "unknown"
)

Directories

Path Synopsis
api
store/downloader
package downloader contains a cache for downloading blocks from a renterd node.
package downloader contains a cache for downloading blocks from a renterd node.

Jump to

Keyboard shortcuts

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