dshelp

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 4 Imported by: 60

README

go-ipfs-ds-help

standard-readme compliant GoDoc Build Status

go-ipfs-ds-help provides utilities for parsing and creating datastore keys used by go-ipfs.

❗ This repo is no longer maintained.

👉 We highly recommend switching to the maintained version at https://github.com/ipfs/boxo/tree/main/datastore/dshelp. 🏎️ Good news! There is tooling and documentation to expedite a switch in your repo.

⚠️ If you continue using this repo, please note that security fixes will not be provided (unless someone steps in to maintain it).

📚 Learn more, including how to take the maintainership mantle or ask questions, here.

Table of Contents

Install

go-ipfs-ds-help works like a regular Go module:

> go get github.com/ipfs/go-ipfs-ds-help

Usage

import "github.com/ipfs/go-ipfs-ds-help"

Check the GoDoc documentation

This module uses Gx to manage dependencies. You can use make all to build it with the gx dependencies.

License

MIT © Protocol Labs, Inc.

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 deprecated

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

BinaryFromDsKey returns the byte slice corresponding to the given Key.

Deprecated: use github.com/ipfs/boxo/datastore/dshelp.BinaryFromDsKey

func DsKeyToCidV1 deprecated added in v0.1.0

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).

Deprecated: use github.com/ipfs/boxo/datastore/dshelp.DsKeyToCidV1

func DsKeyToMultihash deprecated added in v0.1.0

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

DsKeyToMultihash converts a dsKey to the corresponding Multihash.

Deprecated: use github.com/ipfs/boxo/datastore/dshelp.DsKeyToMultihash

func MultihashToDsKey deprecated added in v0.1.0

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.

Deprecated: use github.com/ipfs/boxo/datastore/dshelp.MultihashToDsKey

func NewKeyFromBinary deprecated

func NewKeyFromBinary(rawKey []byte) datastore.Key

NewKeyFromBinary creates a new key from a byte slice.

Deprecated: use github.com/ipfs/boxo/datastore/dshelp.NewKeyFromBinary

Types

This section is empty.

Jump to

Keyboard shortcuts

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