Docs: update

This commit is contained in:
kayos@tcp.direct 2022-08-28 23:44:32 -07:00
parent cf3b1bfff2
commit 4ee1b87bdf
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
2 changed files with 16 additions and 12 deletions

@ -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.

@ -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.