dshelp

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 14 modules, 19 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

Overview

Package dshelp provides utilities for parsing and creating datastore keys used by go-ipfs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryFromDsKey

func BinaryFromDsKey(k datastore.Key) ([]byte, error)

BinaryFromDsKey returns the byte slice corresponding to the given Key.

func DsKeyToCidV1

func DsKeyToCidV1(dsKey datastore.Key, codecType uint64) (cid.Cid, error)

DsKeyToCidV1Raw converts the given Key (which should be a raw multihash key) to a Cid V1 of the given type (see https://godoc.org/github.com/ipfs/go-cid#pkg-constants).

func DsKeyToMultihash

func DsKeyToMultihash(dsKey datastore.Key) (mh.Multihash, error)

DsKeyToMultihash converts a dsKey to the corresponding Multihash.

func MultihashToDsKey

func MultihashToDsKey(k mh.Multihash) datastore.Key

MultihashToDsKey creates a Key from the given Multihash. If working with Cids, you can call cid.Hash() to obtain the multihash. Note that different CIDs might represent the same multihash.

func NewKeyFromBinary

func NewKeyFromBinary(rawKey []byte) datastore.Key

NewKeyFromBinary creates a new key from a byte slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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