diff --git a/block.go b/block.go index 49ffe75..ca11640 100644 --- a/block.go +++ b/block.go @@ -10,6 +10,7 @@ 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 @@ -19,6 +20,7 @@ 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) diff --git a/coreapi.go b/coreapi.go index 722c00a..29b7fcd 100644 --- a/coreapi.go +++ b/coreapi.go @@ -13,6 +13,7 @@ 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 diff --git a/dag.go b/dag.go index 3cc3aeb..c22e049 100644 --- a/dag.go +++ b/dag.go @@ -5,6 +5,7 @@ import ( ) // APIDagService extends ipld.DAGService +// Deprecated: use github.com/ipfs/boxo/coreiface.APIDagService type APIDagService interface { ipld.DAGService diff --git a/dht.go b/dht.go index 73bf483..bb1328c 100644 --- a/dht.go +++ b/dht.go @@ -13,6 +13,7 @@ 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 diff --git a/errors.go b/errors.go index e0bd780..f517668 100644 --- a/errors.go +++ b/errors.go @@ -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") ) diff --git a/idfmt.go b/idfmt.go index 80fd0f8..9a6eed4 100644 --- a/idfmt.go +++ b/idfmt.go @@ -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) @@ -14,6 +15,7 @@ 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()) } diff --git a/key.go b/key.go index b0e739c..ff14c32 100644 --- a/key.go +++ b/key.go @@ -11,6 +11,7 @@ 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 @@ -23,6 +24,7 @@ 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 diff --git a/name.go b/name.go index d2725e0..7219e8d 100644 --- a/name.go +++ b/name.go @@ -12,6 +12,7 @@ import ( 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 @@ -19,6 +20,7 @@ type IpnsEntry interface { Value() path.Path } +// Deprecated: use github.com/ipfs/boxo/coreiface.IpnsResult type IpnsResult struct { path.Path Err error @@ -32,6 +34,7 @@ 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) diff --git a/object.go b/object.go index 733dc2b..cebb398 100644 --- a/object.go +++ b/object.go @@ -13,6 +13,7 @@ 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 @@ -34,20 +35,25 @@ 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 @@ -69,6 +75,7 @@ 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) diff --git a/options/block.go b/options/block.go index 1306486..0e558e7 100644 --- a/options/block.go +++ b/options/block.go @@ -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 @@ -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, @@ -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 diff --git a/options/dht.go b/options/dht.go index e13e160..8d7edbe 100644 --- a/options/dht.go +++ b/options/dht.go @@ -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, @@ -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, @@ -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 diff --git a/options/global.go b/options/global.go index 90e2586..35e46d1 100644 --- a/options/global.go +++ b/options/global.go @@ -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, @@ -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) @@ -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 { diff --git a/options/key.go b/options/key.go index 4bc53a6..dace6cf 100644 --- a/options/key.go +++ b/options/key.go @@ -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, @@ -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, @@ -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 diff --git a/options/name.go b/options/name.go index aa80828..2c3b7ba 100644 --- a/options/name.go +++ b/options/name.go @@ -7,9 +7,11 @@ import ( ) const ( + // Deprecated: use github.com/ipfs/boxo/coreiface/options.DefaultNameValidTime DefaultNameValidTime = 24 * time.Hour ) +// Deprecated: use github.com/ipfs/boxo/coreiface/options.NamePublishSettings type NamePublishSettings struct { ValidTime time.Duration Key string @@ -19,13 +21,17 @@ type NamePublishSettings struct { AllowOffline bool } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.NameResolveSettings type NameResolveSettings struct { Cache bool ResolveOpts []ropts.ResolveOpt } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.NamePublishOption type NamePublishOption func(*NamePublishSettings) error + +// Deprecated: use github.com/ipfs/boxo/coreiface/options.NameResolveOption type NameResolveOption func(*NameResolveSettings) error func NamePublishOptions(opts ...NamePublishOption) (*NamePublishSettings, error) { @@ -46,6 +52,7 @@ func NamePublishOptions(opts ...NamePublishOption) (*NamePublishSettings, error) return options, nil } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.NameResolveOptions func NameResolveOptions(opts ...NameResolveOption) (*NameResolveSettings, error) { options := &NameResolveSettings{ Cache: true, diff --git a/options/namesys/opts.go b/options/namesys/opts.go index 0cd1ba7..dacbf5e 100644 --- a/options/namesys/opts.go +++ b/options/namesys/opts.go @@ -6,25 +6,30 @@ import ( const ( // DefaultDepthLimit is the default depth limit used by Resolve. + // Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.DefaultDepthLimit DefaultDepthLimit = 32 // UnlimitedDepth allows infinite recursion in Resolve. You // probably don't want to use this, but it's here if you absolutely // trust resolution to eventually complete and can't put an upper // limit on how many steps it will take. + // Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.UnlimitedDepth UnlimitedDepth = 0 // DefaultIPNSRecordTTL specifies the time that the record can be cached // before checking if its validity again. + // Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.DefaultIPNSRecordTTL DefaultIPNSRecordTTL = time.Minute // DefaultIPNSRecordEOL specifies the time that the network will cache IPNS // records after being published. Records should be re-published before this // interval expires. We use the same default expiration as the DHT. + // Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.DefaultIPNSRecordEOL DefaultIPNSRecordEOL = 48 * time.Hour ) // ResolveOpts specifies options for resolving an IPNS path +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.ResolveOpts type ResolveOpts struct { // Recursion depth limit Depth uint @@ -40,6 +45,7 @@ type ResolveOpts struct { // DefaultResolveOpts returns the default options for resolving // an IPNS path +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.DefaultResolveOpts func DefaultResolveOpts() ResolveOpts { return ResolveOpts{ Depth: DefaultDepthLimit, @@ -49,9 +55,11 @@ func DefaultResolveOpts() ResolveOpts { } // ResolveOpt is used to set an option +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.ResolveOpt type ResolveOpt func(*ResolveOpts) // Depth is the recursion depth limit +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.Depth func Depth(depth uint) ResolveOpt { return func(o *ResolveOpts) { o.Depth = depth @@ -59,6 +67,7 @@ func Depth(depth uint) ResolveOpt { } // DhtRecordCount is the number of IPNS records to retrieve from the DHT +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.DhtRecordCount func DhtRecordCount(count uint) ResolveOpt { return func(o *ResolveOpts) { o.DhtRecordCount = count @@ -67,6 +76,7 @@ func DhtRecordCount(count uint) ResolveOpt { // DhtTimeout is the amount of time to wait for DHT records to be fetched // and verified. A zero value indicates that there is no explicit timeout +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.DhtTimeout func DhtTimeout(timeout time.Duration) ResolveOpt { return func(o *ResolveOpts) { o.DhtTimeout = timeout @@ -74,6 +84,7 @@ func DhtTimeout(timeout time.Duration) ResolveOpt { } // ProcessOpts converts an array of ResolveOpt into a ResolveOpts object +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.ProcessOpts func ProcessOpts(opts []ResolveOpt) ResolveOpts { rsopts := DefaultResolveOpts() for _, option := range opts { @@ -83,12 +94,14 @@ func ProcessOpts(opts []ResolveOpt) ResolveOpts { } // PublishOptions specifies options for publishing an IPNS record. +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.PublishOptions type PublishOptions struct { EOL time.Time TTL time.Duration } // DefaultPublishOptions returns the default options for publishing an IPNS record. +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.DefaultPublishOptions func DefaultPublishOptions() PublishOptions { return PublishOptions{ EOL: time.Now().Add(DefaultIPNSRecordEOL), @@ -97,9 +110,11 @@ func DefaultPublishOptions() PublishOptions { } // PublishOption is used to set an option for PublishOpts. +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.PublishOption type PublishOption func(*PublishOptions) // PublishWithEOL sets an EOL. +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.PublishWithEOL func PublishWithEOL(eol time.Time) PublishOption { return func(o *PublishOptions) { o.EOL = eol @@ -107,6 +122,7 @@ func PublishWithEOL(eol time.Time) PublishOption { } // PublishWithEOL sets a TTL. +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.PublishWithTTL func PublishWithTTL(ttl time.Duration) PublishOption { return func(o *PublishOptions) { o.TTL = ttl @@ -114,6 +130,7 @@ func PublishWithTTL(ttl time.Duration) PublishOption { } // ProcessPublishOptions converts an array of PublishOpt into a PublishOpts object. +// Deprecated: use github.com/ipfs/boxo/coreiface/options/namesys.ProcessPublishOptions func ProcessPublishOptions(opts []PublishOption) PublishOptions { rsopts := DefaultPublishOptions() for _, option := range opts { diff --git a/options/object.go b/options/object.go index e484a9f..8c2b52f 100644 --- a/options/object.go +++ b/options/object.go @@ -1,23 +1,32 @@ package options +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectNewSettings type ObjectNewSettings struct { Type string } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectPutSettings type ObjectPutSettings struct { InputEnc string DataType string Pin bool } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectAddLinkSettings type ObjectAddLinkSettings struct { Create bool } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectNewOption type ObjectNewOption func(*ObjectNewSettings) error + +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectPutOption type ObjectPutOption func(*ObjectPutSettings) error + +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectAddLinkOption type ObjectAddLinkOption func(*ObjectAddLinkSettings) error +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectNewOptions func ObjectNewOptions(opts ...ObjectNewOption) (*ObjectNewSettings, error) { options := &ObjectNewSettings{ Type: "empty", @@ -32,6 +41,7 @@ func ObjectNewOptions(opts ...ObjectNewOption) (*ObjectNewSettings, error) { return options, nil } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectPutOptions func ObjectPutOptions(opts ...ObjectPutOption) (*ObjectPutSettings, error) { options := &ObjectPutSettings{ InputEnc: "json", @@ -48,6 +58,7 @@ func ObjectPutOptions(opts ...ObjectPutOption) (*ObjectPutSettings, error) { return options, nil } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.ObjectAddLinkOptions func ObjectAddLinkOptions(opts ...ObjectAddLinkOption) (*ObjectAddLinkSettings, error) { options := &ObjectAddLinkSettings{ Create: false, @@ -64,6 +75,7 @@ func ObjectAddLinkOptions(opts ...ObjectAddLinkOption) (*ObjectAddLinkSettings, type objectOpts struct{} +// Deprecated: use github.com/ipfs/boxo/coreiface/options.Object var Object objectOpts // Type is an option for Object.New which allows to change the type of created diff --git a/options/pin.go b/options/pin.go index 75c2b8a..cc8d13b 100644 --- a/options/pin.go +++ b/options/pin.go @@ -3,47 +3,58 @@ package options import "fmt" // PinAddSettings represent the settings for PinAPI.Add +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinAddSettings type PinAddSettings struct { Recursive bool } // PinLsSettings represent the settings for PinAPI.Ls +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinLsSettings type PinLsSettings struct { Type string } // PinIsPinnedSettings represent the settings for PinAPI.IsPinned +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinIsPinnedSettings type PinIsPinnedSettings struct { WithType string } // PinRmSettings represents the settings for PinAPI.Rm +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinRmSettings type PinRmSettings struct { Recursive bool } // PinUpdateSettings represent the settings for PinAPI.Update +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinUpdateSettings type PinUpdateSettings struct { Unpin bool } // PinAddOption is the signature of an option for PinAPI.Add +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinAddOption type PinAddOption func(*PinAddSettings) error // PinLsOption is the signature of an option for PinAPI.Ls +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinLsOption type PinLsOption func(*PinLsSettings) error // PinIsPinnedOption is the signature of an option for PinAPI.IsPinned +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinIsPinnedOption type PinIsPinnedOption func(*PinIsPinnedSettings) error // PinRmOption is the signature of an option for PinAPI.Rm +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinRmOption type PinRmOption func(*PinRmSettings) error // PinUpdateOption is the signature of an option for PinAPI.Update +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinUpdateOption type PinUpdateOption func(*PinUpdateSettings) error // PinAddOptions compile a series of PinAddOption into a ready to use // PinAddSettings and set the default values. +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinAddOptions func PinAddOptions(opts ...PinAddOption) (*PinAddSettings, error) { options := &PinAddSettings{ Recursive: true, @@ -61,6 +72,7 @@ func PinAddOptions(opts ...PinAddOption) (*PinAddSettings, error) { // PinLsOptions compile a series of PinLsOption into a ready to use // PinLsSettings and set the default values. +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinLsOptions func PinLsOptions(opts ...PinLsOption) (*PinLsSettings, error) { options := &PinLsSettings{ Type: "all", @@ -78,6 +90,7 @@ func PinLsOptions(opts ...PinLsOption) (*PinLsSettings, error) { // PinIsPinnedOptions compile a series of PinIsPinnedOption into a ready to use // PinIsPinnedSettings and set the default values. +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinIsPinnedOptions func PinIsPinnedOptions(opts ...PinIsPinnedOption) (*PinIsPinnedSettings, error) { options := &PinIsPinnedSettings{ WithType: "all", @@ -95,6 +108,7 @@ func PinIsPinnedOptions(opts ...PinIsPinnedOption) (*PinIsPinnedSettings, error) // PinRmOptions compile a series of PinRmOption into a ready to use // PinRmSettings and set the default values. +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinRmOptions func PinRmOptions(opts ...PinRmOption) (*PinRmSettings, error) { options := &PinRmSettings{ Recursive: true, @@ -111,6 +125,7 @@ func PinRmOptions(opts ...PinRmOption) (*PinRmSettings, error) { // PinUpdateOptions compile a series of PinUpdateOption into a ready to use // PinUpdateSettings and set the default values. +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PinUpdateOptions func PinUpdateOptions(opts ...PinUpdateOption) (*PinUpdateSettings, error) { options := &PinUpdateSettings{ Unpin: true, @@ -132,6 +147,7 @@ type pinOpts struct { } // Pin provide an access to all the options for the Pin API. +// Deprecated: use github.com/ipfs/boxo/coreiface/options.Pin var Pin pinOpts type pinLsOpts struct{} diff --git a/options/pubsub.go b/options/pubsub.go index c387d61..6d44c78 100644 --- a/options/pubsub.go +++ b/options/pubsub.go @@ -1,16 +1,22 @@ package options +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PubSubPeersSettings type PubSubPeersSettings struct { Topic string } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PubSubSubscribeSettings type PubSubSubscribeSettings struct { Discover bool } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PubSubPeersOption type PubSubPeersOption func(*PubSubPeersSettings) error + +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PubSubSubscribeOption type PubSubSubscribeOption func(*PubSubSubscribeSettings) error +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PubSubPeersOptions func PubSubPeersOptions(opts ...PubSubPeersOption) (*PubSubPeersSettings, error) { options := &PubSubPeersSettings{ Topic: "", @@ -25,6 +31,7 @@ func PubSubPeersOptions(opts ...PubSubPeersOption) (*PubSubPeersSettings, error) return options, nil } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PubSubSubscribeOptions func PubSubSubscribeOptions(opts ...PubSubSubscribeOption) (*PubSubSubscribeSettings, error) { options := &PubSubSubscribeSettings{ Discover: false, @@ -41,6 +48,7 @@ func PubSubSubscribeOptions(opts ...PubSubSubscribeOption) (*PubSubSubscribeSett type pubsubOpts struct{} +// Deprecated: use github.com/ipfs/boxo/coreiface/options.PubSub var PubSub pubsubOpts func (pubsubOpts) Topic(topic string) PubSubPeersOption { diff --git a/options/unixfs.go b/options/unixfs.go index cd15991..5f3f9ce 100644 --- a/options/unixfs.go +++ b/options/unixfs.go @@ -9,13 +9,17 @@ import ( mh "github.com/multiformats/go-multihash" ) +// Deprecated: use github.com/ipfs/boxo/coreiface/options.Layout type Layout int const ( + // Deprecated: use github.com/ipfs/boxo/coreiface/options.BalancedLayout BalancedLayout Layout = iota + // Deprecated: use github.com/ipfs/boxo/coreiface/options.TrickleLayout TrickleLayout ) +// Deprecated: use github.com/ipfs/boxo/coreiface/options.UnixfsAddSettings type UnixfsAddSettings struct { CidVersion int MhType uint64 @@ -38,14 +42,19 @@ type UnixfsAddSettings struct { Progress bool } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.UnixfsLsSettings type UnixfsLsSettings struct { ResolveChildren bool UseCumulativeSize bool } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.UnixfsAddOption type UnixfsAddOption func(*UnixfsAddSettings) error + +// Deprecated: use github.com/ipfs/boxo/coreiface/options.UnixfsLsOption type UnixfsLsOption func(*UnixfsLsSettings) error +// Deprecated: use github.com/ipfs/boxo/coreiface/options.UnixfsAddOptions func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, error) { options := &UnixfsAddSettings{ CidVersion: -1, @@ -120,6 +129,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, return options, prefix, nil } +// Deprecated: use github.com/ipfs/boxo/coreiface/options.UnixfsLsOptions func UnixfsLsOptions(opts ...UnixfsLsOption) (*UnixfsLsSettings, error) { options := &UnixfsLsSettings{ ResolveChildren: true, @@ -137,6 +147,7 @@ func UnixfsLsOptions(opts ...UnixfsLsOption) (*UnixfsLsSettings, error) { type unixfsOpts struct{} +// Deprecated: use github.com/ipfs/boxo/coreiface/options.Unixfs var Unixfs unixfsOpts // CidVersion specifies which CID version to use. Defaults to 0 unless an option diff --git a/path/path.go b/path/path.go index e256293..47ef6e2 100644 --- a/path/path.go +++ b/path/path.go @@ -16,6 +16,7 @@ import ( // * /ipld - Immutable ipld path (data) // * /ipns - Mutable names. Usually resolves to one of the immutable paths // TODO: /local (MFS) +// Deprecated: use github.com/ipfs/boxo/coreiface/path.Path type Path interface { // String returns the path as a string. String() string @@ -41,6 +42,7 @@ type Path interface { // Resolved is a path which was resolved to the last resolvable node. // ResolvedPaths are guaranteed to return nil from `IsValid` +// Deprecated: use github.com/ipfs/boxo/coreiface/path.Resolved type Resolved interface { // Cid returns the CID of the node referenced by the path. Remainder of the // path is guaranteed to be within the node. @@ -114,12 +116,14 @@ type resolvedPath struct { } // Join appends provided segments to the base path +// Deprecated: use github.com/ipfs/boxo/coreiface/path.Join func Join(base Path, a ...string) Path { s := strings.Join(append([]string{base.String()}, a...), "/") return &path{path: s} } // IpfsPath creates new /ipfs path from the provided CID +// Deprecated: use github.com/ipfs/boxo/coreiface/path.IpfsPath func IpfsPath(c cid.Cid) Resolved { return &resolvedPath{ path: path{"/ipfs/" + c.String()}, @@ -130,6 +134,7 @@ func IpfsPath(c cid.Cid) Resolved { } // IpldPath creates new /ipld path from the provided CID +// Deprecated: use github.com/ipfs/boxo/coreiface/path.IpldPath func IpldPath(c cid.Cid) Resolved { return &resolvedPath{ path: path{"/ipld/" + c.String()}, @@ -140,6 +145,7 @@ func IpldPath(c cid.Cid) Resolved { } // New parses string path to a Path +// Deprecated: use github.com/ipfs/boxo/coreiface/path.New func New(p string) Path { if pp, err := ipfspath.ParsePath(p); err == nil { p = pp.String() @@ -151,6 +157,7 @@ func New(p string) Path { // NewResolvedPath creates new Resolved path. This function performs no checks // and is intended to be used by resolver implementations. Incorrect inputs may // cause panics. Handle with care. +// Deprecated: use github.com/ipfs/boxo/coreiface/path.NewResolvedPath func NewResolvedPath(ipath ipfspath.Path, c cid.Cid, root cid.Cid, remainder string) Resolved { return &resolvedPath{ path: path{ipath.String()}, diff --git a/pin.go b/pin.go index 6205a9b..19d48f1 100644 --- a/pin.go +++ b/pin.go @@ -9,6 +9,7 @@ import ( ) // Pin holds information about pinned resource +// Deprecated: use github.com/ipfs/boxo/coreiface.Pin type Pin interface { // Path to the pinned object Path() path.Resolved @@ -21,6 +22,7 @@ type Pin interface { } // PinStatus holds information about pin health +// Deprecated: use github.com/ipfs/boxo/coreiface.PinStatus type PinStatus interface { // Ok indicates whether the pin has been verified to be correct Ok() bool @@ -30,6 +32,7 @@ type PinStatus interface { } // BadPinNode is a node that has been marked as bad by Pin.Verify +// Deprecated: use github.com/ipfs/boxo/coreiface.BadPinNode type BadPinNode interface { // Path is the path of the node Path() path.Resolved @@ -39,6 +42,7 @@ type BadPinNode interface { } // PinAPI specifies the interface to pining +// Deprecated: use github.com/ipfs/boxo/coreiface.PinAPI type PinAPI interface { // Add creates new pin, be default recursive - pinning the whole referenced // tree diff --git a/pubsub.go b/pubsub.go index 4272562..d52efe5 100644 --- a/pubsub.go +++ b/pubsub.go @@ -10,6 +10,7 @@ import ( ) // PubSubSubscription is an active PubSub subscription +// Deprecated: use github.com/ipfs/boxo/coreiface.PubSubSubscription type PubSubSubscription interface { io.Closer @@ -18,6 +19,7 @@ type PubSubSubscription interface { } // PubSubMessage is a single PubSub message +// Deprecated: use github.com/ipfs/boxo/coreiface.PubSubMessage type PubSubMessage interface { // From returns id of a peer from which the message has arrived From() peer.ID @@ -33,6 +35,7 @@ type PubSubMessage interface { } // PubSubAPI specifies the interface to PubSub +// Deprecated: use github.com/ipfs/boxo/coreiface.PubSubAPI type PubSubAPI interface { // Ls lists subscribed topics by name Ls(context.Context) ([]string, error) diff --git a/routing.go b/routing.go index a28ceb9..1da873f 100644 --- a/routing.go +++ b/routing.go @@ -5,6 +5,7 @@ import ( ) // RoutingAPI specifies the interface to the routing layer. +// Deprecated: use github.com/ipfs/boxo/coreiface.RoutingAPI type RoutingAPI interface { // Get retrieves the best value for a given key Get(context.Context, string) ([]byte, error) diff --git a/swarm.go b/swarm.go index 9aa5466..6d6950c 100644 --- a/swarm.go +++ b/swarm.go @@ -18,6 +18,7 @@ var ( ) // ConnectionInfo contains information about a peer +// Deprecated: use github.com/ipfs/boxo/coreiface.ConnectionInfo type ConnectionInfo interface { // ID returns PeerID ID() peer.ID @@ -36,6 +37,7 @@ type ConnectionInfo interface { } // SwarmAPI specifies the interface to libp2p swarm +// Deprecated: use github.com/ipfs/boxo/coreiface.SwarmAPI type SwarmAPI interface { // Connect to a given peer Connect(context.Context, peer.AddrInfo) error diff --git a/tests/api.go b/tests/api.go index ec1f63a..b2efb47 100644 --- a/tests/api.go +++ b/tests/api.go @@ -20,6 +20,7 @@ func (tp *TestSuite) makeAPI(ctx context.Context) (coreiface.CoreAPI, error) { return api[0], nil } +// Deprecated: use github.com/ipfs/boxo/coreiface/tests.Provider type Provider interface { // Make creates n nodes. fullIdentity set to false can be ignored MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]coreiface.CoreAPI, error) @@ -37,12 +38,14 @@ func (tp *TestSuite) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) return tp.Provider.MakeAPISwarm(ctx, fullIdentity, n) } +// Deprecated: use github.com/ipfs/boxo/coreiface/tests.TestSuite type TestSuite struct { Provider apis chan int } +// Deprecated: use github.com/ipfs/boxo/coreiface/tests.TestApi func TestApi(p Provider) func(t *testing.T) { running := 1 apis := make(chan int) diff --git a/unixfs.go b/unixfs.go index 3b21a8e..dfac25a 100644 --- a/unixfs.go +++ b/unixfs.go @@ -10,6 +10,7 @@ import ( "github.com/ipfs/go-libipfs/files" ) +// Deprecated: use github.com/ipfs/boxo/coreiface.AddEvent type AddEvent struct { Name string Path path.Resolved `json:",omitempty"` @@ -18,17 +19,22 @@ type AddEvent struct { } // FileType is an enum of possible UnixFS file types. +// Deprecated: use github.com/ipfs/boxo/coreiface.FileType type FileType int32 const ( // TUnknown means the file type isn't known (e.g., it hasn't been // resolved). + // Deprecated: use github.com/ipfs/boxo/coreiface.TUnknown TUnknown FileType = iota // TFile is a regular file. + // Deprecated: use github.com/ipfs/boxo/coreiface.TFile TFile // TDirectory is a directory. + // Deprecated: use github.com/ipfs/boxo/coreiface.TDirectory TDirectory // TSymlink is a symlink. + // Deprecated: use github.com/ipfs/boxo/coreiface.TSymlink TSymlink ) @@ -48,6 +54,7 @@ func (t FileType) String() string { } // DirEntry is a directory entry returned by `Ls`. +// Deprecated: use github.com/ipfs/boxo/coreiface.DirEntry type DirEntry struct { Name string Cid cid.Cid @@ -62,6 +69,7 @@ type DirEntry struct { // UnixfsAPI is the basic interface to immutable files in IPFS // NOTE: This API is heavily WIP, things are guaranteed to break frequently +// Deprecated: use github.com/ipfs/boxo/coreiface.UnixfsAPI type UnixfsAPI interface { // Add imports the data from the reader into merkledag file // diff --git a/util.go b/util.go index 6d58bf4..f161c8e 100644 --- a/util.go +++ b/util.go @@ -5,6 +5,7 @@ import ( "io" ) +// Deprecated: use github.com/ipfs/boxo/coreiface.Reader type Reader interface { ReadSeekCloser Size() uint64 @@ -12,6 +13,7 @@ type Reader interface { } // A ReadSeekCloser implements interfaces to read, copy, seek and close. +// Deprecated: use github.com/ipfs/boxo/coreiface.ReadSeekCloser type ReadSeekCloser interface { io.Reader io.Seeker