mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Address interface {
|
||||||
|
LookupPostcode(*LookupPostcodeRequest) (*LookupPostcodeResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewAddressService(token string) *AddressService {
|
func NewAddressService(token string) *AddressService {
|
||||||
return &AddressService{
|
return &AddressService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Answer interface {
|
||||||
|
Question(*QuestionRequest) (*QuestionResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewAnswerService(token string) *AnswerService {
|
func NewAnswerService(token string) *AnswerService {
|
||||||
return &AnswerService{
|
return &AnswerService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
11
app/app.go
11
app/app.go
@@ -4,6 +4,17 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewAppService(token string) *AppService {
|
||||||
return &AppService{
|
return &AppService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Avatar interface {
|
||||||
|
Generate(*GenerateRequest) (*GenerateResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewAvatarService(token string) *AvatarService {
|
func NewAvatarService(token string) *AvatarService {
|
||||||
return &AvatarService{
|
return &AvatarService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
8
cache/cache.go
vendored
8
cache/cache.go
vendored
@@ -4,6 +4,14 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewCacheService(token string) *CacheService {
|
||||||
return &CacheService{
|
return &CacheService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,14 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewContactService(token string) *ContactService {
|
||||||
return &ContactService{
|
return &ContactService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewCryptoService(token string) *CryptoService {
|
||||||
return &CryptoService{
|
return &CryptoService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewCurrencyService(token string) *CurrencyService {
|
||||||
return &CurrencyService{
|
return &CurrencyService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
12
db/db.go
12
db/db.go
@@ -4,6 +4,18 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewDbService(token string) *DbService {
|
||||||
return &DbService{
|
return &DbService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Email interface {
|
||||||
|
Send(*SendRequest) (*SendResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewEmailService(token string) *EmailService {
|
func NewEmailService(token string) *EmailService {
|
||||||
return &EmailService{
|
return &EmailService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewEmojiService(token string) *EmojiService {
|
||||||
return &EmojiService{
|
return &EmojiService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Evchargers interface {
|
||||||
|
ReferenceData(*ReferenceDataRequest) (*ReferenceDataResponse, error)
|
||||||
|
Search(*SearchRequest) (*SearchResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewEvchargersService(token string) *EvchargersService {
|
func NewEvchargersService(token string) *EvchargersService {
|
||||||
return &EvchargersService{
|
return &EvchargersService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Event interface {
|
||||||
|
Consume(*ConsumeRequest) (*ConsumeResponseStream, error)
|
||||||
|
Publish(*PublishRequest) (*PublishResponse, error)
|
||||||
|
Read(*ReadRequest) (*ReadResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewEventService(token string) *EventService {
|
func NewEventService(token string) *EventService {
|
||||||
return &EventService{
|
return &EventService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/App/api](https
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
## Regions
|
|
||||||
|
|
||||||
Return the support regions
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/app/api#Regions](https://m3o.com/app/api#Regions)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/app"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Return the support regions
|
|
||||||
func ListRegions() {
|
|
||||||
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := appService.Regions(&app.RegionsRequest{
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
Get the status of an app
|
Get the status of an app
|
||||||
@@ -230,3 +203,30 @@ Repo: "github.com/asim/helloworld",
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
## Regions
|
||||||
|
|
||||||
|
Return the support regions
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/app/api#Regions](https://m3o.com/app/api#Regions)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/app"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Return the support regions
|
||||||
|
func ListRegions() {
|
||||||
|
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := appService.Regions(&app.RegionsRequest{
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
114
examples/cache/README.md
vendored
114
examples/cache/README.md
vendored
@@ -4,6 +4,63 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Cache/api](htt
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## Set
|
||||||
|
|
||||||
|
Set an item in the cache. Overwrites any existing value already set.
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/cache/api#Set](https://m3o.com/cache/api#Set)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Set an item in the cache. Overwrites any existing value already set.
|
||||||
|
func SetAvalue() {
|
||||||
|
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := cacheService.Set(&cache.SetRequest{
|
||||||
|
Key: "foo",
|
||||||
|
Value: "bar",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Get
|
||||||
|
|
||||||
|
Get an item from the cache by key. If key is not found, an empty response is returned.
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/cache/api#Get](https://m3o.com/cache/api#Get)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get an item from the cache by key. If key is not found, an empty response is returned.
|
||||||
|
func GetAvalue() {
|
||||||
|
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := cacheService.Get(&cache.GetRequest{
|
||||||
|
Key: "foo",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## Delete
|
## Delete
|
||||||
|
|
||||||
Delete a value from the cache. If key not found a success response is returned.
|
Delete a value from the cache. If key not found a success response is returned.
|
||||||
@@ -90,60 +147,3 @@ Value: 2,
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Set
|
|
||||||
|
|
||||||
Set an item in the cache. Overwrites any existing value already set.
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/cache/api#Set](https://m3o.com/cache/api#Set)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/cache"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Set an item in the cache. Overwrites any existing value already set.
|
|
||||||
func SetAvalue() {
|
|
||||||
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := cacheService.Set(&cache.SetRequest{
|
|
||||||
Key: "foo",
|
|
||||||
Value: "bar",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Get
|
|
||||||
|
|
||||||
Get an item from the cache by key. If key is not found, an empty response is returned.
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/cache/api#Get](https://m3o.com/cache/api#Get)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/cache"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Get an item from the cache by key. If key is not found, an empty response is returned.
|
|
||||||
func GetAvalue() {
|
|
||||||
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := cacheService.Get(&cache.GetRequest{
|
|
||||||
Key: "foo",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -4,62 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Contact/api](h
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
## List
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/contact"
|
|
||||||
)
|
|
||||||
|
|
||||||
//
|
|
||||||
func ListContactsWithDefaultOffsetAndLimitDefaultLimitIs20() {
|
|
||||||
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := contactService.List(&contact.ListRequest{
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## List
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/contact"
|
|
||||||
)
|
|
||||||
|
|
||||||
//
|
|
||||||
func ListContactsWithSpecificOffsetAndLimit() {
|
|
||||||
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := contactService.List(&contact.ListRequest{
|
|
||||||
Limit: 1,
|
|
||||||
Offset: 1,
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Create
|
## Create
|
||||||
|
|
||||||
|
|
||||||
@@ -217,3 +161,59 @@ func DeleteAcontact() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
## List
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/contact"
|
||||||
|
)
|
||||||
|
|
||||||
|
//
|
||||||
|
func ListContactsWithDefaultOffsetAndLimitDefaultLimitIs20() {
|
||||||
|
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := contactService.List(&contact.ListRequest{
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## List
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/contact"
|
||||||
|
)
|
||||||
|
|
||||||
|
//
|
||||||
|
func ListContactsWithSpecificOffsetAndLimit() {
|
||||||
|
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := contactService.List(&contact.ListRequest{
|
||||||
|
Limit: 1,
|
||||||
|
Offset: 1,
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -4,35 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Currency/api](
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
## History
|
|
||||||
|
|
||||||
Returns the historic rates for a currency on a given date
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/currency/api#History](https://m3o.com/currency/api#History)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/currency"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Returns the historic rates for a currency on a given date
|
|
||||||
func HistoricRatesForAcurrency() {
|
|
||||||
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := currencyService.History(¤cy.HistoryRequest{
|
|
||||||
Code: "USD",
|
|
||||||
Date: "2021-05-30",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Codes
|
## Codes
|
||||||
|
|
||||||
Codes returns the supported currency codes for the API
|
Codes returns the supported currency codes for the API
|
||||||
@@ -147,3 +118,32 @@ To: "GBP",
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
## History
|
||||||
|
|
||||||
|
Returns the historic rates for a currency on a given date
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/currency/api#History](https://m3o.com/currency/api#History)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/currency"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Returns the historic rates for a currency on a given date
|
||||||
|
func HistoricRatesForAcurrency() {
|
||||||
|
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := currencyService.History(¤cy.HistoryRequest{
|
||||||
|
Code: "USD",
|
||||||
|
Date: "2021-05-30",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -4,6 +4,35 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Db/api](https:
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## Delete
|
||||||
|
|
||||||
|
Delete a record in the database by id.
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/db/api#Delete](https://m3o.com/db/api#Delete)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/db"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Delete a record in the database by id.
|
||||||
|
func DeleteArecord() {
|
||||||
|
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := dbService.Delete(&db.DeleteRequest{
|
||||||
|
Id: "1",
|
||||||
|
Table: "example",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## Update
|
## Update
|
||||||
|
|
||||||
Update a record in the database. Include an "id" in the record to update.
|
Update a record in the database. Include an "id" in the record to update.
|
||||||
@@ -63,35 +92,6 @@ Table: "example",
|
|||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Delete
|
|
||||||
|
|
||||||
Delete a record in the database by id.
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/db/api#Delete](https://m3o.com/db/api#Delete)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/db"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Delete a record in the database by id.
|
|
||||||
func DeleteArecord() {
|
|
||||||
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := dbService.Delete(&db.DeleteRequest{
|
|
||||||
Id: "1",
|
|
||||||
Table: "example",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Truncate
|
## Truncate
|
||||||
@@ -120,68 +120,6 @@ func TruncateTable() {
|
|||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Count
|
|
||||||
|
|
||||||
Count records in a table
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/db"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Count records in a table
|
|
||||||
func CountEntriesInAtable() {
|
|
||||||
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := dbService.Count(&db.CountRequest{
|
|
||||||
Table: "example",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Create
|
|
||||||
|
|
||||||
Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/db/api#Create](https://m3o.com/db/api#Create)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/db"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
|
||||||
func CreateArecord() {
|
|
||||||
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := dbService.Create(&db.CreateRequest{
|
|
||||||
Record: map[string]interface{}{
|
|
||||||
"id": "1",
|
|
||||||
"name": "Jane",
|
|
||||||
"age": 42,
|
|
||||||
"isActive": true,
|
|
||||||
},
|
|
||||||
Table: "example",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## DropTable
|
## DropTable
|
||||||
@@ -210,6 +148,34 @@ func DropTable() {
|
|||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Count
|
||||||
|
|
||||||
|
Count records in a table
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/db"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Count records in a table
|
||||||
|
func CountEntriesInAtable() {
|
||||||
|
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := dbService.Count(&db.CountRequest{
|
||||||
|
Table: "example",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## ListTables
|
## ListTables
|
||||||
@@ -268,3 +234,37 @@ To: "examples3",
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
## Create
|
||||||
|
|
||||||
|
Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/db/api#Create](https://m3o.com/db/api#Create)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/db"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
||||||
|
func CreateArecord() {
|
||||||
|
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := dbService.Create(&db.CreateRequest{
|
||||||
|
Record: map[string]interface{}{
|
||||||
|
"id": "1",
|
||||||
|
"name": "Jane",
|
||||||
|
"age": 42,
|
||||||
|
"isActive": true,
|
||||||
|
},
|
||||||
|
Table: "example",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ func main() {
|
|||||||
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := dbService.Create(&db.CreateRequest{
|
rsp, err := dbService.Create(&db.CreateRequest{
|
||||||
Record: map[string]interface{}{
|
Record: map[string]interface{}{
|
||||||
|
"id": "1",
|
||||||
"name": "Jane",
|
"name": "Jane",
|
||||||
"age": 42,
|
"age": 42,
|
||||||
"isActive": true,
|
"isActive": true,
|
||||||
"id": "1",
|
|
||||||
},
|
},
|
||||||
Table: "example",
|
Table: "example",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ func main() {
|
|||||||
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := dbService.Update(&db.UpdateRequest{
|
rsp, err := dbService.Update(&db.UpdateRequest{
|
||||||
Record: map[string]interface{}{
|
Record: map[string]interface{}{
|
||||||
"age": 43,
|
|
||||||
"id": "1",
|
"id": "1",
|
||||||
|
"age": 43,
|
||||||
},
|
},
|
||||||
Table: "example",
|
Table: "example",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,34 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Event/api](htt
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
## Read
|
|
||||||
|
|
||||||
Read stored events
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/event/api#Read](https://m3o.com/event/api#Read)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/event"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Read stored events
|
|
||||||
func ReadEventsOnAtopic() {
|
|
||||||
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := eventService.Read(&event.ReadRequest{
|
|
||||||
Topic: "user",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Publish
|
## Publish
|
||||||
|
|
||||||
Publish a event to the event stream.
|
Publish a event to the event stream.
|
||||||
@@ -54,9 +26,9 @@ func PublishAnEvent() {
|
|||||||
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
|
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := eventService.Publish(&event.PublishRequest{
|
rsp, err := eventService.Publish(&event.PublishRequest{
|
||||||
Message: map[string]interface{}{
|
Message: map[string]interface{}{
|
||||||
|
"id": "1",
|
||||||
"type": "signup",
|
"type": "signup",
|
||||||
"user": "john",
|
"user": "john",
|
||||||
"id": "1",
|
|
||||||
},
|
},
|
||||||
Topic: "user",
|
Topic: "user",
|
||||||
|
|
||||||
@@ -106,3 +78,31 @@ func ConsumeFromAtopic() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
## Read
|
||||||
|
|
||||||
|
Read stored events
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/event/api#Read](https://m3o.com/event/api#Read)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/event"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Read stored events
|
||||||
|
func ReadEventsOnAtopic() {
|
||||||
|
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := eventService.Read(&event.ReadRequest{
|
||||||
|
Topic: "user",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -4,6 +4,35 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/File/api](http
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## Delete
|
||||||
|
|
||||||
|
Delete a file by project name/path
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/file/api#Delete](https://m3o.com/file/api#Delete)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/file"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Delete a file by project name/path
|
||||||
|
func DeleteFile() {
|
||||||
|
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := fileService.Delete(&file.DeleteRequest{
|
||||||
|
Path: "/document/text-files/file.txt",
|
||||||
|
Project: "examples",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## Save
|
## Save
|
||||||
|
|
||||||
Save a file
|
Save a file
|
||||||
@@ -93,32 +122,3 @@ Project: "examples",
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Delete
|
|
||||||
|
|
||||||
Delete a file by project name/path
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/file/api#Delete](https://m3o.com/file/api#Delete)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/file"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Delete a file by project name/path
|
|
||||||
func DeleteFile() {
|
|
||||||
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := fileService.Delete(&file.DeleteRequest{
|
|
||||||
Path: "/document/text-files/file.txt",
|
|
||||||
Project: "examples",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -30,6 +30,37 @@ func UpdateAfunction() {
|
|||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Call
|
||||||
|
|
||||||
|
Call a function by name
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/function/api#Call](https://m3o.com/function/api#Call)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/function"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Call a function by name
|
||||||
|
func CallAfunction() {
|
||||||
|
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := functionService.Call(&function.CallRequest{
|
||||||
|
Name: "helloworld",
|
||||||
|
Request: map[string]interface{}{
|
||||||
|
"name": "Alice",
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## List
|
## List
|
||||||
@@ -57,62 +88,6 @@ func ListFunctions() {
|
|||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Delete
|
|
||||||
|
|
||||||
Delete a function by name
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/function/api#Delete](https://m3o.com/function/api#Delete)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/function"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Delete a function by name
|
|
||||||
func DeleteAfunction() {
|
|
||||||
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := functionService.Delete(&function.DeleteRequest{
|
|
||||||
Name: "helloworld",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Describe
|
|
||||||
|
|
||||||
Get the info for a deployed function
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/function/api#Describe](https://m3o.com/function/api#Describe)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/function"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Get the info for a deployed function
|
|
||||||
func DescribeFunctionStatus() {
|
|
||||||
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := functionService.Describe(&function.DescribeRequest{
|
|
||||||
Name: "helloworld",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Regions
|
## Regions
|
||||||
@@ -174,6 +149,62 @@ Subfolder: "examples/go-function",
|
|||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Delete
|
||||||
|
|
||||||
|
Delete a function by name
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/function/api#Delete](https://m3o.com/function/api#Delete)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/function"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Delete a function by name
|
||||||
|
func DeleteAfunction() {
|
||||||
|
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := functionService.Delete(&function.DeleteRequest{
|
||||||
|
Name: "helloworld",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Describe
|
||||||
|
|
||||||
|
Get the info for a deployed function
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/function/api#Describe](https://m3o.com/function/api#Describe)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/function"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get the info for a deployed function
|
||||||
|
func DescribeFunctionStatus() {
|
||||||
|
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := functionService.Describe(&function.DescribeRequest{
|
||||||
|
Name: "helloworld",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Reserve
|
## Reserve
|
||||||
@@ -232,34 +263,3 @@ func ProxyUrl() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Call
|
|
||||||
|
|
||||||
Call a function by name
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/function/api#Call](https://m3o.com/function/api#Call)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/function"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Call a function by name
|
|
||||||
func CallAfunction() {
|
|
||||||
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := functionService.Call(&function.CallRequest{
|
|
||||||
Name: "helloworld",
|
|
||||||
Request: map[string]interface{}{
|
|
||||||
"name": "Alice",
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ func main() {
|
|||||||
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
|
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := mqService.Publish(&mq.PublishRequest{
|
rsp, err := mqService.Publish(&mq.PublishRequest{
|
||||||
Message: map[string]interface{}{
|
Message: map[string]interface{}{
|
||||||
"type": "signup",
|
|
||||||
"user": "john",
|
"user": "john",
|
||||||
"id": "1",
|
"id": "1",
|
||||||
|
"type": "signup",
|
||||||
},
|
},
|
||||||
Topic: "events",
|
Topic: "events",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Nft/api](https
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## Assets
|
||||||
|
|
||||||
|
Return a list of assets
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/nft/api#Assets](https://m3o.com/nft/api#Assets)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/nft"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Return a list of assets
|
||||||
|
func GetAlistOfAssets() {
|
||||||
|
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := nftService.Assets(&nft.AssetsRequest{
|
||||||
|
Limit: 1,
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## Create
|
## Create
|
||||||
|
|
||||||
Create your own NFT (coming soon)
|
Create your own NFT (coming soon)
|
||||||
@@ -61,31 +89,3 @@ func ListCollections() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Assets
|
|
||||||
|
|
||||||
Return a list of assets
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/nft/api#Assets](https://m3o.com/nft/api#Assets)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/nft"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Return a list of assets
|
|
||||||
func GetAlistOfAssets() {
|
|
||||||
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := nftService.Assets(&nft.AssetsRequest{
|
|
||||||
Limit: 1,
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -4,6 +4,62 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Quran/api](htt
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## Chapters
|
||||||
|
|
||||||
|
List the Chapters (surahs) of the Quran
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/quran/api#Chapters](https://m3o.com/quran/api#Chapters)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/quran"
|
||||||
|
)
|
||||||
|
|
||||||
|
// List the Chapters (surahs) of the Quran
|
||||||
|
func ListChapters() {
|
||||||
|
quranService := quran.NewQuranService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := quranService.Chapters(&quran.ChaptersRequest{
|
||||||
|
Language: "en",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Get a summary for a given chapter (surah)
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/quran/api#Summary](https://m3o.com/quran/api#Summary)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/quran"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get a summary for a given chapter (surah)
|
||||||
|
func GetChapterSummary() {
|
||||||
|
quranService := quran.NewQuranService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := quranService.Summary(&quran.SummaryRequest{
|
||||||
|
Chapter: 1,
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## Verses
|
## Verses
|
||||||
|
|
||||||
Lookup the verses (ayahs) for a chapter including
|
Lookup the verses (ayahs) for a chapter including
|
||||||
@@ -64,59 +120,3 @@ func SearchTheQuran() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Chapters
|
|
||||||
|
|
||||||
List the Chapters (surahs) of the Quran
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/quran/api#Chapters](https://m3o.com/quran/api#Chapters)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/quran"
|
|
||||||
)
|
|
||||||
|
|
||||||
// List the Chapters (surahs) of the Quran
|
|
||||||
func ListChapters() {
|
|
||||||
quranService := quran.NewQuranService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := quranService.Chapters(&quran.ChaptersRequest{
|
|
||||||
Language: "en",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Get a summary for a given chapter (surah)
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/quran/api#Summary](https://m3o.com/quran/api#Summary)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/quran"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Get a summary for a given chapter (surah)
|
|
||||||
func GetChapterSummary() {
|
|
||||||
quranService := quran.NewQuranService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := quranService.Summary(&quran.SummaryRequest{
|
|
||||||
Chapter: 1,
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -4,6 +4,61 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Rss/api](https
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## List
|
||||||
|
|
||||||
|
List the saved RSS fields
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/rss/api#List](https://m3o.com/rss/api#List)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/rss"
|
||||||
|
)
|
||||||
|
|
||||||
|
// List the saved RSS fields
|
||||||
|
func ListRssFeeds() {
|
||||||
|
rssService := rss.NewRssService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := rssService.List(&rss.ListRequest{
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Remove
|
||||||
|
|
||||||
|
Remove an RSS feed by name
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/rss/api#Remove](https://m3o.com/rss/api#Remove)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/rss"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Remove an RSS feed by name
|
||||||
|
func RemoveAfeed() {
|
||||||
|
rssService := rss.NewRssService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := rssService.Remove(&rss.RemoveRequest{
|
||||||
|
Name: "bbc",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## Add
|
## Add
|
||||||
|
|
||||||
Add a new RSS feed with a name, url, and category
|
Add a new RSS feed with a name, url, and category
|
||||||
@@ -62,58 +117,3 @@ func ReadAfeed() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## List
|
|
||||||
|
|
||||||
List the saved RSS fields
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/rss/api#List](https://m3o.com/rss/api#List)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/rss"
|
|
||||||
)
|
|
||||||
|
|
||||||
// List the saved RSS fields
|
|
||||||
func ListRssFeeds() {
|
|
||||||
rssService := rss.NewRssService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := rssService.List(&rss.ListRequest{
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Remove
|
|
||||||
|
|
||||||
Remove an RSS feed by name
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/rss/api#Remove](https://m3o.com/rss/api#Remove)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/rss"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Remove an RSS feed by name
|
|
||||||
func RemoveAfeed() {
|
|
||||||
rssService := rss.NewRssService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := rssService.Remove(&rss.RemoveRequest{
|
|
||||||
Name: "bbc",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Space/api](htt
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## List
|
||||||
|
|
||||||
|
List the objects in space
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/space/api#List](https://m3o.com/space/api#List)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/space"
|
||||||
|
)
|
||||||
|
|
||||||
|
// List the objects in space
|
||||||
|
func ListObjectsWithPrefix() {
|
||||||
|
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := spaceService.List(&space.ListRequest{
|
||||||
|
Prefix: "images/",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## Head
|
## Head
|
||||||
|
|
||||||
Retrieve meta information about an object
|
Retrieve meta information about an object
|
||||||
@@ -204,31 +232,3 @@ func DeleteAnObject() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## List
|
|
||||||
|
|
||||||
List the objects in space
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/space/api#List](https://m3o.com/space/api#List)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/space"
|
|
||||||
)
|
|
||||||
|
|
||||||
// List the objects in space
|
|
||||||
func ListObjectsWithPrefix() {
|
|
||||||
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := spaceService.List(&space.ListRequest{
|
|
||||||
Prefix: "images/",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -4,38 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Stock/api](htt
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
## OrderBook
|
|
||||||
|
|
||||||
Get the historic order book and each trade by timestamp
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/stock/api#OrderBook](https://m3o.com/stock/api#OrderBook)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/stock"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Get the historic order book and each trade by timestamp
|
|
||||||
func OrderBookHistory() {
|
|
||||||
stockService := stock.NewStockService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := stockService.OrderBook(&stock.OrderBookRequest{
|
|
||||||
Date: "2020-10-01",
|
|
||||||
End: "2020-10-01T11:00:00Z",
|
|
||||||
Limit: 3,
|
|
||||||
Start: "2020-10-01T10:00:00Z",
|
|
||||||
Stock: "AAPL",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Price
|
## Price
|
||||||
|
|
||||||
Get the last price for a given stock ticker
|
Get the last price for a given stock ticker
|
||||||
@@ -121,3 +89,35 @@ Stock: "AAPL",
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
## OrderBook
|
||||||
|
|
||||||
|
Get the historic order book and each trade by timestamp
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/stock/api#OrderBook](https://m3o.com/stock/api#OrderBook)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/stock"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get the historic order book and each trade by timestamp
|
||||||
|
func OrderBookHistory() {
|
||||||
|
stockService := stock.NewStockService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := stockService.OrderBook(&stock.OrderBookRequest{
|
||||||
|
Date: "2020-10-01",
|
||||||
|
End: "2020-10-01T11:00:00Z",
|
||||||
|
Limit: 3,
|
||||||
|
Start: "2020-10-01T10:00:00Z",
|
||||||
|
Stock: "AAPL",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -4,6 +4,33 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Stream/api](ht
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## ListChannels
|
||||||
|
|
||||||
|
List all the active channels
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/stream/api#ListChannels](https://m3o.com/stream/api#ListChannels)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/stream"
|
||||||
|
)
|
||||||
|
|
||||||
|
// List all the active channels
|
||||||
|
func ListChannels() {
|
||||||
|
streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := streamService.ListChannels(&stream.ListChannelsRequest{
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## CreateChannel
|
## CreateChannel
|
||||||
|
|
||||||
Create a channel with a given name and description. Channels are created automatically but
|
Create a channel with a given name and description. Channels are created automatically but
|
||||||
@@ -92,30 +119,3 @@ func ListMessages() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## ListChannels
|
|
||||||
|
|
||||||
List all the active channels
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/stream/api#ListChannels](https://m3o.com/stream/api#ListChannels)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/stream"
|
|
||||||
)
|
|
||||||
|
|
||||||
// List all the active channels
|
|
||||||
func ListChannels() {
|
|
||||||
streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := streamService.ListChannels(&stream.ListChannelsRequest{
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -4,37 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Sunnah/api](ht
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
## Hadiths
|
|
||||||
|
|
||||||
Hadiths returns a list of hadiths and their corresponding text for a
|
|
||||||
given book within a collection.
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/sunnah/api#Hadiths](https://m3o.com/sunnah/api#Hadiths)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/sunnah"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Hadiths returns a list of hadiths and their corresponding text for a
|
|
||||||
// given book within a collection.
|
|
||||||
func ListTheHadithsInAbook() {
|
|
||||||
sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := sunnahService.Hadiths(&sunnah.HadithsRequest{
|
|
||||||
Book: 1,
|
|
||||||
Collection: "bukhari",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Collections
|
## Collections
|
||||||
|
|
||||||
Get a list of available collections. A collection is
|
Get a list of available collections. A collection is
|
||||||
@@ -123,3 +92,34 @@ Collection: "bukhari",
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
## Hadiths
|
||||||
|
|
||||||
|
Hadiths returns a list of hadiths and their corresponding text for a
|
||||||
|
given book within a collection.
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/sunnah/api#Hadiths](https://m3o.com/sunnah/api#Hadiths)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/sunnah"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Hadiths returns a list of hadiths and their corresponding text for a
|
||||||
|
// given book within a collection.
|
||||||
|
func ListTheHadithsInAbook() {
|
||||||
|
sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := sunnahService.Hadiths(&sunnah.HadithsRequest{
|
||||||
|
Book: 1,
|
||||||
|
Collection: "bukhari",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -4,6 +4,33 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Time/api](http
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
|
## Now
|
||||||
|
|
||||||
|
Get the current time
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/time/api#Now](https://m3o.com/time/api#Now)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get the current time
|
||||||
|
func ReturnsCurrentTimeOptionallyWithLocation() {
|
||||||
|
timeService := time.NewTimeService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := timeService.Now(&time.NowRequest{
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
## Zone
|
## Zone
|
||||||
|
|
||||||
Get the timezone info for a specific location
|
Get the timezone info for a specific location
|
||||||
@@ -32,30 +59,3 @@ func GetTheTimezoneInfoForAspecificLocation() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Now
|
|
||||||
|
|
||||||
Get the current time
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/time/api#Now](https://m3o.com/time/api#Now)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Get the current time
|
|
||||||
func ReturnsCurrentTimeOptionallyWithLocation() {
|
|
||||||
timeService := time.NewTimeService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := timeService.Now(&time.NowRequest{
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -4,61 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Twitter/api](h
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
## Trends
|
|
||||||
|
|
||||||
Get the current global trending topics
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/twitter/api#Trends](https://m3o.com/twitter/api#Trends)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/twitter"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Get the current global trending topics
|
|
||||||
func GetTheCurrentGlobalTrendingTopics() {
|
|
||||||
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := twitterService.Trends(&twitter.TrendsRequest{
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## User
|
|
||||||
|
|
||||||
Get a user's twitter profile
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/twitter/api#User](https://m3o.com/twitter/api#User)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/twitter"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Get a user's twitter profile
|
|
||||||
func GetAusersTwitterProfile() {
|
|
||||||
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := twitterService.User(&twitter.UserRequest{
|
|
||||||
Username: "crufter",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Timeline
|
## Timeline
|
||||||
|
|
||||||
Get the timeline for a given user
|
Get the timeline for a given user
|
||||||
@@ -116,3 +61,58 @@ func SearchForTweets() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
## Trends
|
||||||
|
|
||||||
|
Get the current global trending topics
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/twitter/api#Trends](https://m3o.com/twitter/api#Trends)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/twitter"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get the current global trending topics
|
||||||
|
func GetTheCurrentGlobalTrendingTopics() {
|
||||||
|
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := twitterService.Trends(&twitter.TrendsRequest{
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## User
|
||||||
|
|
||||||
|
Get a user's twitter profile
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/twitter/api#User](https://m3o.com/twitter/api#User)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/twitter"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get a user's twitter profile
|
||||||
|
func GetAusersTwitterProfile() {
|
||||||
|
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := twitterService.User(&twitter.UserRequest{
|
||||||
|
Username: "crufter",
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/User/api](http
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
## Create
|
## Login
|
||||||
|
|
||||||
Create a new user account. The email address and username for the account must be unique.
|
Login using username or email. The response will return a new session for successful login,
|
||||||
|
401 in the case of login failure and 500 for any other error
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#Create](https://m3o.com/user/api#Create)
|
[https://m3o.com/user/api#Login](https://m3o.com/user/api#Login)
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package example
|
package example
|
||||||
@@ -21,26 +22,25 @@ import(
|
|||||||
"go.m3o.com/user"
|
"go.m3o.com/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create a new user account. The email address and username for the account must be unique.
|
// Login using username or email. The response will return a new session for successful login,
|
||||||
func CreateAnAccount() {
|
// 401 in the case of login failure and 500 for any other error
|
||||||
|
func LogAuserIn() {
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := userService.Create(&user.CreateRequest{
|
rsp, err := userService.Login(&user.LoginRequest{
|
||||||
Email: "joe@example.com",
|
Email: "joe@example.com",
|
||||||
Id: "user-1",
|
|
||||||
Password: "Password1",
|
Password: "Password1",
|
||||||
Username: "joe",
|
|
||||||
|
|
||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Logout
|
## List
|
||||||
|
|
||||||
Logout a user account
|
List all users. Returns a paged list of results
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#Logout](https://m3o.com/user/api#Logout)
|
[https://m3o.com/user/api#List](https://m3o.com/user/api#List)
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package example
|
package example
|
||||||
@@ -52,11 +52,76 @@ import(
|
|||||||
"go.m3o.com/user"
|
"go.m3o.com/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Logout a user account
|
// List all users. Returns a paged list of results
|
||||||
func LogAuserOut() {
|
func ListAllUsers() {
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := userService.Logout(&user.LogoutRequest{
|
rsp, err := userService.List(&user.ListRequest{
|
||||||
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
|
Limit: 100,
|
||||||
|
Offset: 0,
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## SendMagicLink
|
||||||
|
|
||||||
|
Login using email only - Passwordless
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/user/api#SendMagicLink](https://m3o.com/user/api#SendMagicLink)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/user"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Login using email only - Passwordless
|
||||||
|
func SendAmagicLink() {
|
||||||
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := userService.SendMagicLink(&user.SendMagicLinkRequest{
|
||||||
|
Address: "www.example.com",
|
||||||
|
Email: "joe@example.com",
|
||||||
|
Endpoint: "verifytoken",
|
||||||
|
FromName: "Awesome Dot Com",
|
||||||
|
Subject: "MagicLink to access your account",
|
||||||
|
TextContent: `Hi there,
|
||||||
|
|
||||||
|
Click here to access your account $micro_verification_link`,
|
||||||
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## VerifyEmail
|
||||||
|
|
||||||
|
Verify the email address of an account from a token sent in an email to the user.
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/user/api#VerifyEmail](https://m3o.com/user/api#VerifyEmail)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/user"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Verify the email address of an account from a token sent in an email to the user.
|
||||||
|
func VerifyEmail() {
|
||||||
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{
|
||||||
|
Email: "joe@example.com",
|
||||||
|
Token: "012345",
|
||||||
|
|
||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
@@ -110,12 +175,12 @@ Please verify your email by clicking this link: $micro_verification_link`,
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## ReadSession
|
## ResetPassword
|
||||||
|
|
||||||
Read a session by the session id. In the event it has expired or is not found and error is returned.
|
Reset password with the code sent by the "SendPasswordResetEmail" endoint.
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#ReadSession](https://m3o.com/user/api#ReadSession)
|
[https://m3o.com/user/api#ResetPassword](https://m3o.com/user/api#ResetPassword)
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package example
|
package example
|
||||||
@@ -127,40 +192,14 @@ import(
|
|||||||
"go.m3o.com/user"
|
"go.m3o.com/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Read a session by the session id. In the event it has expired or is not found and error is returned.
|
// Reset password with the code sent by the "SendPasswordResetEmail" endoint.
|
||||||
func ReadAsessionByTheSessionId() {
|
func ResetPassword() {
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := userService.ReadSession(&user.ReadSessionRequest{
|
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{
|
||||||
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
|
Code: "012345",
|
||||||
|
ConfirmPassword: "NewPassword1",
|
||||||
})
|
Email: "joe@example.com",
|
||||||
fmt.Println(rsp, err)
|
NewPassword: "NewPassword1",
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## List
|
|
||||||
|
|
||||||
List all users. Returns a paged list of results
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#List](https://m3o.com/user/api#List)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/user"
|
|
||||||
)
|
|
||||||
|
|
||||||
// List all users. Returns a paged list of results
|
|
||||||
func ListAllUsers() {
|
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := userService.List(&user.ListRequest{
|
|
||||||
Limit: 100,
|
|
||||||
Offset: 0,
|
|
||||||
|
|
||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
@@ -199,35 +238,6 @@ func VerifyAtoken() {
|
|||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## Update
|
|
||||||
|
|
||||||
Update the account username or email
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#Update](https://m3o.com/user/api#Update)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/user"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Update the account username or email
|
|
||||||
func UpdateAnAccount() {
|
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := userService.Update(&user.UpdateRequest{
|
|
||||||
Email: "joe+2@example.com",
|
|
||||||
Id: "user-1",
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## UpdatePassword
|
## UpdatePassword
|
||||||
@@ -342,41 +352,6 @@ func ReadAccountByEmail() {
|
|||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
## SendMagicLink
|
|
||||||
|
|
||||||
Login using email only - Passwordless
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#SendMagicLink](https://m3o.com/user/api#SendMagicLink)
|
|
||||||
|
|
||||||
```go
|
|
||||||
package example
|
|
||||||
|
|
||||||
import(
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.m3o.com/user"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Login using email only - Passwordless
|
|
||||||
func SendAmagicLink() {
|
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
|
||||||
rsp, err := userService.SendMagicLink(&user.SendMagicLinkRequest{
|
|
||||||
Address: "www.example.com",
|
|
||||||
Email: "joe@example.com",
|
|
||||||
Endpoint: "verifytoken",
|
|
||||||
FromName: "Awesome Dot Com",
|
|
||||||
Subject: "MagicLink to access your account",
|
|
||||||
TextContent: `Hi there,
|
|
||||||
|
|
||||||
Click here to access your account $micro_verification_link`,
|
|
||||||
|
|
||||||
})
|
|
||||||
fmt.Println(rsp, err)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## SendPasswordResetEmail
|
## SendPasswordResetEmail
|
||||||
@@ -413,12 +388,12 @@ TextContent: `Hi there,
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## ResetPassword
|
## ReadSession
|
||||||
|
|
||||||
Reset password with the code sent by the "SendPasswordResetEmail" endoint.
|
Read a session by the session id. In the event it has expired or is not found and error is returned.
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#ResetPassword](https://m3o.com/user/api#ResetPassword)
|
[https://m3o.com/user/api#ReadSession](https://m3o.com/user/api#ReadSession)
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package example
|
package example
|
||||||
@@ -430,26 +405,23 @@ import(
|
|||||||
"go.m3o.com/user"
|
"go.m3o.com/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reset password with the code sent by the "SendPasswordResetEmail" endoint.
|
// Read a session by the session id. In the event it has expired or is not found and error is returned.
|
||||||
func ResetPassword() {
|
func ReadAsessionByTheSessionId() {
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{
|
rsp, err := userService.ReadSession(&user.ReadSessionRequest{
|
||||||
Code: "012345",
|
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
|
||||||
ConfirmPassword: "NewPassword1",
|
|
||||||
Email: "joe@example.com",
|
|
||||||
NewPassword: "NewPassword1",
|
|
||||||
|
|
||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## VerifyEmail
|
## Update
|
||||||
|
|
||||||
Verify the email address of an account from a token sent in an email to the user.
|
Update the account username or email
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#VerifyEmail](https://m3o.com/user/api#VerifyEmail)
|
[https://m3o.com/user/api#Update](https://m3o.com/user/api#Update)
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package example
|
package example
|
||||||
@@ -461,12 +433,12 @@ import(
|
|||||||
"go.m3o.com/user"
|
"go.m3o.com/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Verify the email address of an account from a token sent in an email to the user.
|
// Update the account username or email
|
||||||
func VerifyEmail() {
|
func UpdateAnAccount() {
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{
|
rsp, err := userService.Update(&user.UpdateRequest{
|
||||||
Email: "joe@example.com",
|
Email: "joe+2@example.com",
|
||||||
Token: "012345",
|
Id: "user-1",
|
||||||
|
|
||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
@@ -501,13 +473,12 @@ func DeleteUserAccount() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
## Login
|
## Logout
|
||||||
|
|
||||||
Login using username or email. The response will return a new session for successful login,
|
Logout a user account
|
||||||
401 in the case of login failure and 500 for any other error
|
|
||||||
|
|
||||||
|
|
||||||
[https://m3o.com/user/api#Login](https://m3o.com/user/api#Login)
|
[https://m3o.com/user/api#Logout](https://m3o.com/user/api#Logout)
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package example
|
package example
|
||||||
@@ -519,13 +490,42 @@ import(
|
|||||||
"go.m3o.com/user"
|
"go.m3o.com/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Login using username or email. The response will return a new session for successful login,
|
// Logout a user account
|
||||||
// 401 in the case of login failure and 500 for any other error
|
func LogAuserOut() {
|
||||||
func LogAuserIn() {
|
|
||||||
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
rsp, err := userService.Login(&user.LoginRequest{
|
rsp, err := userService.Logout(&user.LogoutRequest{
|
||||||
Email: "joe@example.com",
|
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
|
||||||
Password: "Password1",
|
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Create
|
||||||
|
|
||||||
|
Create a new user account. The email address and username for the account must be unique.
|
||||||
|
|
||||||
|
|
||||||
|
[https://m3o.com/user/api#Create](https://m3o.com/user/api#Create)
|
||||||
|
|
||||||
|
```go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import(
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.m3o.com/user"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Create a new user account. The email address and username for the account must be unique.
|
||||||
|
func CreateAnAccount() {
|
||||||
|
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
|
||||||
|
rsp, err := userService.Create(&user.CreateRequest{
|
||||||
|
Email: "joe@example.com",
|
||||||
|
Id: "user-1",
|
||||||
|
Password: "Password1",
|
||||||
|
Username: "joe",
|
||||||
|
|
||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewFileService(token string) *FileService {
|
||||||
return &FileService{
|
return &FileService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Forex interface {
|
||||||
|
History(*HistoryRequest) (*HistoryResponse, error)
|
||||||
|
Price(*PriceRequest) (*PriceResponse, error)
|
||||||
|
Quote(*QuoteRequest) (*QuoteResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewForexService(token string) *ForexService {
|
func NewForexService(token string) *ForexService {
|
||||||
return &ForexService{
|
return &ForexService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,18 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewFunctionService(token string) *FunctionService {
|
||||||
return &FunctionService{
|
return &FunctionService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Geocoding interface {
|
||||||
|
Lookup(*LookupRequest) (*LookupResponse, error)
|
||||||
|
Reverse(*ReverseRequest) (*ReverseResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewGeocodingService(token string) *GeocodingService {
|
func NewGeocodingService(token string) *GeocodingService {
|
||||||
return &GeocodingService{
|
return &GeocodingService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Gifs interface {
|
||||||
|
Search(*SearchRequest) (*SearchResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewGifsService(token string) *GifsService {
|
func NewGifsService(token string) *GifsService {
|
||||||
return &GifsService{
|
return &GifsService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Google interface {
|
||||||
|
Search(*SearchRequest) (*SearchResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewGoogleService(token string) *GoogleService {
|
func NewGoogleService(token string) *GoogleService {
|
||||||
return &GoogleService{
|
return &GoogleService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Helloworld interface {
|
||||||
|
Call(*CallRequest) (*CallResponse, error)
|
||||||
|
Stream(*StreamRequest) (*StreamResponseStream, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewHelloworldService(token string) *HelloworldService {
|
func NewHelloworldService(token string) *HelloworldService {
|
||||||
return &HelloworldService{
|
return &HelloworldService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Holidays interface {
|
||||||
|
Countries(*CountriesRequest) (*CountriesResponse, error)
|
||||||
|
List(*ListRequest) (*ListResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewHolidaysService(token string) *HolidaysService {
|
func NewHolidaysService(token string) *HolidaysService {
|
||||||
return &HolidaysService{
|
return &HolidaysService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
5
id/id.go
5
id/id.go
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Id interface {
|
||||||
|
Generate(*GenerateRequest) (*GenerateResponse, error)
|
||||||
|
Types(*TypesRequest) (*TypesResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewIdService(token string) *IdService {
|
func NewIdService(token string) *IdService {
|
||||||
return &IdService{
|
return &IdService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewImageService(token string) *ImageService {
|
||||||
return &ImageService{
|
return &ImageService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
4
ip/ip.go
4
ip/ip.go
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Ip interface {
|
||||||
|
Lookup(*LookupRequest) (*LookupResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewIpService(token string) *IpService {
|
func NewIpService(token string) *IpService {
|
||||||
return &IpService{
|
return &IpService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Joke interface {
|
||||||
|
Random(*RandomRequest) (*RandomResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewJokeService(token string) *JokeService {
|
func NewJokeService(token string) *JokeService {
|
||||||
return &JokeService{
|
return &JokeService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Location interface {
|
||||||
|
Read(*ReadRequest) (*ReadResponse, error)
|
||||||
|
Save(*SaveRequest) (*SaveResponse, error)
|
||||||
|
Search(*SearchRequest) (*SearchResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewLocationService(token string) *LocationService {
|
func NewLocationService(token string) *LocationService {
|
||||||
return &LocationService{
|
return &LocationService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Movie interface {
|
||||||
|
Search(*SearchRequest) (*SearchResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewMovieService(token string) *MovieService {
|
func NewMovieService(token string) *MovieService {
|
||||||
return &MovieService{
|
return &MovieService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
5
mq/mq.go
5
mq/mq.go
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Mq interface {
|
||||||
|
Publish(*PublishRequest) (*PublishResponse, error)
|
||||||
|
Subscribe(*SubscribeRequest) (*SubscribeResponseStream, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewMqService(token string) *MqService {
|
func NewMqService(token string) *MqService {
|
||||||
return &MqService{
|
return &MqService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type News interface {
|
||||||
|
Headlines(*HeadlinesRequest) (*HeadlinesResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewNewsService(token string) *NewsService {
|
func NewNewsService(token string) *NewsService {
|
||||||
return &NewsService{
|
return &NewsService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Nft interface {
|
||||||
|
Assets(*AssetsRequest) (*AssetsResponse, error)
|
||||||
|
Collections(*CollectionsRequest) (*CollectionsResponse, error)
|
||||||
|
Create(*CreateRequest) (*CreateResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewNftService(token string) *NftService {
|
func NewNftService(token string) *NftService {
|
||||||
return &NftService{
|
return &NftService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,15 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewNotesService(token string) *NotesService {
|
||||||
return &NotesService{
|
return &NotesService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Otp interface {
|
||||||
|
Generate(*GenerateRequest) (*GenerateResponse, error)
|
||||||
|
Validate(*ValidateRequest) (*ValidateResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewOtpService(token string) *OtpService {
|
func NewOtpService(token string) *OtpService {
|
||||||
return &OtpService{
|
return &OtpService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Postcode interface {
|
||||||
|
Lookup(*LookupRequest) (*LookupResponse, error)
|
||||||
|
Random(*RandomRequest) (*RandomResponse, error)
|
||||||
|
Validate(*ValidateRequest) (*ValidateResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewPostcodeService(token string) *PostcodeService {
|
func NewPostcodeService(token string) *PostcodeService {
|
||||||
return &PostcodeService{
|
return &PostcodeService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Prayer interface {
|
||||||
|
Times(*TimesRequest) (*TimesResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewPrayerService(token string) *PrayerService {
|
func NewPrayerService(token string) *PrayerService {
|
||||||
return &PrayerService{
|
return &PrayerService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
4
qr/qr.go
4
qr/qr.go
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Qr interface {
|
||||||
|
Generate(*GenerateRequest) (*GenerateResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewQrService(token string) *QrService {
|
func NewQrService(token string) *QrService {
|
||||||
return &QrService{
|
return &QrService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewQuranService(token string) *QuranService {
|
||||||
return &QuranService{
|
return &QuranService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Routing interface {
|
||||||
|
Directions(*DirectionsRequest) (*DirectionsResponse, error)
|
||||||
|
Eta(*EtaRequest) (*EtaResponse, error)
|
||||||
|
Route(*RouteRequest) (*RouteResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewRoutingService(token string) *RoutingService {
|
func NewRoutingService(token string) *RoutingService {
|
||||||
return &RoutingService{
|
return &RoutingService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewRssService(token string) *RssService {
|
||||||
return &RssService{
|
return &RssService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Search interface {
|
||||||
|
Vote(*VoteRequest) (*VoteResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewSearchService(token string) *SearchService {
|
func NewSearchService(token string) *SearchService {
|
||||||
return &SearchService{
|
return &SearchService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Sentiment interface {
|
||||||
|
Analyze(*AnalyzeRequest) (*AnalyzeResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewSentimentService(token string) *SentimentService {
|
func NewSentimentService(token string) *SentimentService {
|
||||||
return &SentimentService{
|
return &SentimentService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Sms interface {
|
||||||
|
Send(*SendRequest) (*SendResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewSmsService(token string) *SmsService {
|
func NewSmsService(token string) *SmsService {
|
||||||
return &SmsService{
|
return &SmsService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,17 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewSpaceService(token string) *SpaceService {
|
||||||
return &SpaceService{
|
return &SpaceService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Spam interface {
|
||||||
|
Classify(*ClassifyRequest) (*ClassifyResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewSpamService(token string) *SpamService {
|
func NewSpamService(token string) *SpamService {
|
||||||
return &SpamService{
|
return &SpamService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewStockService(token string) *StockService {
|
||||||
return &StockService{
|
return &StockService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewStreamService(token string) *StreamService {
|
||||||
return &StreamService{
|
return &StreamService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewSunnahService(token string) *SunnahService {
|
||||||
return &SunnahService{
|
return &SunnahService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Thumbnail interface {
|
||||||
|
Screenshot(*ScreenshotRequest) (*ScreenshotResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewThumbnailService(token string) *ThumbnailService {
|
func NewThumbnailService(token string) *ThumbnailService {
|
||||||
return &ThumbnailService{
|
return &ThumbnailService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Time interface {
|
||||||
|
Now(*NowRequest) (*NowResponse, error)
|
||||||
|
Zone(*ZoneRequest) (*ZoneResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewTimeService(token string) *TimeService {
|
func NewTimeService(token string) *TimeService {
|
||||||
return &TimeService{
|
return &TimeService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Translate interface {
|
||||||
|
Text(*TextRequest) (*TextResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewTranslateService(token string) *TranslateService {
|
func NewTranslateService(token string) *TranslateService {
|
||||||
return &TranslateService{
|
return &TranslateService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewTwitterService(token string) *TwitterService {
|
||||||
return &TwitterService{
|
return &TwitterService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Url interface {
|
||||||
|
List(*ListRequest) (*ListResponse, error)
|
||||||
|
Proxy(*ProxyRequest) (*ProxyResponse, error)
|
||||||
|
Shorten(*ShortenRequest) (*ShortenResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewUrlService(token string) *UrlService {
|
func NewUrlService(token string) *UrlService {
|
||||||
return &UrlService{
|
return &UrlService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
18
user/user.go
18
user/user.go
@@ -4,6 +4,24 @@ import (
|
|||||||
"go.m3o.com/client"
|
"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 {
|
func NewUserService(token string) *UserService {
|
||||||
return &UserService{
|
return &UserService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Vehicle interface {
|
||||||
|
Lookup(*LookupRequest) (*LookupResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewVehicleService(token string) *VehicleService {
|
func NewVehicleService(token string) *VehicleService {
|
||||||
return &VehicleService{
|
return &VehicleService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Weather interface {
|
||||||
|
Forecast(*ForecastRequest) (*ForecastResponse, error)
|
||||||
|
Now(*NowRequest) (*NowResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewWeatherService(token string) *WeatherService {
|
func NewWeatherService(token string) *WeatherService {
|
||||||
return &WeatherService{
|
return &WeatherService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import (
|
|||||||
"go.m3o.com/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Youtube interface {
|
||||||
|
Embed(*EmbedRequest) (*EmbedResponse, error)
|
||||||
|
Search(*SearchRequest) (*SearchResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
func NewYoutubeService(token string) *YoutubeService {
|
func NewYoutubeService(token string) *YoutubeService {
|
||||||
return &YoutubeService{
|
return &YoutubeService{
|
||||||
client: client.NewClient(&client.Options{
|
client: client.NewClient(&client.Options{
|
||||||
|
|||||||
Reference in New Issue
Block a user