Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Deprecate repo #113

Merged
merged 4 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions README.md
guseggert marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
interface-go-ipfs-core
==================

> The CoreAPI interfaces for go-ipfs.

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)
[![Coverage Status](https://codecov.io/gh/ipfs/interface-go-ipfs-core/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/interface-go-ipfs-core/branch/master)

> The CoreAPI interfaces for go-ipfs.
## ❗ This repo is no longer maintained.
👉 We highly recommend switching to the maintained version at https://github.com/ipfs/boxo/tree/main/coreiface.
🏎️ Good news! There is [tooling and documentation](https://github.com/ipfs/boxo#migrating-to-boxo) to expedite a switch in your repo.

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

[Steven Allen](https://github.com/Stebalien)
📚 Learn more, including how to take the maintainership mantle or ask questions, [here](https://github.com/ipfs/boxo/wiki/Copied-or-Migrated-Repos-FAQ).

## Table of Contents

- [Background](#background)
- [Contribute](#contribute)
- [Background](#background
- [License](#license)

## Documentation

TODO

## Contribute

PRs are welcome!

Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.

## License

MIT © Protocol Labs
4 changes: 4 additions & 0 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
)

// BlockStat contains information about a block
//
// Deprecated: use github.com/ipfs/boxo/coreiface.BlockStat
type BlockStat interface {
// Size is the size of a block
Size() int
Expand All @@ -19,6 +21,8 @@ type BlockStat interface {
}

// BlockAPI specifies the interface to the block layer
//
// Deprecated: use github.com/ipfs/boxo/coreiface.BlockAPI
type BlockAPI interface {
// Put imports raw block data, hashing it using specified settings.
Put(context.Context, io.Reader, ...options.BlockPutOption) (BlockStat, error)
Expand Down
2 changes: 2 additions & 0 deletions coreapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
)

// CoreAPI defines an unified interface to IPFS for Go programs
//
// Deprecated: use github.com/ipfs/boxo/coreiface.CoreAPI
type CoreAPI interface {
// Unixfs returns an implementation of Unixfs API
Unixfs() UnixfsAPI
Expand Down
2 changes: 2 additions & 0 deletions dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
)

// APIDagService extends ipld.DAGService
//
// Deprecated: use github.com/ipfs/boxo/coreiface.APIDagService
type APIDagService interface {
ipld.DAGService

Expand Down
2 changes: 2 additions & 0 deletions dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
// DhtAPI specifies the interface to the DHT
// Note: This API will likely get deprecated in near future, see
// https://github.com/ipfs/interface-ipfs-core/issues/249 for more context.
//
// Deprecated: use github.com/ipfs/boxo/coreiface.DhtAPI
type DhtAPI interface {
// FindPeer queries the DHT for all of the multiaddresses associated with a
// Peer ID
Expand Down
10 changes: 7 additions & 3 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ package iface
import "errors"

var (
ErrIsDir = errors.New("this dag node is a directory")
ErrNotFile = errors.New("this dag node is not a regular file")
ErrOffline = errors.New("this action must be run in online mode, try running 'ipfs daemon' first")
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrIsDir
ErrIsDir = errors.New("this dag node is a directory")
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrNotFile
ErrNotFile = errors.New("this dag node is not a regular file")
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrOffline
ErrOffline = errors.New("this action must be run in online mode, try running 'ipfs daemon' first")
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrNotSupported
ErrNotSupported = errors.New("operation not supported")
)
3 changes: 3 additions & 0 deletions idfmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
mbase "github.com/multiformats/go-multibase"
)

// Deprecated: use github.com/ipfs/boxo/coreiface.FormatKeyID
func FormatKeyID(id peer.ID) string {
if s, err := peer.ToCid(id).StringOfBase(mbase.Base36); err != nil {
panic(err)
Expand All @@ -14,6 +15,8 @@ func FormatKeyID(id peer.ID) string {
}

// FormatKey formats the given IPNS key in a canonical way.
//
// Deprecated: use github.com/ipfs/boxo/coreiface.FormatKey
func FormatKey(key Key) string {
return FormatKeyID(key.ID())
}
4 changes: 4 additions & 0 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
)

// Key specifies the interface to Keys in KeyAPI Keystore
//
// Deprecated: use github.com/ipfs/boxo/coreiface.Key
type Key interface {
// Key returns key name
Name() string
Expand All @@ -23,6 +25,8 @@ type Key interface {
}

// KeyAPI specifies the interface to Keystore
//
// Deprecated: use github.com/ipfs/boxo/coreiface.KeyAPI
type KeyAPI interface {
// Generate generates new key, stores it in the keystore under the specified
// name and returns a base58 encoded multihash of it's public key
Expand Down
6 changes: 6 additions & 0 deletions name.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ import (
"github.com/ipfs/interface-go-ipfs-core/options"
)

// Deprecated: use github.com/ipfs/boxo/coreiface.ErrResolveFailed
var ErrResolveFailed = errors.New("could not resolve name")

// IpnsEntry specifies the interface to IpnsEntries
//
// Deprecated: use github.com/ipfs/boxo/coreiface.IpnsEntry
type IpnsEntry interface {
// Name returns IpnsEntry name
Name() string
// Value returns IpnsEntry value
Value() path.Path
}

// Deprecated: use github.com/ipfs/boxo/coreiface.IpnsResult
type IpnsResult struct {
path.Path
Err error
Expand All @@ -32,6 +36,8 @@ type IpnsResult struct {
// its public key.
//
// You can use .Key API to list and generate more names and their respective keys.
//
// Deprecated: use github.com/ipfs/boxo/coreiface.NameAPI
type NameAPI interface {
// Publish announces new IPNS name
Publish(ctx context.Context, path path.Path, opts ...options.NamePublishOption) (IpnsEntry, error)
Expand Down
14 changes: 14 additions & 0 deletions object.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
)

// ObjectStat provides information about dag nodes
//
// Deprecated: use github.com/ipfs/boxo/coreiface.ObjectStat
type ObjectStat struct {
// Cid is the CID of the node
Cid cid.Cid
Expand All @@ -34,20 +36,30 @@ type ObjectStat struct {
}

// ChangeType denotes type of change in ObjectChange
//
// Deprecated: use github.com/ipfs/boxo/coreiface.ChangeType
type ChangeType int

const (
// DiffAdd is set when a link was added to the graph
//
// Deprecated: use github.com/ipfs/boxo/coreiface.DiffAdd
DiffAdd ChangeType = iota

// DiffRemove is set when a link was removed from the graph
//
// Deprecated: use github.com/ipfs/boxo/coreiface.DiffRemove
DiffRemove

// DiffMod is set when a link was changed in the graph
//
// Deprecated: use github.com/ipfs/boxo/coreiface.DiffMod
DiffMod
)

// ObjectChange represents a change ia a graph
//
// Deprecated: use github.com/ipfs/boxo/coreiface.ObjectChange
type ObjectChange struct {
// Type of the change, either:
// * DiffAdd - Added a link
Expand All @@ -69,6 +81,8 @@ type ObjectChange struct {

// ObjectAPI specifies the interface to MerkleDAG and contains useful utilities
// for manipulating MerkleDAG data structures.
//
// Deprecated: use github.com/ipfs/boxo/coreiface.ObjectAPI
type ObjectAPI interface {
// New creates new, empty (by default) dag-node.
New(context.Context, ...options.ObjectNewOption) (ipld.Node, error)
Expand Down
8 changes: 8 additions & 0 deletions options/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@ import (
mh "github.com/multiformats/go-multihash"
)

// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockPutSettings
type BlockPutSettings struct {
CidPrefix cid.Prefix
Pin bool
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockRmSettings
type BlockRmSettings struct {
Force bool
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockPutOption
type BlockPutOption func(*BlockPutSettings) error

// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockRmOption
type BlockRmOption func(*BlockRmSettings) error

// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockPutOptions
func BlockPutOptions(opts ...BlockPutOption) (*BlockPutSettings, error) {
var cidPrefix cid.Prefix

Expand All @@ -45,6 +51,7 @@ func BlockPutOptions(opts ...BlockPutOption) (*BlockPutSettings, error) {
return options, nil
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockRmOptions
func BlockRmOptions(opts ...BlockRmOption) (*BlockRmSettings, error) {
options := &BlockRmSettings{
Force: false,
Expand All @@ -61,6 +68,7 @@ func BlockRmOptions(opts ...BlockRmOption) (*BlockRmSettings, error) {

type blockOpts struct{}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.Block
var Block blockOpts

// CidCodec is the modern option for Block.Put which specifies the multicodec to use
Expand Down
8 changes: 8 additions & 0 deletions options/dht.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package options

// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtProvideSettings
type DhtProvideSettings struct {
Recursive bool
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtFindProvidersSettings
type DhtFindProvidersSettings struct {
NumProviders int
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtProvideOption
type DhtProvideOption func(*DhtProvideSettings) error

// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtFindProvidersOption
type DhtFindProvidersOption func(*DhtFindProvidersSettings) error

// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtProvideOptions
func DhtProvideOptions(opts ...DhtProvideOption) (*DhtProvideSettings, error) {
options := &DhtProvideSettings{
Recursive: false,
Expand All @@ -25,6 +31,7 @@ func DhtProvideOptions(opts ...DhtProvideOption) (*DhtProvideSettings, error) {
return options, nil
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtFindProvidersOptions
func DhtFindProvidersOptions(opts ...DhtFindProvidersOption) (*DhtFindProvidersSettings, error) {
options := &DhtFindProvidersSettings{
NumProviders: 20,
Expand All @@ -41,6 +48,7 @@ func DhtFindProvidersOptions(opts ...DhtFindProvidersOption) (*DhtFindProvidersS

type dhtOpts struct{}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.Dht
var Dht dhtOpts

// Recursive is an option for Dht.Provide which specifies whether to provide
Expand Down
5 changes: 5 additions & 0 deletions options/global.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package options

// Deprecated: use github.com/ipfs/boxo/coreiface/options.ApiSettings
type ApiSettings struct {
Offline bool
FetchBlocks bool
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.ApiOption
type ApiOption func(*ApiSettings) error

// Deprecated: use github.com/ipfs/boxo/coreiface/options.ApiOptions
func ApiOptions(opts ...ApiOption) (*ApiSettings, error) {
options := &ApiSettings{
Offline: false,
Expand All @@ -16,6 +19,7 @@ func ApiOptions(opts ...ApiOption) (*ApiSettings, error) {
return ApiOptionsTo(options, opts...)
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.ApiOptionsTo
func ApiOptionsTo(options *ApiSettings, opts ...ApiOption) (*ApiSettings, error) {
for _, opt := range opts {
err := opt(options)
Expand All @@ -28,6 +32,7 @@ func ApiOptionsTo(options *ApiSettings, opts ...ApiOption) (*ApiSettings, error)

type apiOpts struct{}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.Api
var Api apiOpts

func (apiOpts) Offline(offline bool) ApiOption {
Expand Down
13 changes: 12 additions & 1 deletion options/key.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
package options

const (
RSAKey = "rsa"
// Deprecated: use github.com/ipfs/boxo/coreiface/options.RSAKey
RSAKey = "rsa"
// Deprecated: use github.com/ipfs/boxo/coreiface/options.Ed25519Key
Ed25519Key = "ed25519"

// Deprecated: use github.com/ipfs/boxo/coreiface/options.DefaultRSALen
DefaultRSALen = 2048
)

// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyGenerateSettings
type KeyGenerateSettings struct {
Algorithm string
Size int
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyRenameSettings
type KeyRenameSettings struct {
Force bool
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyGenerateOption
type KeyGenerateOption func(*KeyGenerateSettings) error

// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyRenameOption
type KeyRenameOption func(*KeyRenameSettings) error

// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyGenerateOptions
func KeyGenerateOptions(opts ...KeyGenerateOption) (*KeyGenerateSettings, error) {
options := &KeyGenerateSettings{
Algorithm: RSAKey,
Expand All @@ -34,6 +43,7 @@ func KeyGenerateOptions(opts ...KeyGenerateOption) (*KeyGenerateSettings, error)
return options, nil
}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyRenameOptions
func KeyRenameOptions(opts ...KeyRenameOption) (*KeyRenameSettings, error) {
options := &KeyRenameSettings{
Force: false,
Expand All @@ -50,6 +60,7 @@ func KeyRenameOptions(opts ...KeyRenameOption) (*KeyRenameSettings, error) {

type keyOpts struct{}

// Deprecated: use github.com/ipfs/boxo/coreiface/options.Key
var Key keyOpts

// Type is an option for Key.Generate which specifies which algorithm
Expand Down
Loading