github.com/neatio-net/neatio@v1.7.3-0.20231114194659-f4d7a2226baa/neatdb/database.go (about)

     1  package neatdb
     2  
     3  import "io"
     4  
     5  type Reader interface {
     6  	Has(key []byte) (bool, error)
     7  
     8  	Get(key []byte) ([]byte, error)
     9  }
    10  
    11  type Writer interface {
    12  	Put(key []byte, value []byte) error
    13  
    14  	Delete(key []byte) error
    15  }
    16  
    17  type Stater interface {
    18  	Stat(property string) (string, error)
    19  }
    20  
    21  type Compacter interface {
    22  	Compact(start []byte, limit []byte) error
    23  }
    24  
    25  type KeyValueStore interface {
    26  	Reader
    27  	Writer
    28  	Batcher
    29  	Iteratee
    30  	Stater
    31  	Compacter
    32  	io.Closer
    33  }
    34  
    35  type Database interface {
    36  	Reader
    37  	Writer
    38  	Batcher
    39  	Iteratee
    40  	Stater
    41  	Compacter
    42  	io.Closer
    43  }