mirror of
https://github.com/kataras/iris.git
synced 2026-01-07 20:17:05 +00:00
add the new neffos StackExchange feature to the type aliases and shortcuts of the websocket subpackage and auto-enable debug mode on websocket MVC application when iris logger's level is set to debug
Former-commit-id: 4d8cb79d01a4172fc1ed7a9b626da0228d902b3c
This commit is contained in:
@@ -335,22 +335,20 @@ func (r *Service) GetKeys(prefix string) ([]string, error) {
|
||||
return r.getKeys(prefix)
|
||||
}
|
||||
|
||||
// GetBytes returns value, err by its key
|
||||
// you can use utils.Deserialize((.GetBytes("yourkey"),&theobject{})
|
||||
//returns nil and a filled error if something wrong happens
|
||||
func (r *Service) GetBytes(key string) ([]byte, error) {
|
||||
var redisVal []byte
|
||||
mn := radix.MaybeNil{Rcv: &redisVal}
|
||||
err := r.pool.Do(radix.Cmd(&mn, "GET", r.Config.Prefix+key))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if mn.Nil {
|
||||
return nil, ErrKeyNotFound.Format(key)
|
||||
}
|
||||
// // GetBytes returns bytes representation of a value based on given "key".
|
||||
// func (r *Service) GetBytes(key string) ([]byte, error) {
|
||||
// var redisVal []byte
|
||||
// mn := radix.MaybeNil{Rcv: &redisVal}
|
||||
// err := r.pool.Do(radix.Cmd(&mn, "GET", r.Config.Prefix+key))
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// if mn.Nil {
|
||||
// return nil, ErrKeyNotFound.Format(key)
|
||||
// }
|
||||
|
||||
return redisVal, nil
|
||||
}
|
||||
// return redisVal, nil
|
||||
// }
|
||||
|
||||
// Delete removes redis entry by specific key
|
||||
func (r *Service) Delete(key string) error {
|
||||
|
||||
Reference in New Issue
Block a user