mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
8
cache/cache.go
vendored
8
cache/cache.go
vendored
@@ -16,25 +16,25 @@ type CacheService struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
// Decrement a value (if it's a number)
|
||||
// Decrement a value (if it's a number). If key not found it is equivalent to set.
|
||||
func (t *CacheService) Decrement(request *DecrementRequest) (*DecrementResponse, error) {
|
||||
rsp := &DecrementResponse{}
|
||||
return rsp, t.client.Call("cache", "Decrement", request, rsp)
|
||||
}
|
||||
|
||||
// Delete a value from the cache
|
||||
// Delete a value from the cache. If key not found a success response is returned.
|
||||
func (t *CacheService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
|
||||
rsp := &DeleteResponse{}
|
||||
return rsp, t.client.Call("cache", "Delete", request, rsp)
|
||||
}
|
||||
|
||||
// Get an item from the cache by key
|
||||
// Get an item from the cache by key. If key is not found, an empty response is returned.
|
||||
func (t *CacheService) Get(request *GetRequest) (*GetResponse, error) {
|
||||
rsp := &GetResponse{}
|
||||
return rsp, t.client.Call("cache", "Get", request, rsp)
|
||||
}
|
||||
|
||||
// Increment a value (if it's a number)
|
||||
// Increment a value (if it's a number). If key not found it is equivalent to set.
|
||||
func (t *CacheService) Increment(request *IncrementRequest) (*IncrementResponse, error) {
|
||||
rsp := &IncrementResponse{}
|
||||
return rsp, t.client.Call("cache", "Increment", request, rsp)
|
||||
|
||||
Reference in New Issue
Block a user