Commit from GitHub Actions (Publish APIs & Clients)

This commit is contained in:
asim
2021-10-25 11:21:28 +00:00
parent 0bfe1e3c19
commit c6debbaf8a
9 changed files with 93 additions and 2 deletions

48
clients/go/google/google.go Executable file
View File

@@ -0,0 +1,48 @@
package google
import (
"github.com/m3o/m3o-go/client"
)
func NewGoogleService(token string) *GoogleService {
return &GoogleService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type GoogleService struct {
client *client.Client
}
// Search for videos on Google
func (t *GoogleService) Search(request *SearchRequest) (*SearchResponse, error) {
rsp := &SearchResponse{}
return rsp, t.client.Call("google", "Search", request, rsp)
}
type SearchRequest struct {
// Query to search for
Query string `json:"query"`
}
type SearchResponse struct {
// List of results for the query
Results []SearchResult `json:"results"`
}
type SearchResult struct {
// abridged version of this search results URL, e.g. www.exampe.com
DisplayUrl string `json:"displayUrl"`
// id of the result
Id string `json:"id"`
// kind of result; "search"
Kind string `json:"kind"`
// the result snippet
Snippet string `json:"snippet"`
// title of the result
Title string `json:"title"`
// the full url for the result
Url string `json:"url"`
}

View File

@@ -14,6 +14,7 @@ import (
"github.com/micro/services/clients/go/forex"
"github.com/micro/services/clients/go/function"
"github.com/micro/services/clients/go/geocoding"
"github.com/micro/services/clients/go/google"
"github.com/micro/services/clients/go/helloworld"
"github.com/micro/services/clients/go/holidays"
"github.com/micro/services/clients/go/id"
@@ -60,6 +61,7 @@ func NewClient(token string) *Client {
ForexService: forex.NewForexService(token),
FunctionService: function.NewFunctionService(token),
GeocodingService: geocoding.NewGeocodingService(token),
GoogleService: google.NewGoogleService(token),
HelloworldService: helloworld.NewHelloworldService(token),
HolidaysService: holidays.NewHolidaysService(token),
IdService: id.NewIdService(token),
@@ -106,6 +108,7 @@ type Client struct {
ForexService *forex.ForexService
FunctionService *function.FunctionService
GeocodingService *geocoding.GeocodingService
GoogleService *google.GoogleService
HelloworldService *helloworld.HelloworldService
HolidaysService *holidays.HolidaysService
IdService *id.IdService

View File

@@ -24,6 +24,7 @@ forex
function
geocoding
gifs
google
helloworld
holidays
id

View File

@@ -11,6 +11,7 @@ import * as file from "./file";
import * as forex from "./forex";
import * as fx from "./function";
import * as geocoding from "./geocoding";
import * as google from "./google";
import * as helloworld from "./helloworld";
import * as holidays from "./holidays";
import * as id from "./id";
@@ -54,6 +55,7 @@ export class Client {
this.forexService = new forex.ForexService(token);
this.functionService = new fx.FunctionService(token);
this.geocodingService = new geocoding.GeocodingService(token);
this.googleService = new google.GoogleService(token);
this.helloworldService = new helloworld.HelloworldService(token);
this.holidaysService = new holidays.HolidaysService(token);
this.idService = new id.IdService(token);
@@ -96,6 +98,7 @@ export class Client {
forexService: forex.ForexService;
functionService: fx.FunctionService;
geocodingService: geocoding.GeocodingService;
googleService: google.GoogleService;
helloworldService: helloworld.HelloworldService;
holidaysService: holidays.HolidaysService;
idService: id.IdService;

View File

@@ -31,6 +31,7 @@
"function",
"geocoding",
"gifs",
"google",
"helloworld",
"holidays",
"id",
@@ -75,5 +76,5 @@
"prepare": "npm run build"
},
"types": "index.d.ts",
"version": "1.0.560"
"version": "1.0.561"
}