Skip to content

Commit

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

This commit was moved from ipfs/boxo@c540780
  • Loading branch information
hacdias authored Aug 22, 2023
2 parents e5db7a9 + 0ada50f commit 2d5b54d
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 30 deletions.
7 changes: 4 additions & 3 deletions core/coreiface/coreiface/options/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ type BlockRmSettings struct {
Force bool
}

type BlockPutOption func(*BlockPutSettings) error
type BlockRmOption func(*BlockRmSettings) error
type (
BlockPutOption func(*BlockPutSettings) error
BlockRmOption func(*BlockRmSettings) error
)

func BlockPutOptions(opts ...BlockPutOption) (*BlockPutSettings, error) {
var cidPrefix cid.Prefix
Expand Down Expand Up @@ -131,7 +133,6 @@ func (blockOpts) Format(format string) BlockPutOption {

return nil
}

}

// Hash is an option for Block.Put which specifies the multihash settings to use
Expand Down
6 changes: 4 additions & 2 deletions core/coreiface/coreiface/options/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ type DhtFindProvidersSettings struct {
NumProviders int
}

type DhtProvideOption func(*DhtProvideSettings) error
type DhtFindProvidersOption func(*DhtFindProvidersSettings) error
type (
DhtProvideOption func(*DhtProvideSettings) error
DhtFindProvidersOption func(*DhtFindProvidersSettings) error
)

func DhtProvideOptions(opts ...DhtProvideOption) (*DhtProvideSettings, error) {
options := &DhtProvideSettings{
Expand Down
6 changes: 4 additions & 2 deletions core/coreiface/coreiface/options/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ type KeyRenameSettings struct {
Force bool
}

type KeyGenerateOption func(*KeyGenerateSettings) error
type KeyRenameOption func(*KeyRenameSettings) error
type (
KeyGenerateOption func(*KeyGenerateSettings) error
KeyRenameOption func(*KeyRenameSettings) error
)

func KeyGenerateOptions(opts ...KeyGenerateOption) (*KeyGenerateSettings, error) {
options := &KeyGenerateSettings{
Expand Down
6 changes: 4 additions & 2 deletions core/coreiface/coreiface/options/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ type NameResolveSettings struct {
ResolveOpts []ropts.ResolveOpt
}

type NamePublishOption func(*NamePublishSettings) error
type NameResolveOption func(*NameResolveSettings) error
type (
NamePublishOption func(*NamePublishSettings) error
NameResolveOption func(*NameResolveSettings) error
)

func NamePublishOptions(opts ...NamePublishOption) (*NamePublishSettings, error) {
options := &NamePublishSettings{
Expand Down
8 changes: 5 additions & 3 deletions core/coreiface/coreiface/options/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ type ObjectAddLinkSettings struct {
Create bool
}

type ObjectNewOption func(*ObjectNewSettings) error
type ObjectPutOption func(*ObjectPutSettings) error
type ObjectAddLinkOption func(*ObjectAddLinkSettings) error
type (
ObjectNewOption func(*ObjectNewSettings) error
ObjectPutOption func(*ObjectPutSettings) error
ObjectAddLinkOption func(*ObjectAddLinkSettings) error
)

func ObjectNewOptions(opts ...ObjectNewOption) (*ObjectNewSettings, error) {
options := &ObjectNewSettings{
Expand Down
6 changes: 4 additions & 2 deletions core/coreiface/coreiface/options/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ type PubSubSubscribeSettings struct {
Discover bool
}

type PubSubPeersOption func(*PubSubPeersSettings) error
type PubSubSubscribeOption func(*PubSubSubscribeSettings) error
type (
PubSubPeersOption func(*PubSubPeersSettings) error
PubSubSubscribeOption func(*PubSubSubscribeSettings) error
)

func PubSubPeersOptions(opts ...PubSubPeersOption) (*PubSubPeersSettings, error) {
options := &PubSubPeersSettings{
Expand Down
6 changes: 4 additions & 2 deletions core/coreiface/coreiface/options/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ type UnixfsLsSettings struct {
UseCumulativeSize bool
}

type UnixfsAddOption func(*UnixfsAddSettings) error
type UnixfsLsOption func(*UnixfsLsSettings) error
type (
UnixfsAddOption func(*UnixfsAddSettings) error
UnixfsLsOption func(*UnixfsLsSettings) error
)

func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, error) {
options := &UnixfsAddSettings{
Expand Down
16 changes: 7 additions & 9 deletions core/coreiface/coreiface/tests/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ func (tp *TestSuite) TestDag(t *testing.T) {
t.Run("TestBatch", tp.TestBatch)
}

var (
treeExpected = map[string]struct{}{
"a": {},
"b": {},
"c": {},
"c/d": {},
"c/e": {},
}
)
var treeExpected = map[string]struct{}{
"a": {},
"b": {},
"c": {},
"c/d": {},
"c/e": {},
}

func (tp *TestSuite) TestPut(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion core/coreiface/coreiface/tests/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ func (tp *TestSuite) TestBasicPublishResolveTimeout(t *testing.T) {
require.NoError(t, err)
}

//TODO: When swarm api is created, add multinode tests
// TODO: When swarm api is created, add multinode tests
2 changes: 1 addition & 1 deletion core/coreiface/coreiface/tests/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (tp *TestSuite) TestObjectPut(t *testing.T) {
t.Fatal(err)
}

p2, err := api.Object().Put(ctx, strings.NewReader(`{"Data":"YmFy"}`), opt.Object.DataType("base64")) //bar
p2, err := api.Object().Put(ctx, strings.NewReader(`{"Data":"YmFy"}`), opt.Object.DataType("base64")) // bar
if err != nil {
t.Fatal(err)
}
Expand Down
8 changes: 5 additions & 3 deletions core/coreiface/coreiface/tests/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ func (tp *TestSuite) TestUnixfs(t *testing.T) {
}

// `echo -n 'hello, world!' | ipfs add`
var hello = "/ipfs/QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk"
var helloStr = "hello, world!"
var (
hello = "/ipfs/QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk"
helloStr = "hello, world!"
)

// `echo -n | ipfs add`
var emptyFile = "/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH"
Expand Down Expand Up @@ -213,7 +215,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
path: "/ipfs/bafkqaaa",
opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(0), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true)},
},
{ //TODO: after coreapi add is used in `ipfs add`, consider making this default for inline
{ // TODO: after coreapi add is used in `ipfs add`, consider making this default for inline
name: "addInlineRaw",
data: strFile(helloStr),
path: "/ipfs/bafkqadlimvwgy3zmeb3w64tmmqqq",
Expand Down

0 comments on commit 2d5b54d

Please sign in to comment.