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