1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 11:31:54 +08:00

coreapi: Keystore API proposal

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera
2017-12-10 23:48:16 +01:00
parent 027f498bc9
commit 1b5fbb09b5
3 changed files with 173 additions and 4 deletions

View File

@ -44,6 +44,7 @@ type CoreAPI interface {
Unixfs() UnixfsAPI
Dag() DagAPI
Name() NameAPI
Key() KeyAPI
// ResolvePath resolves the path using Unixfs resolver
ResolvePath(context.Context, Path) (Path, error)
@ -102,11 +103,11 @@ type NameAPI interface {
Resolve(ctx context.Context, name string, recursive bool, local bool, nocache bool) (Path, error)
}
type KeyApi interface {
Generate(ctx context.Context, name string, algorithm string, size int) error
type KeyAPI interface {
Generate(ctx context.Context, name string, algorithm string, size int) (string, error)
List(ctx context.Context) (map[string]string, error) //TODO: better key type?
Rename(ctx context.Context, oldName string, newName string) error
Remove(ctx context.Context, name string) error
Rename(ctx context.Context, oldName string, newName string, force bool) (string, bool, error)
Remove(ctx context.Context, name string) (string, error)
}
// type ObjectAPI interface {