Files
m3o-go/examples/cache/get/getAValue.go
2021-11-03 15:16:55 +00:00

18 lines
331 B
Go
Executable File

package example
import (
"fmt"
"os"
"go.m3o.com/cache"
)
// Get an item from the cache by key. If key is not found, an empty response is returned.
func GetAvalue() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.Get(&cache.GetRequest{
Key: "foo",
})
fmt.Println(rsp, err)
}