Skip to content

Commit

Permalink
chore: update kubo to 0.27.0
Browse files Browse the repository at this point in the history
Signed-off-by: D4ryl00 <[email protected]>
  • Loading branch information
D4ryl00 committed Mar 29, 2024
1 parent f638d42 commit 3d95190
Show file tree
Hide file tree
Showing 16 changed files with 927 additions and 2,283 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang 1.19.7
golang 1.21.8
golangci-lint 1.50.1
14 changes: 7 additions & 7 deletions entry/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sort"

"github.com/ipfs/go-cid"
core_iface "github.com/ipfs/interface-go-ipfs-core"
coreiface "github.com/ipfs/kubo/core/coreiface"
"github.com/multiformats/go-multibase"

"berty.tech/go-ipfs-log/errmsg"
Expand Down Expand Up @@ -134,7 +134,7 @@ func (e *Entry) SetAdditionalDataValue(key string, value string) {
e.AdditionalData[key] = value
}

func CreateEntry(ctx context.Context, ipfsInstance core_iface.CoreAPI, identity *identityprovider.Identity, data *Entry, opts *iface.CreateEntryOptions) (iface.IPFSLogEntry, error) {
func CreateEntry(ctx context.Context, ipfsInstance coreiface.CoreAPI, identity *identityprovider.Identity, data *Entry, opts *iface.CreateEntryOptions) (iface.IPFSLogEntry, error) {
io, err := cbor.IO(&Entry{}, &LamportClock{})
if err != nil {
return nil, err
Expand All @@ -144,7 +144,7 @@ func CreateEntry(ctx context.Context, ipfsInstance core_iface.CoreAPI, identity
}

// CreateEntryWithIO creates an Entry.
func CreateEntryWithIO(ctx context.Context, ipfsInstance core_iface.CoreAPI, identity *identityprovider.Identity, data iface.IPFSLogEntry, opts *iface.CreateEntryOptions, io iface.IO) (iface.IPFSLogEntry, error) {
func CreateEntryWithIO(ctx context.Context, ipfsInstance coreiface.CoreAPI, identity *identityprovider.Identity, data iface.IPFSLogEntry, opts *iface.CreateEntryOptions, io iface.IO) (iface.IPFSLogEntry, error) {
if ipfsInstance == nil {
return nil, errmsg.ErrIPFSNotDefined
}
Expand Down Expand Up @@ -394,7 +394,7 @@ func (e *Entry) Verify(identity identityprovider.Interface, io iface.IO) error {
}

// ToMultihash gets the multihash of an Entry.
func (e *Entry) ToMultihash(ctx context.Context, ipfsInstance core_iface.CoreAPI, opts *iface.CreateEntryOptions) (cid.Cid, error) {
func (e *Entry) ToMultihash(ctx context.Context, ipfsInstance coreiface.CoreAPI, opts *iface.CreateEntryOptions) (cid.Cid, error) {
io, err := cbor.IO(&Entry{}, &LamportClock{})
if err != nil {
return cid.Undef, err
Expand All @@ -404,7 +404,7 @@ func (e *Entry) ToMultihash(ctx context.Context, ipfsInstance core_iface.CoreAPI
}

// ToMultihashWithIO gets the multihash of an Entry.
func ToMultihashWithIO(ctx context.Context, e iface.IPFSLogEntry, ipfsInstance core_iface.CoreAPI, opts *iface.CreateEntryOptions, io iface.IO) (cid.Cid, error) {
func ToMultihashWithIO(ctx context.Context, e iface.IPFSLogEntry, ipfsInstance coreiface.CoreAPI, opts *iface.CreateEntryOptions, io iface.IO) (cid.Cid, error) {
if opts == nil {
opts = &iface.CreateEntryOptions{}
}
Expand Down Expand Up @@ -468,7 +468,7 @@ func Normalize(e iface.IPFSLogEntry, opts *normalizeEntryOpts) *Entry {
}

// FromMultihash creates an Entry from a hash.
func FromMultihash(ctx context.Context, ipfs core_iface.CoreAPI, hash cid.Cid, provider identityprovider.Interface) (iface.IPFSLogEntry, error) {
func FromMultihash(ctx context.Context, ipfs coreiface.CoreAPI, hash cid.Cid, provider identityprovider.Interface) (iface.IPFSLogEntry, error) {
io, err := cbor.IO(&Entry{}, &LamportClock{})
if err != nil {
return nil, err
Expand All @@ -478,7 +478,7 @@ func FromMultihash(ctx context.Context, ipfs core_iface.CoreAPI, hash cid.Cid, p
}

// FromMultihashWithIO creates an Entry from a hash.
func FromMultihashWithIO(ctx context.Context, ipfs core_iface.CoreAPI, hash cid.Cid, provider identityprovider.Interface, io iface.IO) (iface.IPFSLogEntry, error) {
func FromMultihashWithIO(ctx context.Context, ipfs coreiface.CoreAPI, hash cid.Cid, provider identityprovider.Interface, io iface.IO) (iface.IPFSLogEntry, error) {
if ipfs == nil {
return nil, errmsg.ErrIPFSNotDefined
}
Expand Down
6 changes: 3 additions & 3 deletions entry/entry_io.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"

"github.com/ipfs/go-cid"
core_iface "github.com/ipfs/interface-go-ipfs-core"
coreiface "github.com/ipfs/kubo/core/coreiface"

"berty.tech/go-ipfs-log/iface"
)
Expand All @@ -13,13 +13,13 @@ type FetchOptions = iface.FetchOptions

// FetchParallel has the same comportement than FetchAll, we keep it for retrop
// compatibility purpose
func FetchParallel(ctx context.Context, ipfs core_iface.CoreAPI, hashes []cid.Cid, options *FetchOptions) []iface.IPFSLogEntry {
func FetchParallel(ctx context.Context, ipfs coreiface.CoreAPI, hashes []cid.Cid, options *FetchOptions) []iface.IPFSLogEntry {
fetcher := NewFetcher(ipfs, options)
return fetcher.Fetch(ctx, hashes)
}

// FetchAll gets entries from their CIDs.
func FetchAll(ctx context.Context, ipfs core_iface.CoreAPI, hashes []cid.Cid, options *FetchOptions) []iface.IPFSLogEntry {
func FetchAll(ctx context.Context, ipfs coreiface.CoreAPI, hashes []cid.Cid, options *FetchOptions) []iface.IPFSLogEntry {
fetcher := NewFetcher(ipfs, options)
return fetcher.Fetch(ctx, hashes)
}
6 changes: 3 additions & 3 deletions entry/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"berty.tech/go-ipfs-log/iface"
"berty.tech/go-ipfs-log/io/cbor"
"github.com/ipfs/go-cid"
core_iface "github.com/ipfs/interface-go-ipfs-core"
coreiface "github.com/ipfs/kubo/core/coreiface"
"golang.org/x/sync/semaphore"
)

Expand Down Expand Up @@ -39,11 +39,11 @@ type Fetcher struct {
condProcess *sync.Cond
muProcess *sync.RWMutex
sem *semaphore.Weighted
ipfs core_iface.CoreAPI
ipfs coreiface.CoreAPI
progressChan chan iface.IPFSLogEntry
}

func NewFetcher(ipfs core_iface.CoreAPI, options *FetchOptions) *Fetcher {
func NewFetcher(ipfs coreiface.CoreAPI, options *FetchOptions) *Fetcher {
// set default
length := -1
if options.Length != nil {
Expand Down
Loading

0 comments on commit 3d95190

Please sign in to comment.