Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBadRequestError ¶
IsBadRequestError returns true if the error, or any of the wrapped errors is of type BadRequestError
func IsNotFoundError ¶
IsNotFoundError returns true if the error, or any of the wrapped errors is of type BadRequestError
func NewBadRequestError ¶
NewBadRequestError returns a new BadRequestError given an error message
func NewNotFoundError ¶
NewNotFoundError returns a new error for the missing key
Types ¶
type BadRequestError ¶
type BadRequestError struct {
// contains filtered or unexported fields
}
BadRequestError represents an error by the consumer of the database
func (*BadRequestError) Error ¶
func (b *BadRequestError) Error() string
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError indicates that no value was found for the given key
func (*NotFoundError) Error ¶
func (n *NotFoundError) Error() string
type Store ¶
type Store interface { // Get returns the value for the given key or any error encountered. If the // key was not found it will return a NotFoundError. Get(key string) ([]byte, error) // Put stores the value. It will return an BadRequestError if the provided // data was invalid or any other error encountered. Put(key string, value []byte) error // Delete deletes the value for the given key Delete(key string) error // Close closes the database and returns when all internal processes // has stopped. It returns any error encountered. Close() error // Returns true if the error signals that the given key was not found. IsNotFoundError(err error) bool // Returns true if the error signals that the consumer did something wrong. IsBadRequestError(err error) bool }
Store defines the kvdb public interface
Click to show internal directories.
Click to hide internal directories.