Documentation ¶
Index ¶
- Variables
- func ConnectDatabase(cfg *entities.AppConfig) error
- func Del(key string) error
- func FindEntity(id string, prefix string, entity interface{}) error
- func Get(key string) (string, error)
- func GetAllValuesWithKeyPrefix(prefix string) (map[string]string, error)
- func Set(key string, val interface{}) error
- type CreateDatabaseError
- type DownError
- type NotImplementedDatabaseError
- type OperationError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNil = errors.New("no matching record found in redis database") Ctx = context.Background() Rdb *redis.Client )
Functions ¶
func ConnectDatabase ¶
func FindEntity ¶
Function for finding an entity from database
Types ¶
type CreateDatabaseError ¶
type CreateDatabaseError struct{}
CreateDatabaseError when cannot perform set on database
func (*CreateDatabaseError) Error ¶
func (err *CreateDatabaseError) Error() string
type DownError ¶
type DownError struct{}
DownError when its not a redis.Nil response, in this case the database is down
type NotImplementedDatabaseError ¶
type NotImplementedDatabaseError struct {
// contains filtered or unexported fields
}
NotImplementedDatabaseError when user tries to create a not implemented database
func (*NotImplementedDatabaseError) Error ¶
func (err *NotImplementedDatabaseError) Error() string
type OperationError ¶
type OperationError struct {
// contains filtered or unexported fields
}
OperationError when cannot perform a given operation on database (SET, GET, DELETE)
func (*OperationError) Error ¶
func (err *OperationError) Error() string
Click to show internal directories.
Click to hide internal directories.