Files
m3o-go/examples/cache/increment/incrementAValue/main.go
2021-12-09 15:06:12 +00:00

19 lines
346 B
Go
Executable File

package main
import (
"fmt"
"os"
"go.m3o.com/cache"
)
// Increment a value (if it's a number). If key not found it is equivalent to set.
func main() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.Increment(&cache.IncrementRequest{
Key: "counter",
Value: 2,
})
fmt.Println(rsp, err)
}