Skip to content

Commit

Permalink
Merge pull request ipfs/boxo#500 from ipfs/release-v0.14.0
Browse files Browse the repository at this point in the history
Release v0.14.0

This commit was moved from ipfs/boxo@07c5719
  • Loading branch information
hacdias authored Nov 1, 2023
2 parents 38ff3ab + faac7c1 commit 04b27b2
Show file tree
Hide file tree
Showing 19 changed files with 220 additions and 592 deletions.
5 changes: 2 additions & 3 deletions core/coreiface/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"io"

path "github.com/ipfs/boxo/coreiface/path"

"github.com/ipfs/boxo/coreiface/options"
"github.com/ipfs/boxo/path"
)

// BlockStat contains information about a block
Expand All @@ -15,7 +14,7 @@ type BlockStat interface {
Size() int

// Path returns path to the block
Path() path.Resolved
Path() path.ImmutablePath
}

// BlockAPI specifies the interface to the block layer
Expand Down
9 changes: 5 additions & 4 deletions core/coreiface/coreapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ package iface
import (
"context"

path "github.com/ipfs/boxo/coreiface/path"

"github.com/ipfs/boxo/coreiface/options"
"github.com/ipfs/boxo/path"

ipld "github.com/ipfs/go-ipld-format"
)
Expand Down Expand Up @@ -47,8 +46,10 @@ type CoreAPI interface {
// Routing returns an implementation of Routing API
Routing() RoutingAPI

// ResolvePath resolves the path using Unixfs resolver
ResolvePath(context.Context, path.Path) (path.Resolved, error)
// ResolvePath resolves the path using UnixFS resolver, and returns the resolved
// immutable path, and the remainder of the path segments that cannot be resolved
// within UnixFS.
ResolvePath(context.Context, path.Path) (path.ImmutablePath, []string, error)

// ResolveNode resolves the path (if not resolved already) using Unixfs
// resolver, gets and returns the resolved Node
Expand Down
2 changes: 1 addition & 1 deletion core/coreiface/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package iface
import (
"context"

"github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/path"

"github.com/ipfs/boxo/coreiface/options"

Expand Down
2 changes: 1 addition & 1 deletion core/coreiface/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package iface
import (
"context"

"github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/path"

"github.com/ipfs/boxo/coreiface/options"

Expand Down
5 changes: 2 additions & 3 deletions core/coreiface/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"context"
"errors"

path "github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/ipns"

"github.com/ipfs/boxo/coreiface/options"
"github.com/ipfs/boxo/ipns"
"github.com/ipfs/boxo/path"
)

var ErrResolveFailed = errors.New("could not resolve name")
Expand Down
17 changes: 8 additions & 9 deletions core/coreiface/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"io"

path "github.com/ipfs/boxo/coreiface/path"

"github.com/ipfs/boxo/coreiface/options"
"github.com/ipfs/boxo/path"

"github.com/ipfs/go-cid"
ipld "github.com/ipfs/go-ipld-format"
Expand Down Expand Up @@ -60,11 +59,11 @@ type ObjectChange struct {

// Before holds the link path before the change. Note that when a link is
// added, this will be nil.
Before path.Resolved
Before path.ImmutablePath

// After holds the link path after the change. Note that when a link is
// removed, this will be nil.
After path.Resolved
After path.ImmutablePath
}

// ObjectAPI specifies the interface to MerkleDAG and contains useful utilities
Expand All @@ -74,7 +73,7 @@ type ObjectAPI interface {
New(context.Context, ...options.ObjectNewOption) (ipld.Node, error)

// Put imports the data into merkledag
Put(context.Context, io.Reader, ...options.ObjectPutOption) (path.Resolved, error)
Put(context.Context, io.Reader, ...options.ObjectPutOption) (path.ImmutablePath, error)

// Get returns the node for the path
Get(context.Context, path.Path) (ipld.Node, error)
Expand All @@ -91,16 +90,16 @@ type ObjectAPI interface {
// AddLink adds a link under the specified path. child path can point to a
// subdirectory within the patent which must be present (can be overridden
// with WithCreate option).
AddLink(ctx context.Context, base path.Path, name string, child path.Path, opts ...options.ObjectAddLinkOption) (path.Resolved, error)
AddLink(ctx context.Context, base path.Path, name string, child path.Path, opts ...options.ObjectAddLinkOption) (path.ImmutablePath, error)

// RmLink removes a link from the node
RmLink(ctx context.Context, base path.Path, link string) (path.Resolved, error)
RmLink(ctx context.Context, base path.Path, link string) (path.ImmutablePath, error)

// AppendData appends data to the node
AppendData(context.Context, path.Path, io.Reader) (path.Resolved, error)
AppendData(context.Context, path.Path, io.Reader) (path.ImmutablePath, error)

// SetData sets the data contained in the node
SetData(context.Context, path.Path, io.Reader) (path.Resolved, error)
SetData(context.Context, path.Path, io.Reader) (path.ImmutablePath, error)

// Diff returns a set of changes needed to transform the first object into the
// second.
Expand Down
6 changes: 3 additions & 3 deletions core/coreiface/options/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package options
import (
"time"

ropts "github.com/ipfs/boxo/coreiface/options/namesys"
"github.com/ipfs/boxo/namesys"
)

const (
Expand All @@ -21,7 +21,7 @@ type NamePublishSettings struct {
type NameResolveSettings struct {
Cache bool

ResolveOpts []ropts.ResolveOpt
ResolveOpts []namesys.ResolveOption
}

type (
Expand Down Expand Up @@ -123,7 +123,7 @@ func (nameOpts) Cache(cache bool) NameResolveOption {
}
}

func (nameOpts) ResolveOption(opt ropts.ResolveOpt) NameResolveOption {
func (nameOpts) ResolveOption(opt namesys.ResolveOption) NameResolveOption {
return func(settings *NameResolveSettings) error {
settings.ResolveOpts = append(settings.ResolveOpts, opt)
return nil
Expand Down
131 changes: 0 additions & 131 deletions core/coreiface/options/namesys/opts.go

This file was deleted.

Loading

0 comments on commit 04b27b2

Please sign in to comment.