1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00

add service interfaces

This commit is contained in:
Asim Aslam 2021-12-30 08:44:34 +00:00
parent 5fe884e59f
commit af5e70a1d6
55 changed files with 334 additions and 0 deletions

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Address interface {
LookupPostcode(*LookupPostcodeRequest) (*LookupPostcodeResponse, error)
}
func NewAddressService(token string) *AddressService {
return &AddressService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Answer interface {
Question(*QuestionRequest) (*QuestionResponse, error)
}
func NewAnswerService(token string) *AnswerService {
return &AnswerService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,17 @@ import (
"go.m3o.com/client"
)
type App interface {
Delete(*DeleteRequest) (*DeleteResponse, error)
List(*ListRequest) (*ListResponse, error)
Regions(*RegionsRequest) (*RegionsResponse, error)
Reserve(*ReserveRequest) (*ReserveResponse, error)
Resolve(*ResolveRequest) (*ResolveResponse, error)
Run(*RunRequest) (*RunResponse, error)
Status(*StatusRequest) (*StatusResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
}
func NewAppService(token string) *AppService {
return &AppService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Avatar interface {
Generate(*GenerateRequest) (*GenerateResponse, error)
}
func NewAvatarService(token string) *AvatarService {
return &AvatarService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,14 @@ import (
"go.m3o.com/client"
)
type Cache interface {
Decrement(*DecrementRequest) (*DecrementResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
Get(*GetRequest) (*GetResponse, error)
Increment(*IncrementRequest) (*IncrementResponse, error)
Set(*SetRequest) (*SetResponse, error)
}
func NewCacheService(token string) *CacheService {
return &CacheService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,14 @@ import (
"go.m3o.com/client"
)
type Contact interface {
Create(*CreateRequest) (*CreateResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
List(*ListRequest) (*ListResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
}
func NewContactService(token string) *ContactService {
return &ContactService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Crypto interface {
History(*HistoryRequest) (*HistoryResponse, error)
News(*NewsRequest) (*NewsResponse, error)
Price(*PriceRequest) (*PriceResponse, error)
Quote(*QuoteRequest) (*QuoteResponse, error)
}
func NewCryptoService(token string) *CryptoService {
return &CryptoService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Currency interface {
Codes(*CodesRequest) (*CodesResponse, error)
Convert(*ConvertRequest) (*ConvertResponse, error)
History(*HistoryRequest) (*HistoryResponse, error)
Rates(*RatesRequest) (*RatesResponse, error)
}
func NewCurrencyService(token string) *CurrencyService {
return &CurrencyService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,18 @@ import (
"go.m3o.com/client"
)
type Db interface {
Count(*CountRequest) (*CountResponse, error)
Create(*CreateRequest) (*CreateResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
DropTable(*DropTableRequest) (*DropTableResponse, error)
ListTables(*ListTablesRequest) (*ListTablesResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
RenameTable(*RenameTableRequest) (*RenameTableResponse, error)
Truncate(*TruncateRequest) (*TruncateResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
}
func NewDbService(token string) *DbService {
return &DbService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Email interface {
Send(*SendRequest) (*SendResponse, error)
}
func NewEmailService(token string) *EmailService {
return &EmailService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Emoji interface {
Find(*FindRequest) (*FindResponse, error)
Flag(*FlagRequest) (*FlagResponse, error)
Print(*PrintRequest) (*PrintResponse, error)
Send(*SendRequest) (*SendResponse, error)
}
func NewEmojiService(token string) *EmojiService {
return &EmojiService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Evchargers interface {
ReferenceData(*ReferenceDataRequest) (*ReferenceDataResponse, error)
Search(*SearchRequest) (*SearchResponse, error)
}
func NewEvchargersService(token string) *EvchargersService {
return &EvchargersService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,12 @@ import (
"go.m3o.com/client"
)
type Event interface {
Consume(*ConsumeRequest) (*ConsumeResponseStream, error)
Publish(*PublishRequest) (*PublishResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
}
func NewEventService(token string) *EventService {
return &EventService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type File interface {
Delete(*DeleteRequest) (*DeleteResponse, error)
List(*ListRequest) (*ListResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
Save(*SaveRequest) (*SaveResponse, error)
}
func NewFileService(token string) *FileService {
return &FileService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,12 @@ import (
"go.m3o.com/client"
)
type Forex interface {
History(*HistoryRequest) (*HistoryResponse, error)
Price(*PriceRequest) (*PriceResponse, error)
Quote(*QuoteRequest) (*QuoteResponse, error)
}
func NewForexService(token string) *ForexService {
return &ForexService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,18 @@ import (
"go.m3o.com/client"
)
type Function interface {
Call(*CallRequest) (*CallResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
Deploy(*DeployRequest) (*DeployResponse, error)
Describe(*DescribeRequest) (*DescribeResponse, error)
List(*ListRequest) (*ListResponse, error)
Proxy(*ProxyRequest) (*ProxyResponse, error)
Regions(*RegionsRequest) (*RegionsResponse, error)
Reserve(*ReserveRequest) (*ReserveResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
}
func NewFunctionService(token string) *FunctionService {
return &FunctionService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Geocoding interface {
Lookup(*LookupRequest) (*LookupResponse, error)
Reverse(*ReverseRequest) (*ReverseResponse, error)
}
func NewGeocodingService(token string) *GeocodingService {
return &GeocodingService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Gifs interface {
Search(*SearchRequest) (*SearchResponse, error)
}
func NewGifsService(token string) *GifsService {
return &GifsService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Google interface {
Search(*SearchRequest) (*SearchResponse, error)
}
func NewGoogleService(token string) *GoogleService {
return &GoogleService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Helloworld interface {
Call(*CallRequest) (*CallResponse, error)
Stream(*StreamRequest) (*StreamResponseStream, error)
}
func NewHelloworldService(token string) *HelloworldService {
return &HelloworldService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Holidays interface {
Countries(*CountriesRequest) (*CountriesResponse, error)
List(*ListRequest) (*ListResponse, error)
}
func NewHolidaysService(token string) *HolidaysService {
return &HolidaysService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Id interface {
Generate(*GenerateRequest) (*GenerateResponse, error)
Types(*TypesRequest) (*TypesResponse, error)
}
func NewIdService(token string) *IdService {
return &IdService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Image interface {
Convert(*ConvertRequest) (*ConvertResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
Resize(*ResizeRequest) (*ResizeResponse, error)
Upload(*UploadRequest) (*UploadResponse, error)
}
func NewImageService(token string) *ImageService {
return &ImageService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Ip interface {
Lookup(*LookupRequest) (*LookupResponse, error)
}
func NewIpService(token string) *IpService {
return &IpService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Joke interface {
Random(*RandomRequest) (*RandomResponse, error)
}
func NewJokeService(token string) *JokeService {
return &JokeService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,12 @@ import (
"go.m3o.com/client"
)
type Location interface {
Read(*ReadRequest) (*ReadResponse, error)
Save(*SaveRequest) (*SaveResponse, error)
Search(*SearchRequest) (*SearchResponse, error)
}
func NewLocationService(token string) *LocationService {
return &LocationService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Movie interface {
Search(*SearchRequest) (*SearchResponse, error)
}
func NewMovieService(token string) *MovieService {
return &MovieService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Mq interface {
Publish(*PublishRequest) (*PublishResponse, error)
Subscribe(*SubscribeRequest) (*SubscribeResponseStream, error)
}
func NewMqService(token string) *MqService {
return &MqService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type News interface {
Headlines(*HeadlinesRequest) (*HeadlinesResponse, error)
}
func NewNewsService(token string) *NewsService {
return &NewsService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,12 @@ import (
"go.m3o.com/client"
)
type Nft interface {
Assets(*AssetsRequest) (*AssetsResponse, error)
Collections(*CollectionsRequest) (*CollectionsResponse, error)
Create(*CreateRequest) (*CreateResponse, error)
}
func NewNftService(token string) *NftService {
return &NftService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,15 @@ import (
"go.m3o.com/client"
)
type Notes interface {
Create(*CreateRequest) (*CreateResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
Events(*EventsRequest) (*EventsResponseStream, error)
List(*ListRequest) (*ListResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
}
func NewNotesService(token string) *NotesService {
return &NotesService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Otp interface {
Generate(*GenerateRequest) (*GenerateResponse, error)
Validate(*ValidateRequest) (*ValidateResponse, error)
}
func NewOtpService(token string) *OtpService {
return &OtpService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,12 @@ import (
"go.m3o.com/client"
)
type Postcode interface {
Lookup(*LookupRequest) (*LookupResponse, error)
Random(*RandomRequest) (*RandomResponse, error)
Validate(*ValidateRequest) (*ValidateResponse, error)
}
func NewPostcodeService(token string) *PostcodeService {
return &PostcodeService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Prayer interface {
Times(*TimesRequest) (*TimesResponse, error)
}
func NewPrayerService(token string) *PrayerService {
return &PrayerService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Qr interface {
Generate(*GenerateRequest) (*GenerateResponse, error)
}
func NewQrService(token string) *QrService {
return &QrService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Quran interface {
Chapters(*ChaptersRequest) (*ChaptersResponse, error)
Search(*SearchRequest) (*SearchResponse, error)
Summary(*SummaryRequest) (*SummaryResponse, error)
Verses(*VersesRequest) (*VersesResponse, error)
}
func NewQuranService(token string) *QuranService {
return &QuranService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,12 @@ import (
"go.m3o.com/client"
)
type Routing interface {
Directions(*DirectionsRequest) (*DirectionsResponse, error)
Eta(*EtaRequest) (*EtaResponse, error)
Route(*RouteRequest) (*RouteResponse, error)
}
func NewRoutingService(token string) *RoutingService {
return &RoutingService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Rss interface {
Add(*AddRequest) (*AddResponse, error)
Feed(*FeedRequest) (*FeedResponse, error)
List(*ListRequest) (*ListResponse, error)
Remove(*RemoveRequest) (*RemoveResponse, error)
}
func NewRssService(token string) *RssService {
return &RssService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Search interface {
Vote(*VoteRequest) (*VoteResponse, error)
}
func NewSearchService(token string) *SearchService {
return &SearchService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Sentiment interface {
Analyze(*AnalyzeRequest) (*AnalyzeResponse, error)
}
func NewSentimentService(token string) *SentimentService {
return &SentimentService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Sms interface {
Send(*SendRequest) (*SendResponse, error)
}
func NewSmsService(token string) *SmsService {
return &SmsService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,17 @@ import (
"go.m3o.com/client"
)
type Space interface {
Create(*CreateRequest) (*CreateResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
Download(*DownloadRequest) (*DownloadResponse, error)
Head(*HeadRequest) (*HeadResponse, error)
List(*ListRequest) (*ListResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
Upload(*UploadRequest) (*UploadResponse, error)
}
func NewSpaceService(token string) *SpaceService {
return &SpaceService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Spam interface {
Classify(*ClassifyRequest) (*ClassifyResponse, error)
}
func NewSpamService(token string) *SpamService {
return &SpamService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Stock interface {
History(*HistoryRequest) (*HistoryResponse, error)
OrderBook(*OrderBookRequest) (*OrderBookResponse, error)
Price(*PriceRequest) (*PriceResponse, error)
Quote(*QuoteRequest) (*QuoteResponse, error)
}
func NewStockService(token string) *StockService {
return &StockService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Stream interface {
CreateChannel(*CreateChannelRequest) (*CreateChannelResponse, error)
ListChannels(*ListChannelsRequest) (*ListChannelsResponse, error)
ListMessages(*ListMessagesRequest) (*ListMessagesResponse, error)
SendMessage(*SendMessageRequest) (*SendMessageResponse, error)
}
func NewStreamService(token string) *StreamService {
return &StreamService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Sunnah interface {
Books(*BooksRequest) (*BooksResponse, error)
Chapters(*ChaptersRequest) (*ChaptersResponse, error)
Collections(*CollectionsRequest) (*CollectionsResponse, error)
Hadiths(*HadithsRequest) (*HadithsResponse, error)
}
func NewSunnahService(token string) *SunnahService {
return &SunnahService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Thumbnail interface {
Screenshot(*ScreenshotRequest) (*ScreenshotResponse, error)
}
func NewThumbnailService(token string) *ThumbnailService {
return &ThumbnailService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Time interface {
Now(*NowRequest) (*NowResponse, error)
Zone(*ZoneRequest) (*ZoneResponse, error)
}
func NewTimeService(token string) *TimeService {
return &TimeService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Translate interface {
Text(*TextRequest) (*TextResponse, error)
}
func NewTranslateService(token string) *TranslateService {
return &TranslateService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,13 @@ import (
"go.m3o.com/client"
)
type Twitter interface {
Search(*SearchRequest) (*SearchResponse, error)
Timeline(*TimelineRequest) (*TimelineResponse, error)
Trends(*TrendsRequest) (*TrendsResponse, error)
User(*UserRequest) (*UserResponse, error)
}
func NewTwitterService(token string) *TwitterService {
return &TwitterService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,12 @@ import (
"go.m3o.com/client"
)
type Url interface {
List(*ListRequest) (*ListResponse, error)
Proxy(*ProxyRequest) (*ProxyResponse, error)
Shorten(*ShortenRequest) (*ShortenResponse, error)
}
func NewUrlService(token string) *UrlService {
return &UrlService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,24 @@ import (
"go.m3o.com/client"
)
type User interface {
Create(*CreateRequest) (*CreateResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
List(*ListRequest) (*ListResponse, error)
Login(*LoginRequest) (*LoginResponse, error)
Logout(*LogoutRequest) (*LogoutResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
ReadSession(*ReadSessionRequest) (*ReadSessionResponse, error)
ResetPassword(*ResetPasswordRequest) (*ResetPasswordResponse, error)
SendMagicLink(*SendMagicLinkRequest) (*SendMagicLinkResponse, error)
SendPasswordResetEmail(*SendPasswordResetEmailRequest) (*SendPasswordResetEmailResponse, error)
SendVerificationEmail(*SendVerificationEmailRequest) (*SendVerificationEmailResponse, error)
UpdatePassword(*UpdatePasswordRequest) (*UpdatePasswordResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
VerifyEmail(*VerifyEmailRequest) (*VerifyEmailResponse, error)
VerifyToken(*VerifyTokenRequest) (*VerifyTokenResponse, error)
}
func NewUserService(token string) *UserService {
return &UserService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,10 @@ import (
"go.m3o.com/client"
)
type Vehicle interface {
Lookup(*LookupRequest) (*LookupResponse, error)
}
func NewVehicleService(token string) *VehicleService {
return &VehicleService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Weather interface {
Forecast(*ForecastRequest) (*ForecastResponse, error)
Now(*NowRequest) (*NowResponse, error)
}
func NewWeatherService(token string) *WeatherService {
return &WeatherService{
client: client.NewClient(&client.Options{

View File

@ -4,6 +4,11 @@ import (
"go.m3o.com/client"
)
type Youtube interface {
Embed(*EmbedRequest) (*EmbedResponse, error)
Search(*SearchRequest) (*SearchResponse, error)
}
func NewYoutubeService(token string) *YoutubeService {
return &YoutubeService{
client: client.NewClient(&client.Options{