mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-20 14:35:07 +00:00
Generate clients (#206)
This commit is contained in:
4
examples/time/now/curl/returnsCurrentTimeOptionallyWithLocation.sh
Executable file
4
examples/time/now/curl/returnsCurrentTimeOptionallyWithLocation.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
curl "https://api.m3o.com/v1/time/Now" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{}'
|
||||
14
examples/time/now/go/returnsCurrentTimeOptionallyWithLocation.go
Executable file
14
examples/time/now/go/returnsCurrentTimeOptionallyWithLocation.go
Executable file
@@ -0,0 +1,14 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/time"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Get the current time
|
||||
func ReturnsCurrentTimeOptionallyWithLocation() {
|
||||
timeService := time.NewTimeService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := timeService.Now(&time.NowRequest{})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
10
examples/time/now/node/returnsCurrentTimeOptionallyWithLocation.js
Executable file
10
examples/time/now/node/returnsCurrentTimeOptionallyWithLocation.js
Executable file
@@ -0,0 +1,10 @@
|
||||
import * as time from "m3o/time";
|
||||
|
||||
// Get the current time
|
||||
async function ReturnsCurrentTimeOptionallyWithLocation() {
|
||||
let timeService = new time.TimeService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await timeService.now({});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await ReturnsCurrentTimeOptionallyWithLocation();
|
||||
6
examples/time/zone/curl/getTheTimezoneInfoForASpecificLocation.sh
Executable file
6
examples/time/zone/curl/getTheTimezoneInfoForASpecificLocation.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/time/Zone" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"location": "London"
|
||||
}'
|
||||
16
examples/time/zone/go/getTheTimezoneInfoForASpecificLocation.go
Executable file
16
examples/time/zone/go/getTheTimezoneInfoForASpecificLocation.go
Executable file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/time"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Get the timezone info for a specific location
|
||||
func GetTheTimezoneInfoForAspecificLocation() {
|
||||
timeService := time.NewTimeService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := timeService.Zone(&time.ZoneRequest{
|
||||
Location: "London",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/time/zone/node/getTheTimezoneInfoForASpecificLocation.js
Executable file
12
examples/time/zone/node/getTheTimezoneInfoForASpecificLocation.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as time from "m3o/time";
|
||||
|
||||
// Get the timezone info for a specific location
|
||||
async function GetTheTimezoneInfoForAspecificLocation() {
|
||||
let timeService = new time.TimeService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await timeService.zone({
|
||||
location: "London",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await GetTheTimezoneInfoForAspecificLocation();
|
||||
Reference in New Issue
Block a user