Docs: update
This commit is contained in:
parent
cf3b1bfff2
commit
4ee1b87bdf
11
README.md
11
README.md
@ -1,7 +1,7 @@
|
|||||||
# database
|
# database
|
||||||
|
|
||||||
[![Coverage](https://codecov.io/gh/yunginnanet/database/branch/master/graph/badge.svg)](https://codecov.io/gh/yunginnanet/database)
|
[![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/yunginnanet/database/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/yunginnanet/database/actions/workflows/go.yml)
|
[![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"`
|
`import "git.tcp.direct/tcp.direct/database"`
|
||||||
|
|
||||||
@ -27,6 +27,9 @@ type Filer interface {
|
|||||||
Close() error
|
Close() error
|
||||||
// Sync should take any volatile data and solidify it somehow if relevant. (ram to disk in most cases)
|
// Sync should take any volatile data and solidify it somehow if relevant. (ram to disk in most cases)
|
||||||
Sync() error
|
Sync() error
|
||||||
|
|
||||||
|
Keys() [][]byte
|
||||||
|
Len() int
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -65,8 +68,6 @@ backing up.
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
type Searcher interface {
|
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 must retrieve all keys in the datastore and stream them to the given channel.
|
||||||
PrefixScan(prefix string) (<-chan *kv.KeyValue, chan error)
|
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.
|
// 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
|
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.
|
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
|
#### func (Store) Backend
|
||||||
|
|
||||||
```go
|
```go
|
||||||
@ -147,6 +140,13 @@ func (s Store) Backend() any
|
|||||||
```
|
```
|
||||||
Backend returns the underlying bitcask instance.
|
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
|
#### func (Store) PrefixScan
|
||||||
|
|
||||||
```go
|
```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)
|
func (s Store) ValueExists(value []byte) (key []byte, ok bool)
|
||||||
```
|
```
|
||||||
ValueExists will check for the existence of a Value anywhere within the
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user