Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-01-14 17:42:44 +00:00
parent 863b60c7db
commit ccc5de5cda
23 changed files with 1588 additions and 1530 deletions

16
cache/cache.go vendored
View File

@@ -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"`