mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
pointer value
This commit is contained in:
7
cache/handler/cache.go
vendored
7
cache/handler/cache.go
vendored
@@ -19,7 +19,7 @@ func (c *Cache) Get(ctx context.Context, req *pb.GetRequest, rsp *pb.GetResponse
|
|||||||
item := new(pb.Item)
|
item := new(pb.Item)
|
||||||
item.Key = req.Key
|
item.Key = req.Key
|
||||||
|
|
||||||
if err := cache.Context(ctx).Get(req.Key, item.Value); err != nil {
|
if err := cache.Context(ctx).Get(req.Key, &item.Value); err != nil {
|
||||||
return errors.InternalServerError("cache.get", err.Error())
|
return errors.InternalServerError("cache.get", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,6 +41,8 @@ func (c *Cache) Set(ctx context.Context, req *pb.SetRequest, rsp *pb.SetResponse
|
|||||||
return errors.InternalServerError("cache.set", err.Error())
|
return errors.InternalServerError("cache.set", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rsp.Status == "ok"
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,6 +53,9 @@ func (c *Cache) Delete(ctx context.Context, req *pb.DeleteRequest, rsp *pb.Delet
|
|||||||
if err := cache.Context(ctx).Delete(req.Key); err != nil {
|
if err := cache.Context(ctx).Delete(req.Key); err != nil {
|
||||||
return errors.InternalServerError("cache.delete", err.Error())
|
return errors.InternalServerError("cache.delete", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rsp.Status = "ok"
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user