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:
16
cache/cache.go
vendored
16
cache/cache.go
vendored
@@ -9,6 +9,7 @@ type Cache interface {
|
||||
Delete(*DeleteRequest) (*DeleteResponse, error)
|
||||
Get(*GetRequest) (*GetResponse, error)
|
||||
Increment(*IncrementRequest) (*IncrementResponse, error)
|
||||
ListKeys(*ListKeysRequest) (*ListKeysResponse, error)
|
||||
Set(*SetRequest) (*SetResponse, error)
|
||||
}
|
||||
|
||||
@@ -56,6 +57,14 @@ func (t *CacheService) Increment(request *IncrementRequest) (*IncrementResponse,
|
||||
|
||||
}
|
||||
|
||||
// List all the available keys
|
||||
func (t *CacheService) ListKeys(request *ListKeysRequest) (*ListKeysResponse, error) {
|
||||
|
||||
rsp := &ListKeysResponse{}
|
||||
return rsp, t.client.Call("cache", "ListKeys", request, rsp)
|
||||
|
||||
}
|
||||
|
||||
// Set an item in the cache. Overwrites any existing value already set.
|
||||
func (t *CacheService) Set(request *SetRequest) (*SetResponse, error) {
|
||||
|
||||
@@ -116,6 +125,13 @@ type IncrementResponse struct {
|
||||
Value int64 `json:"value,string"`
|
||||
}
|
||||
|
||||
type ListKeysRequest struct {
|
||||
}
|
||||
|
||||
type ListKeysResponse struct {
|
||||
Keys []string `json:"keys"`
|
||||
}
|
||||
|
||||
type SetRequest struct {
|
||||
// The key to update
|
||||
Key string `json:"key"`
|
||||
|
||||
Reference in New Issue
Block a user