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

Commit 177d25b

Browse files
hacdiaslidel
authored andcommitted
feat: add RoutingAPI to CoreAPI
1 parent db9980e commit 177d25b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

coreapi.go

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ type CoreAPI interface {
4444
// PubSub returns an implementation of PubSub API
4545
PubSub() PubSubAPI
4646

47+
// Routing returns an implementation of Routing API
48+
Routing() RoutingAPI
49+
4750
// ResolvePath resolves the path using Unixfs resolver
4851
ResolvePath(context.Context, path.Path) (path.Resolved, error)
4952

routing.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package iface
2+
3+
import (
4+
"context"
5+
)
6+
7+
// RoutingAPI specifies the interface to the routing layer.
8+
type RoutingAPI interface {
9+
// Get retrieves the best value for a given key
10+
Get(context.Context, string) ([]byte, error)
11+
12+
// Put sets a value for a given key
13+
Put(ctx context.Context, key string, value []byte) error
14+
}

0 commit comments

Comments
 (0)