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 authored and lidel committed Jan 27, 2023
1 parent db9980e commit 177d25b
Show file tree
Hide file tree
Showing 2 changed files with 17 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
14 changes: 14 additions & 0 deletions routing.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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)

// Put sets a value for a given key
Put(ctx context.Context, key string, value []byte) error
}

0 comments on commit 177d25b

Please sign in to comment.