mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 15:25:19 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/micro/services/clients/go/location"
|
||||
"github.com/micro/services/clients/go/otp"
|
||||
"github.com/micro/services/clients/go/postcode"
|
||||
"github.com/micro/services/clients/go/qr"
|
||||
"github.com/micro/services/clients/go/quran"
|
||||
"github.com/micro/services/clients/go/routing"
|
||||
"github.com/micro/services/clients/go/rss"
|
||||
@@ -56,6 +57,7 @@ func NewClient(token string) *Client {
|
||||
LocationService: location.NewLocationService(token),
|
||||
OtpService: otp.NewOtpService(token),
|
||||
PostcodeService: postcode.NewPostcodeService(token),
|
||||
QrService: qr.NewQrService(token),
|
||||
QuranService: quran.NewQuranService(token),
|
||||
RoutingService: routing.NewRoutingService(token),
|
||||
RssService: rss.NewRssService(token),
|
||||
@@ -93,6 +95,7 @@ type Client struct {
|
||||
LocationService *location.LocationService
|
||||
OtpService *otp.OtpService
|
||||
PostcodeService *postcode.PostcodeService
|
||||
QrService *qr.QrService
|
||||
QuranService *quran.QuranService
|
||||
RoutingService *routing.RoutingService
|
||||
RssService *rss.RssService
|
||||
|
||||
35
clients/go/qr/qr.go
Executable file
35
clients/go/qr/qr.go
Executable file
@@ -0,0 +1,35 @@
|
||||
package qr
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
)
|
||||
|
||||
func NewQrService(token string) *QrService {
|
||||
return &QrService{
|
||||
client: client.NewClient(&client.Options{
|
||||
Token: token,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
type QrService struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
//
|
||||
func (t *QrService) Generate(request *GenerateRequest) (*GenerateResponse, error) {
|
||||
rsp := &GenerateResponse{}
|
||||
return rsp, t.client.Call("qr", "Generate", request, rsp)
|
||||
}
|
||||
|
||||
type GenerateRequest struct {
|
||||
// the size (height and width) in pixels of the generated QR code. Defaults to 256
|
||||
Size int64 `json:"size"`
|
||||
// the text to encode as a QR code (URL, phone number, email, etc)
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
type GenerateResponse struct {
|
||||
// link to the QR code image in PNG format
|
||||
Qr string `json:"qr"`
|
||||
}
|
||||
@@ -87,7 +87,7 @@ type Result struct {
|
||||
// The associated arabic text
|
||||
Text string `json:"text"`
|
||||
// The related translations to the text
|
||||
Translations []Translation `json:"translations"`
|
||||
Translations []Interpretation `json:"translations"`
|
||||
// The unique verse id across the Quran
|
||||
VerseId int32 `json:"verseId"`
|
||||
// The verse key e.g 1:1
|
||||
@@ -161,7 +161,7 @@ type Verse struct {
|
||||
// The basic translation of the verse
|
||||
TranslatedText string `json:"translatedText"`
|
||||
// The alternative translations for the verse
|
||||
Translations []Translation `json:"translations"`
|
||||
Translations []Interpretation `json:"translations"`
|
||||
// The phonetic transliteration from arabic
|
||||
Transliteration string `json:"transliteration"`
|
||||
// The individual words within the verse (Ayah)
|
||||
|
||||
Reference in New Issue
Block a user