mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -16,7 +16,7 @@ type PrayerService struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
//
|
||||
// Get the prayer (salah) times for a location on a given date
|
||||
func (t *PrayerService) Times(request *TimesRequest) (*TimesResponse, error) {
|
||||
rsp := &TimesResponse{}
|
||||
return rsp, t.client.Call("prayer", "Times", request, rsp)
|
||||
|
||||
@@ -61,5 +61,5 @@
|
||||
},
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"version": "1.0.527"
|
||||
"version": "1.0.528"
|
||||
}
|
||||
@@ -6,7 +6,7 @@ export class PrayerService {
|
||||
constructor(token: string) {
|
||||
this.client = new m3o.Client({ token: token });
|
||||
}
|
||||
//
|
||||
// Get the prayer (salah) times for a location on a given date
|
||||
times(request: TimesRequest): Promise<TimesResponse> {
|
||||
return this.client.call(
|
||||
"prayer",
|
||||
|
||||
@@ -11,10 +11,10 @@ func CreateArecord() {
|
||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := dbService.Create(&db.CreateRequest{
|
||||
Record: map[string]interface{}{
|
||||
"name": "Jane",
|
||||
"age": 42,
|
||||
"isActive": true,
|
||||
"id": "1",
|
||||
"name": "Jane",
|
||||
"age": 42,
|
||||
},
|
||||
Table: "users",
|
||||
})
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
//
|
||||
// Get the prayer (salah) times for a location on a given date
|
||||
func PrayerTimes() {
|
||||
prayerService := prayer.NewPrayerService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := prayerService.Times(&prayer.TimesRequest{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as prayer from "m3o/prayer";
|
||||
|
||||
//
|
||||
// Get the prayer (salah) times for a location on a given date
|
||||
async function PrayerTimes() {
|
||||
let prayerService = new prayer.PrayerService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await prayerService.times({
|
||||
|
||||
7
examples/weather/forecast/curl/forecastWeather.sh
Executable file
7
examples/weather/forecast/curl/forecastWeather.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
curl "https://api.m3o.com/v1/weather/Forecast" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"days": 2,
|
||||
"location": "London"
|
||||
}'
|
||||
17
examples/weather/forecast/go/forecastWeather.go
Executable file
17
examples/weather/forecast/go/forecastWeather.go
Executable file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/weather"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Get the weather forecast for the next 1-10 days
|
||||
func ForecastWeather() {
|
||||
weatherService := weather.NewWeatherService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := weatherService.Forecast(&weather.ForecastRequest{
|
||||
Days: 2,
|
||||
Location: "London",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
13
examples/weather/forecast/node/forecastWeather.js
Executable file
13
examples/weather/forecast/node/forecastWeather.js
Executable file
@@ -0,0 +1,13 @@
|
||||
import * as weather from "m3o/weather";
|
||||
|
||||
// Get the weather forecast for the next 1-10 days
|
||||
async function ForecastWeather() {
|
||||
let weatherService = new weather.WeatherService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await weatherService.forecast({
|
||||
days: 2,
|
||||
location: "London",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await ForecastWeather();
|
||||
Reference in New Issue
Block a user