mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-20 22:45:09 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -40,6 +40,7 @@ import (
|
||||
"github.com/micro/services/clients/go/user"
|
||||
"github.com/micro/services/clients/go/vehicle"
|
||||
"github.com/micro/services/clients/go/weather"
|
||||
"github.com/micro/services/clients/go/youtube"
|
||||
)
|
||||
|
||||
func NewClient(token string) *Client {
|
||||
@@ -85,6 +86,7 @@ func NewClient(token string) *Client {
|
||||
UserService: user.NewUserService(token),
|
||||
VehicleService: vehicle.NewVehicleService(token),
|
||||
WeatherService: weather.NewWeatherService(token),
|
||||
YoutubeService: youtube.NewYoutubeService(token),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,4 +132,5 @@ type Client struct {
|
||||
UserService *user.UserService
|
||||
VehicleService *vehicle.VehicleService
|
||||
WeatherService *weather.WeatherService
|
||||
YoutubeService *youtube.YoutubeService
|
||||
}
|
||||
|
||||
55
clients/go/youtube/youtube.go
Executable file
55
clients/go/youtube/youtube.go
Executable file
@@ -0,0 +1,55 @@
|
||||
package youtube
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
)
|
||||
|
||||
func NewYoutubeService(token string) *YoutubeService {
|
||||
return &YoutubeService{
|
||||
client: client.NewClient(&client.Options{
|
||||
Token: token,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
type YoutubeService struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
// Search for videos on YouTube
|
||||
func (t *YoutubeService) Search(request *SearchRequest) (*SearchResponse, error) {
|
||||
rsp := &SearchResponse{}
|
||||
return rsp, t.client.Call("youtube", "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 {
|
||||
// if live broadcast then indicates activity.
|
||||
// none, upcoming, live, completed
|
||||
Broadcasting string `json:"broadcasting"`
|
||||
// the channel id
|
||||
ChannelId string `json:"channelId"`
|
||||
// the channel title
|
||||
ChannelTitle string `json:"channelTitle"`
|
||||
// the result description
|
||||
Description string `json:"description"`
|
||||
// id of the result
|
||||
Id string `json:"id"`
|
||||
// kind of result; "video", "channel", "playlist"
|
||||
Kind string `json:"kind"`
|
||||
// published at time
|
||||
PublishedAt string `json:"publishedAt"`
|
||||
// title of the result
|
||||
Title string `json:"title"`
|
||||
// the associated url
|
||||
Url string `json:"url"`
|
||||
}
|
||||
1
clients/ts/.gitignore
vendored
1
clients/ts/.gitignore
vendored
@@ -52,3 +52,4 @@ url
|
||||
user
|
||||
vehicle
|
||||
weather
|
||||
youtube
|
||||
|
||||
@@ -37,6 +37,7 @@ import * as url from "./url";
|
||||
import * as user from "./user";
|
||||
import * as vehicle from "./vehicle";
|
||||
import * as weather from "./weather";
|
||||
import * as youtube from "./youtube";
|
||||
|
||||
export class Client {
|
||||
constructor(token: string) {
|
||||
@@ -79,6 +80,7 @@ export class Client {
|
||||
this.userService = new user.UserService(token);
|
||||
this.vehicleService = new vehicle.VehicleService(token);
|
||||
this.weatherService = new weather.WeatherService(token);
|
||||
this.youtubeService = new youtube.YoutubeService(token);
|
||||
}
|
||||
|
||||
addressService: address.AddressService;
|
||||
@@ -120,4 +122,5 @@ export class Client {
|
||||
userService: user.UserService;
|
||||
vehicleService: vehicle.VehicleService;
|
||||
weatherService: weather.WeatherService;
|
||||
youtubeService: youtube.YoutubeService;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,8 @@
|
||||
"url",
|
||||
"user",
|
||||
"vehicle",
|
||||
"weather"
|
||||
"weather",
|
||||
"youtube"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
@@ -74,5 +75,5 @@
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"types": "index.d.ts",
|
||||
"version": "1.0.559"
|
||||
"version": "1.0.560"
|
||||
}
|
||||
Reference in New Issue
Block a user