1
0
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:
Gerasimos (Makis) Maropoulos
2019-07-11 12:59:11 +03:00
parent 82d645e3cb
commit 33dfb42d73
10 changed files with 83 additions and 57 deletions

View File

@@ -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 {