Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
feat: add RoutingAPI to CoreAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Nov 14, 2022
1 parent de3410b commit 63169fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions coreapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ type CoreAPI interface {
// PubSub returns an implementation of PubSub API
PubSub() PubSubAPI

// Routing returns an implementation of Routing API
Routing() RoutingAPI

// ResolvePath resolves the path using Unixfs resolver
ResolvePath(context.Context, path.Path) (path.Resolved, error)

Expand Down
11 changes: 11 additions & 0 deletions routing.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package iface

import (
"context"
)

// RoutingAPI specifies the interface to the routing layer.
type RoutingAPI interface {
// Get retrieves the best value for a given key
Get(context.Context, string) ([]byte, error)
}

0 comments on commit 63169fd

Please sign in to comment.