Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-19 09:27:07 +00:00
parent b04245c5dd
commit c0d318a6c8
23 changed files with 1153 additions and 1153 deletions

View File

@@ -4,6 +4,35 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/cache/api](htt
Endpoints:
## Set
Set an item in the cache. Overwrites any existing value already set.
[https://m3o.com/cache/api#Set](https://m3o.com/cache/api#Set)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/cache"
)
// Set an item in the cache. Overwrites any existing value already set.
func SetAvalue() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.Set(&cache.SetRequest{
Key: "foo",
Value: "bar",
})
fmt.Println(rsp, err)
}
```
## Get
Get an item from the cache by key. If key is not found, an empty response is returned.
@@ -145,32 +174,3 @@ func ListTheKeys() {
}
```
## Set
Set an item in the cache. Overwrites any existing value already set.
[https://m3o.com/cache/api#Set](https://m3o.com/cache/api#Set)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/cache"
)
// Set an item in the cache. Overwrites any existing value already set.
func SetAvalue() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.Set(&cache.SetRequest{
Key: "foo",
Value: "bar",
})
fmt.Println(rsp, err)
}
```