mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 11:15:12 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
8
clients/go/cache/cache.go
vendored
8
clients/go/cache/cache.go
vendored
@@ -16,25 +16,25 @@ type CacheService struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
// Decrement a value (if it's a number)
|
||||
// Decrement a value (if it's a number). If key not found it is equivalent to set.
|
||||
func (t *CacheService) Decrement(request *DecrementRequest) (*DecrementResponse, error) {
|
||||
rsp := &DecrementResponse{}
|
||||
return rsp, t.client.Call("cache", "Decrement", request, rsp)
|
||||
}
|
||||
|
||||
// Delete a value from the cache
|
||||
// Delete a value from the cache. If key not found a success response is returned.
|
||||
func (t *CacheService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
|
||||
rsp := &DeleteResponse{}
|
||||
return rsp, t.client.Call("cache", "Delete", request, rsp)
|
||||
}
|
||||
|
||||
// Get an item from the cache by key
|
||||
// Get an item from the cache by key. If key is not found, an empty response is returned.
|
||||
func (t *CacheService) Get(request *GetRequest) (*GetResponse, error) {
|
||||
rsp := &GetResponse{}
|
||||
return rsp, t.client.Call("cache", "Get", request, rsp)
|
||||
}
|
||||
|
||||
// Increment a value (if it's a number)
|
||||
// Increment a value (if it's a number). If key not found it is equivalent to set.
|
||||
func (t *CacheService) Increment(request *IncrementRequest) (*IncrementResponse, error) {
|
||||
rsp := &IncrementResponse{}
|
||||
return rsp, t.client.Call("cache", "Increment", request, rsp)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/micro/services/clients/go/cache"
|
||||
)
|
||||
|
||||
// Decrement a value (if it's a number)
|
||||
// Decrement a value (if it's a number). If key not found it is equivalent to set.
|
||||
func DecrementAvalue() {
|
||||
cacheService := cache.NewCacheService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := cacheService.Decrement(&cache.DecrementRequest{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const { CacheService } = require("m3o/cache");
|
||||
|
||||
// Decrement a value (if it's a number)
|
||||
// Decrement a value (if it's a number). If key not found it is equivalent to set.
|
||||
async function decrementAvalue() {
|
||||
let cacheService = new CacheService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await cacheService.decrement({
|
||||
|
||||
2
examples/cache/delete/go/deleteAValue.go
vendored
2
examples/cache/delete/go/deleteAValue.go
vendored
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/micro/services/clients/go/cache"
|
||||
)
|
||||
|
||||
// Delete a value from the cache
|
||||
// Delete a value from the cache. If key not found a success response is returned.
|
||||
func DeleteAvalue() {
|
||||
cacheService := cache.NewCacheService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := cacheService.Delete(&cache.DeleteRequest{
|
||||
|
||||
2
examples/cache/delete/node/deleteAValue.js
vendored
2
examples/cache/delete/node/deleteAValue.js
vendored
@@ -1,6 +1,6 @@
|
||||
const { CacheService } = require("m3o/cache");
|
||||
|
||||
// Delete a value from the cache
|
||||
// Delete a value from the cache. If key not found a success response is returned.
|
||||
async function deleteAvalue() {
|
||||
let cacheService = new CacheService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await cacheService.delete({
|
||||
|
||||
2
examples/cache/get/go/getAValue.go
vendored
2
examples/cache/get/go/getAValue.go
vendored
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/micro/services/clients/go/cache"
|
||||
)
|
||||
|
||||
// Get an item from the cache by key
|
||||
// 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("MICRO_API_TOKEN"))
|
||||
rsp, err := cacheService.Get(&cache.GetRequest{
|
||||
|
||||
2
examples/cache/get/node/getAValue.js
vendored
2
examples/cache/get/node/getAValue.js
vendored
@@ -1,6 +1,6 @@
|
||||
const { CacheService } = require("m3o/cache");
|
||||
|
||||
// Get an item from the cache by key
|
||||
// Get an item from the cache by key. If key is not found, an empty response is returned.
|
||||
async function getAvalue() {
|
||||
let cacheService = new CacheService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await cacheService.get({
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/micro/services/clients/go/cache"
|
||||
)
|
||||
|
||||
// Increment a value (if it's a number)
|
||||
// Increment a value (if it's a number). If key not found it is equivalent to set.
|
||||
func IncrementAvalue() {
|
||||
cacheService := cache.NewCacheService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := cacheService.Increment(&cache.IncrementRequest{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const { CacheService } = require("m3o/cache");
|
||||
|
||||
// Increment a value (if it's a number)
|
||||
// Increment a value (if it's a number). If key not found it is equivalent to set.
|
||||
async function incrementAvalue() {
|
||||
let cacheService = new CacheService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await cacheService.increment({
|
||||
|
||||
@@ -12,10 +12,10 @@ func CreateArecord() {
|
||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := dbService.Create(&db.CreateRequest{
|
||||
Record: map[string]interface{}{
|
||||
"age": 42,
|
||||
"isActive": true,
|
||||
"id": "1",
|
||||
"name": "Jane",
|
||||
"age": 42,
|
||||
"isActive": true,
|
||||
},
|
||||
Table: "users",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user