Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrObjectNotFound is returned when there is no object found. ErrObjectNotFound = Error{objNotFound, "Object not found"} // ErrBucketNotFound returns the error that no bucket found. ErrBucketNotFound = Error{bucketNotFound, "Bucket not found"} )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // Put write key-value into store. Put(bucket string, key string, value []byte) error // Get read object from store. Get(bucket string, key string) ([]byte, error) // Remove all data of the key. Remove(bucket string, key string) error // Truncate all data of the bucket. Truncate(bucket string) error // List return all objects with specify bucket. List(bucket string) ([][]byte, error) // Keys return all keys. Keys(bucket string) ([]string, error) // Path returns the path with the specified key. Path(key string) string // Close releases all resources used by the store // It does not make any changes to store. Close() error }
Backend is an interface which describes what a store should support. All methods are thread-safe port from https://github.com/alibaba/pouch/blob/master/pkg/meta/backend.go
func NewBoltDB ¶
func NewBoltDB(config common.ToodledoConfigDatabase) (Backend, error)
NewBoltDB is used to make bolt metadata store instance.
func ProvideBackend ¶
func ProvideBackend(config common.ToodledoConfigDatabase) (Backend, error)
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is a type of error used for meta.
func (Error) IsNotfound ¶
IsNotfound return true if code in MetaError is objNotfound.
Click to show internal directories.
Click to hide internal directories.