mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
sync: update CI config files (#87)
This commit was moved from ipfs/interface-go-ipfs-core@de3410bbe2 This commit was moved from ipfs/boxo@ea6ac8cb6a
This commit is contained in:
parent
caa42b5634
commit
f2614d979e
@ -2,9 +2,10 @@ package iface
|
||||
|
||||
import (
|
||||
"context"
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
"io"
|
||||
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
)
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package iface
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
|
||||
@ -2,6 +2,7 @@ package iface
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
|
||||
@ -3,6 +3,7 @@ package iface
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
|
||||
@ -2,9 +2,10 @@ package iface
|
||||
|
||||
import (
|
||||
"context"
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
"io"
|
||||
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
@ -69,7 +69,7 @@ func (keyOpts) Type(algorithm string) KeyGenerateOption {
|
||||
// generated. Default is -1
|
||||
//
|
||||
// value of -1 means 'use default size for key type':
|
||||
// * 2048 for RSA
|
||||
// - 2048 for RSA
|
||||
func (keyOpts) Size(size int) KeyGenerateOption {
|
||||
return func(settings *KeyGenerateSettings) error {
|
||||
settings.Size = size
|
||||
|
||||
@ -113,7 +113,6 @@ func (nameOpts) Cache(cache bool) NameResolveOption {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
func (nameOpts) ResolveOption(opt ropts.ResolveOpt) NameResolveOption {
|
||||
return func(settings *NameResolveSettings) error {
|
||||
settings.ResolveOpts = append(settings.ResolveOpts, opt)
|
||||
|
||||
@ -164,11 +164,11 @@ func (pinLsOpts) Indirect() PinLsOption {
|
||||
// type.
|
||||
//
|
||||
// Supported values:
|
||||
// * "direct" - directly pinned objects
|
||||
// * "recursive" - roots of recursive pins
|
||||
// * "indirect" - indirectly pinned objects (referenced by recursively pinned
|
||||
// objects)
|
||||
// * "all" - all pinned objects (default)
|
||||
// - "direct" - directly pinned objects
|
||||
// - "recursive" - roots of recursive pins
|
||||
// - "indirect" - indirectly pinned objects (referenced by recursively pinned
|
||||
// objects)
|
||||
// - "all" - all pinned objects (default)
|
||||
func (pinLsOpts) Type(typeStr string) (PinLsOption, error) {
|
||||
switch typeStr {
|
||||
case "all", "direct", "indirect", "recursive":
|
||||
@ -182,11 +182,11 @@ func (pinLsOpts) Type(typeStr string) (PinLsOption, error) {
|
||||
// be returned
|
||||
//
|
||||
// Supported values:
|
||||
// * "direct" - directly pinned objects
|
||||
// * "recursive" - roots of recursive pins
|
||||
// * "indirect" - indirectly pinned objects (referenced by recursively pinned
|
||||
// objects)
|
||||
// * "all" - all pinned objects (default)
|
||||
// - "direct" - directly pinned objects
|
||||
// - "recursive" - roots of recursive pins
|
||||
// - "indirect" - indirectly pinned objects (referenced by recursively pinned
|
||||
// objects)
|
||||
// - "all" - all pinned objects (default)
|
||||
func (pinLsOpts) pinType(t string) PinLsOption {
|
||||
return func(settings *PinLsSettings) error {
|
||||
settings.Type = t
|
||||
@ -224,11 +224,11 @@ func (pinIsPinnedOpts) Indirect() PinIsPinnedOption {
|
||||
// type.
|
||||
//
|
||||
// Supported values:
|
||||
// * "direct" - directly pinned objects
|
||||
// * "recursive" - roots of recursive pins
|
||||
// * "indirect" - indirectly pinned objects (referenced by recursively pinned
|
||||
// objects)
|
||||
// * "all" - all pinned objects (default)
|
||||
// - "direct" - directly pinned objects
|
||||
// - "recursive" - roots of recursive pins
|
||||
// - "indirect" - indirectly pinned objects (referenced by recursively pinned
|
||||
// objects)
|
||||
// - "all" - all pinned objects (default)
|
||||
func (pinIsPinnedOpts) Type(typeStr string) (PinIsPinnedOption, error) {
|
||||
switch typeStr {
|
||||
case "all", "direct", "indirect", "recursive":
|
||||
@ -242,11 +242,11 @@ func (pinIsPinnedOpts) Type(typeStr string) (PinIsPinnedOption, error) {
|
||||
// pin is expected to be, speeding up the research.
|
||||
//
|
||||
// Supported values:
|
||||
// * "direct" - directly pinned objects
|
||||
// * "recursive" - roots of recursive pins
|
||||
// * "indirect" - indirectly pinned objects (referenced by recursively pinned
|
||||
// objects)
|
||||
// * "all" - all pinned objects (default)
|
||||
// - "direct" - directly pinned objects
|
||||
// - "recursive" - roots of recursive pins
|
||||
// - "indirect" - indirectly pinned objects (referenced by recursively pinned
|
||||
// objects)
|
||||
// - "all" - all pinned objects (default)
|
||||
func (pinIsPinnedOpts) pinType(t string) PinIsPinnedOption {
|
||||
return func(settings *PinIsPinnedSettings) error {
|
||||
settings.WithType = t
|
||||
|
||||
@ -15,7 +15,7 @@ import (
|
||||
// * /ipfs - Immutable unixfs path (files)
|
||||
// * /ipld - Immutable ipld path (data)
|
||||
// * /ipns - Mutable names. Usually resolves to one of the immutable paths
|
||||
//TODO: /local (MFS)
|
||||
// TODO: /local (MFS)
|
||||
type Path interface {
|
||||
// String returns the path as a string.
|
||||
String() string
|
||||
|
||||
@ -2,6 +2,7 @@ package iface
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
|
||||
@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@ -211,7 +210,7 @@ func (tp *TestSuite) TestBlockGet(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
d, err := ioutil.ReadAll(r)
|
||||
d, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -249,7 +248,7 @@ func (tp *TestSuite) TestBlockRm(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
d, err := ioutil.ReadAll(r)
|
||||
d, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@ -2,12 +2,13 @@ package tests
|
||||
|
||||
import (
|
||||
"context"
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
"math"
|
||||
gopath "path"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
coreiface "github.com/ipfs/interface-go-ipfs-core"
|
||||
|
||||
ipldcbor "github.com/ipfs/go-ipld-cbor"
|
||||
|
||||
@ -4,11 +4,11 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core"
|
||||
iface "github.com/ipfs/interface-go-ipfs-core"
|
||||
opt "github.com/ipfs/interface-go-ipfs-core/options"
|
||||
)
|
||||
|
||||
@ -143,7 +143,7 @@ func (tp *TestSuite) TestObjectData(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadAll(r)
|
||||
data, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -383,7 +383,7 @@ func (tp *TestSuite) TestObjectAddData(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadAll(r)
|
||||
data, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -416,7 +416,7 @@ func (tp *TestSuite) TestObjectSetData(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadAll(r)
|
||||
data, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core"
|
||||
iface "github.com/ipfs/interface-go-ipfs-core"
|
||||
opt "github.com/ipfs/interface-go-ipfs-core/options"
|
||||
"github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core"
|
||||
iface "github.com/ipfs/interface-go-ipfs-core"
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
)
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"math/rand"
|
||||
"os"
|
||||
@ -113,7 +112,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
|
||||
return path.IpfsPath(c)
|
||||
}
|
||||
|
||||
rf, err := ioutil.TempFile(os.TempDir(), "unixfs-add-real")
|
||||
rf, err := os.CreateTemp(os.TempDir(), "unixfs-add-real")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -134,7 +133,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
|
||||
defer os.Remove(rfp)
|
||||
|
||||
realFile := func() files.Node {
|
||||
n, err := files.NewReaderPathFile(rfp, ioutil.NopCloser(strings.NewReader(helloStr)), stat)
|
||||
n, err := files.NewReaderPathFile(rfp, io.NopCloser(strings.NewReader(helloStr)), stat)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -474,12 +473,12 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
|
||||
defer orig.Close()
|
||||
defer got.Close()
|
||||
|
||||
do, err := ioutil.ReadAll(orig.(files.File))
|
||||
do, err := io.ReadAll(orig.(files.File))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
dg, err := ioutil.ReadAll(got.(files.File))
|
||||
dg, err := io.ReadAll(got.(files.File))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@ -2,11 +2,12 @@ package iface
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-ipfs-files"
|
||||
files "github.com/ipfs/go-ipfs-files"
|
||||
)
|
||||
|
||||
type AddEvent struct {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user