From 4ee1b87bdf15ea121434d569883bd254922035ff Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Sun, 28 Aug 2022 23:44:32 -0700 Subject: [PATCH] Docs: update --- README.md | 11 +++++++---- bitcask/README.md | 17 +++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6148b61..9acb4cf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # database -[![Coverage](https://codecov.io/gh/yunginnanet/database/branch/master/graph/badge.svg)](https://codecov.io/gh/yunginnanet/database) -[![Build Status](https://github.com/yunginnanet/database/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/yunginnanet/database/actions/workflows/go.yml) +[![Coverage](https://codecov.io/gh/tcp-direct/database/branch/master/graph/badge.svg)](https://codecov.io/gh/tcp-direct/database) +[![Build Status](https://github.com/tcp-direct/database/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/tcp-direct/database/actions/workflows/go.yml) `import "git.tcp.direct/tcp.direct/database"` @@ -27,6 +27,9 @@ type Filer interface { Close() error // Sync should take any volatile data and solidify it somehow if relevant. (ram to disk in most cases) Sync() error + + Keys() [][]byte + Len() int } ``` @@ -65,8 +68,6 @@ backing up. ```go type Searcher interface { - // AllKeys must retrieve all keys in the datastore with the given storeName. - AllKeys() [][]byte // PrefixScan must retrieve all keys in the datastore and stream them to the given channel. PrefixScan(prefix string) (<-chan *kv.KeyValue, chan error) // Search must be able to search through the value contents of our database and stream the results to the given channel. @@ -86,3 +87,5 @@ type Store interface { Searcher } ``` + +Store is an implementation of a Filer and a Searcher. diff --git a/bitcask/README.md b/bitcask/README.md index 6dfdc87..399fb29 100644 --- a/bitcask/README.md +++ b/bitcask/README.md @@ -133,13 +133,6 @@ type Store struct { Store is an implmentation of a Filer and a Searcher using Bitcask. -#### func (Store) AllKeys - -```go -func (s Store) AllKeys() (keys [][]byte) -``` -AllKeys will return all keys in the database as a slice of byte slices. - #### func (Store) Backend ```go @@ -147,6 +140,13 @@ func (s Store) Backend() any ``` Backend returns the underlying bitcask instance. +#### func (Store) Keys + +```go +func (s Store) Keys() (keys [][]byte) +``` +Keys will return all keys in the database as a slice of byte slices. + #### func (Store) PrefixScan ```go @@ -169,4 +169,5 @@ type casting will be necessary. (e.g: []byte or string) func (s Store) ValueExists(value []byte) (key []byte, ok bool) ``` ValueExists will check for the existence of a Value anywhere within the -keyspace, returning the Key and true if found, or nil and false if not found. +keyspace; returning the first Key found, true if found || nil and false if not +found.