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:
@@ -1,7 +1,7 @@
|
||||
package address
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewAddressService(token string) *AddressService {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package answer
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewAnswerService(token string) *AnswerService {
|
||||
|
||||
2
cache/cache.go
vendored
2
cache/cache.go
vendored
@@ -1,7 +1,7 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewCacheService(token string) *CacheService {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package crypto
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewCryptoService(token string) *CryptoService {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package currency
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewCurrencyService(token string) *CurrencyService {
|
||||
|
||||
2
db/db.go
2
db/db.go
@@ -1,7 +1,7 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewDbService(token string) *DbService {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package email
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewEmailService(token string) *EmailService {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package emoji
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewEmojiService(token string) *EmojiService {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package evchargers
|
||||
|
||||
import (
|
||||
"github.com/m3o/m3o-go/client"
|
||||
"go.m3o.com/client"
|
||||
)
|
||||
|
||||
func NewEvchargersService(token string) *EvchargersService {
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/address"
|
||||
"go.m3o.com/address"
|
||||
)
|
||||
|
||||
// Lookup a list of UK addresses by postcode
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/address"
|
||||
"go.m3o.com/address"
|
||||
)
|
||||
|
||||
// Lookup a list of UK addresses by postcode
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/answer"
|
||||
"go.m3o.com/answer"
|
||||
)
|
||||
|
||||
// Ask a question and receive an instant answer
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/answer"
|
||||
"go.m3o.com/answer"
|
||||
)
|
||||
|
||||
// Ask a question and receive an instant answer
|
||||
|
||||
168
examples/cache/README.md
vendored
168
examples/cache/README.md
vendored
@@ -4,88 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Cache/api](htt
|
||||
|
||||
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"
|
||||
|
||||
"github.com/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
|
||||
|
||||
|
||||
[https://m3o.com/cache/api#Get](https://m3o.com/cache/api#Get)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Get an item from the cache by key
|
||||
func GetAvalue() {
|
||||
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := cacheService.Get(&cache.GetRequest{
|
||||
Key: "foo",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Delete
|
||||
|
||||
Delete a value from the cache
|
||||
|
||||
|
||||
[https://m3o.com/cache/api#Delete](https://m3o.com/cache/api#Delete)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Delete a value from the cache
|
||||
func DeleteAvalue() {
|
||||
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := cacheService.Delete(&cache.DeleteRequest{
|
||||
Key: "foo",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Increment
|
||||
|
||||
Increment a value (if it's a number)
|
||||
@@ -100,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
"go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Increment a value (if it's a number)
|
||||
@@ -128,7 +46,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
"go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Decrement a value (if it's a number)
|
||||
@@ -142,3 +60,85 @@ Value: 2,
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## 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
|
||||
|
||||
|
||||
[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
|
||||
func GetAvalue() {
|
||||
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := cacheService.Get(&cache.GetRequest{
|
||||
Key: "foo",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Delete
|
||||
|
||||
Delete a value from the cache
|
||||
|
||||
|
||||
[https://m3o.com/cache/api#Delete](https://m3o.com/cache/api#Delete)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Delete a value from the cache
|
||||
func DeleteAvalue() {
|
||||
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := cacheService.Delete(&cache.DeleteRequest{
|
||||
Key: "foo",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
2
examples/cache/decrement/decrementAValue.go
vendored
2
examples/cache/decrement/decrementAValue.go
vendored
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
"go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Decrement a value (if it's a number)
|
||||
|
||||
2
examples/cache/delete/deleteAValue.go
vendored
2
examples/cache/delete/deleteAValue.go
vendored
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
"go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Delete a value from the cache
|
||||
|
||||
2
examples/cache/get/getAValue.go
vendored
2
examples/cache/get/getAValue.go
vendored
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
"go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Get an item from the cache by key
|
||||
|
||||
2
examples/cache/increment/incrementAValue.go
vendored
2
examples/cache/increment/incrementAValue.go
vendored
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
"go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Increment a value (if it's a number)
|
||||
|
||||
2
examples/cache/set/setAValue.go
vendored
2
examples/cache/set/setAValue.go
vendored
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/cache"
|
||||
"go.m3o.com/cache"
|
||||
)
|
||||
|
||||
// Set an item in the cache. Overwrites any existing value already set.
|
||||
|
||||
@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Crypto/api](ht
|
||||
|
||||
Endpoints:
|
||||
|
||||
## News
|
||||
|
||||
Get news related to a currency
|
||||
|
||||
|
||||
[https://m3o.com/crypto/api#News](https://m3o.com/crypto/api#News)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Get news related to a currency
|
||||
func GetCryptocurrencyNews() {
|
||||
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := cryptoService.News(&crypto.NewsRequest{
|
||||
Symbol: "BTCUSD",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Price
|
||||
|
||||
Get the last price for a given crypto ticker
|
||||
@@ -45,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/crypto"
|
||||
"go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Get the last price for a given crypto ticker
|
||||
@@ -72,7 +45,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/crypto"
|
||||
"go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Get the last quote for a given crypto ticker
|
||||
@@ -99,7 +72,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/crypto"
|
||||
"go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Returns the history for the previous close
|
||||
@@ -112,3 +85,30 @@ func GetPreviousClose() {
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## News
|
||||
|
||||
Get news related to a currency
|
||||
|
||||
|
||||
[https://m3o.com/crypto/api#News](https://m3o.com/crypto/api#News)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Get news related to a currency
|
||||
func GetCryptocurrencyNews() {
|
||||
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := cryptoService.News(&crypto.NewsRequest{
|
||||
Symbol: "BTCUSD",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/crypto"
|
||||
"go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Returns the history for the previous close
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/crypto"
|
||||
"go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Get news related to a currency
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/crypto"
|
||||
"go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Get the last price for a given crypto ticker
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/crypto"
|
||||
"go.m3o.com/crypto"
|
||||
)
|
||||
|
||||
// Get the last quote for a given crypto ticker
|
||||
|
||||
@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Currency/api](
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Rates
|
||||
|
||||
Rates returns the currency rates for a given code e.g USD
|
||||
|
||||
|
||||
[https://m3o.com/currency/api#Rates](https://m3o.com/currency/api#Rates)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Rates returns the currency rates for a given code e.g USD
|
||||
func GetRatesForUsd() {
|
||||
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := currencyService.Rates(¤cy.RatesRequest{
|
||||
Code: "USD",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Convert
|
||||
|
||||
Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||
@@ -45,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||
@@ -73,7 +46,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||
@@ -102,7 +75,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Returns the historic rates for a currency on a given date
|
||||
@@ -130,7 +103,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Codes returns the supported currency codes for the API
|
||||
@@ -142,3 +115,30 @@ func GetSupportedCodes() {
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Rates
|
||||
|
||||
Rates returns the currency rates for a given code e.g USD
|
||||
|
||||
|
||||
[https://m3o.com/currency/api#Rates](https://m3o.com/currency/api#Rates)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Rates returns the currency rates for a given code e.g USD
|
||||
func GetRatesForUsd() {
|
||||
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := currencyService.Rates(¤cy.RatesRequest{
|
||||
Code: "USD",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Codes returns the supported currency codes for the API
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Returns the historic rates for a currency on a given date
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/currency"
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Rates returns the currency rates for a given code e.g USD
|
||||
|
||||
@@ -4,60 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Db/api](https:
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Truncate
|
||||
|
||||
Truncate the records in a table
|
||||
|
||||
|
||||
[https://m3o.com/db/api#Truncate](https://m3o.com/db/api#Truncate)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Truncate the records in a table
|
||||
func TruncateTable() {
|
||||
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := dbService.Truncate(&db.TruncateRequest{
|
||||
Table: "users",
|
||||
|
||||
})
|
||||
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"
|
||||
|
||||
"github.com/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: "users",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Create
|
||||
|
||||
Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
||||
@@ -72,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
||||
@@ -80,10 +26,10 @@ func CreateArecord() {
|
||||
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := dbService.Create(&db.CreateRequest{
|
||||
Record: map[string]interface{}{
|
||||
"isActive": true,
|
||||
"id": "1",
|
||||
"name": "Jane",
|
||||
"age": 42,
|
||||
"isActive": true,
|
||||
},
|
||||
Table: "users",
|
||||
|
||||
@@ -105,7 +51,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Update a record in the database. Include an "id" in the record to update.
|
||||
@@ -136,7 +82,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Read data from a table. Lookup can be by ID or via querying any field in the record.
|
||||
@@ -164,7 +110,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Delete a record in the database by id.
|
||||
@@ -178,3 +124,57 @@ Table: "users",
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Truncate
|
||||
|
||||
Truncate the records in a table
|
||||
|
||||
|
||||
[https://m3o.com/db/api#Truncate](https://m3o.com/db/api#Truncate)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Truncate the records in a table
|
||||
func TruncateTable() {
|
||||
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := dbService.Truncate(&db.TruncateRequest{
|
||||
Table: "users",
|
||||
|
||||
})
|
||||
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: "users",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Count records in a table
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
||||
@@ -12,10 +12,10 @@ 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,
|
||||
"id": "1",
|
||||
},
|
||||
Table: "users",
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Delete a record in the database by id.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Read data from a table. Lookup can be by ID or via querying any field in the record.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Truncate the records in a table
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/db"
|
||||
"go.m3o.com/db"
|
||||
)
|
||||
|
||||
// Update a record in the database. Include an "id" in the record to update.
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/email"
|
||||
"go.m3o.com/email"
|
||||
)
|
||||
|
||||
// Send an email by passing in from, to, subject, and a text or html body
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/email"
|
||||
"go.m3o.com/email"
|
||||
)
|
||||
|
||||
// Send an email by passing in from, to, subject, and a text or html body
|
||||
|
||||
@@ -4,6 +4,61 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Emoji/api](htt
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Flag
|
||||
|
||||
Get the flag for a country. Requires country code e.g GB for great britain
|
||||
|
||||
|
||||
[https://m3o.com/emoji/api#Flag](https://m3o.com/emoji/api#Flag)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Get the flag for a country. Requires country code e.g GB for great britain
|
||||
func GetFlagByCountryCode() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := emojiService.Flag(&emoji.FlagRequest{
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Print
|
||||
|
||||
Print text and renders the emojis with aliases e.g
|
||||
let's grab a :beer: becomes let's grab a 🍺
|
||||
|
||||
|
||||
[https://m3o.com/emoji/api#Print](https://m3o.com/emoji/api#Print)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Print text and renders the emojis with aliases e.g
|
||||
// let's grab a :beer: becomes let's grab a 🍺
|
||||
func PrintTextIncludingEmoji() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := emojiService.Print(&emoji.PrintRequest{
|
||||
Text: "let's grab a :beer:",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Send
|
||||
|
||||
Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
|
||||
@@ -18,7 +73,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/emoji"
|
||||
"go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
|
||||
@@ -47,7 +102,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/emoji"
|
||||
"go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Find an emoji by its alias e.g :beer:
|
||||
@@ -60,58 +115,3 @@ func FindEmoji() {
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Flag
|
||||
|
||||
Get the flag for a country. Requires country code e.g GB for great britain
|
||||
|
||||
|
||||
[https://m3o.com/emoji/api#Flag](https://m3o.com/emoji/api#Flag)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Get the flag for a country. Requires country code e.g GB for great britain
|
||||
func GetFlagByCountryCode() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := emojiService.Flag(&emoji.FlagRequest{
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Print
|
||||
|
||||
Print text and renders the emojis with aliases e.g
|
||||
let's grab a :beer: becomes let's grab a 🍺
|
||||
|
||||
|
||||
[https://m3o.com/emoji/api#Print](https://m3o.com/emoji/api#Print)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Print text and renders the emojis with aliases e.g
|
||||
// let's grab a :beer: becomes let's grab a 🍺
|
||||
func PrintTextIncludingEmoji() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := emojiService.Print(&emoji.PrintRequest{
|
||||
Text: "let's grab a :beer:",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/emoji"
|
||||
"go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Find an emoji by its alias e.g :beer:
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/emoji"
|
||||
"go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Get the flag for a country. Requires country code e.g GB for great britain
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/emoji"
|
||||
"go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Print text and renders the emojis with aliases e.g
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/emoji"
|
||||
"go.m3o.com/emoji"
|
||||
)
|
||||
|
||||
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
|
||||
|
||||
@@ -4,6 +4,32 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Evchargers/api
|
||||
|
||||
Endpoints:
|
||||
|
||||
## ReferenceData
|
||||
|
||||
Retrieve reference data as used by this API and in conjunction with the Search endpoint
|
||||
|
||||
|
||||
[https://m3o.com/evchargers/api#ReferenceData](https://m3o.com/evchargers/api#ReferenceData)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Retrieve reference data as used by this API and in conjunction with the Search endpoint
|
||||
func GetReferenceData() {
|
||||
evchargersService := evchargers.NewEvchargersService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := evchargersService.ReferenceData(&evchargers.ReferenceDataRequest{
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Search
|
||||
|
||||
Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||
@@ -18,7 +44,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/evchargers"
|
||||
"go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||
@@ -49,7 +75,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/evchargers"
|
||||
"go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||
@@ -77,7 +103,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/evchargers"
|
||||
"go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||
@@ -95,29 +121,3 @@ Location: &evchargers.Coordinates{
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## ReferenceData
|
||||
|
||||
Retrieve reference data as used by this API and in conjunction with the Search endpoint
|
||||
|
||||
|
||||
[https://m3o.com/evchargers/api#ReferenceData](https://m3o.com/evchargers/api#ReferenceData)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Retrieve reference data as used by this API and in conjunction with the Search endpoint
|
||||
func GetReferenceData() {
|
||||
evchargersService := evchargers.NewEvchargersService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := evchargersService.ReferenceData(&evchargers.ReferenceDataRequest{
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/evchargers"
|
||||
"go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Retrieve reference data as used by this API and in conjunction with the Search endpoint
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/evchargers"
|
||||
"go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/evchargers"
|
||||
"go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/evchargers"
|
||||
"go.m3o.com/evchargers"
|
||||
)
|
||||
|
||||
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||
|
||||
@@ -4,6 +4,37 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/File/api](http
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Save
|
||||
|
||||
Save a file
|
||||
|
||||
|
||||
[https://m3o.com/file/api#Save](https://m3o.com/file/api#Save)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/file"
|
||||
)
|
||||
|
||||
// Save a file
|
||||
func SaveFile() {
|
||||
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := fileService.Save(&file.SaveRequest{
|
||||
File: &file.Record{
|
||||
Content: "file content example",
|
||||
Path: "/document/text-files/file.txt",
|
||||
Project: "examples",
|
||||
},
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## List
|
||||
|
||||
List files by their project and optionally a path.
|
||||
@@ -18,7 +49,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/file"
|
||||
"go.m3o.com/file"
|
||||
)
|
||||
|
||||
// List files by their project and optionally a path.
|
||||
@@ -45,7 +76,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/file"
|
||||
"go.m3o.com/file"
|
||||
)
|
||||
|
||||
// Delete a file by project name/path
|
||||
@@ -73,7 +104,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/file"
|
||||
"go.m3o.com/file"
|
||||
)
|
||||
|
||||
// Read a file by path
|
||||
@@ -87,34 +118,3 @@ Project: "examples",
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Save
|
||||
|
||||
Save a file
|
||||
|
||||
|
||||
[https://m3o.com/file/api#Save](https://m3o.com/file/api#Save)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/file"
|
||||
)
|
||||
|
||||
// Save a file
|
||||
func SaveFile() {
|
||||
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := fileService.Save(&file.SaveRequest{
|
||||
File: &file.Record{
|
||||
Content: "file content example",
|
||||
Path: "/document/text-files/file.txt",
|
||||
Project: "examples",
|
||||
},
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/file"
|
||||
"go.m3o.com/file"
|
||||
)
|
||||
|
||||
// Delete a file by project name/path
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/file"
|
||||
"go.m3o.com/file"
|
||||
)
|
||||
|
||||
// List files by their project and optionally a path.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/file"
|
||||
"go.m3o.com/file"
|
||||
)
|
||||
|
||||
// Read a file by path
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/file"
|
||||
"go.m3o.com/file"
|
||||
)
|
||||
|
||||
// Save a file
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/forex"
|
||||
"go.m3o.com/forex"
|
||||
)
|
||||
|
||||
// Get the latest price for a given forex ticker
|
||||
@@ -45,7 +45,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/forex"
|
||||
"go.m3o.com/forex"
|
||||
)
|
||||
|
||||
// Get the latest quote for the forex
|
||||
@@ -72,7 +72,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/forex"
|
||||
"go.m3o.com/forex"
|
||||
)
|
||||
|
||||
// Returns the data for the previous close
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/forex"
|
||||
"go.m3o.com/forex"
|
||||
)
|
||||
|
||||
// Returns the data for the previous close
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/forex"
|
||||
"go.m3o.com/forex"
|
||||
)
|
||||
|
||||
// Get the latest price for a given forex ticker
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/forex"
|
||||
"go.m3o.com/forex"
|
||||
)
|
||||
|
||||
// Get the latest quote for the forex
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// Deploy a group of functions
|
||||
@@ -49,7 +49,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// Call a function by name
|
||||
@@ -78,7 +78,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// List all the deployed functions
|
||||
@@ -104,7 +104,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// Delete a function by name
|
||||
@@ -132,7 +132,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// Get the info for a deployed function
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// Call a function by name
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// Delete a function by name
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// Deploy a group of functions
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// Get the info for a deployed function
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/function"
|
||||
"go.m3o.com/function"
|
||||
)
|
||||
|
||||
// List all the deployed functions
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/geocoding"
|
||||
"go.m3o.com/geocoding"
|
||||
)
|
||||
|
||||
// Lookup returns a geocoded address including normalized address and gps coordinates. All fields are optional, provide more to get more accurate results
|
||||
@@ -48,7 +48,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/geocoding"
|
||||
"go.m3o.com/geocoding"
|
||||
)
|
||||
|
||||
// Reverse lookup an address from gps coordinates
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/geocoding"
|
||||
"go.m3o.com/geocoding"
|
||||
)
|
||||
|
||||
// Lookup returns a geocoded address including normalized address and gps coordinates. All fields are optional, provide more to get more accurate results
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/geocoding"
|
||||
"go.m3o.com/geocoding"
|
||||
)
|
||||
|
||||
// Reverse lookup an address from gps coordinates
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/gifs"
|
||||
"go.m3o.com/gifs"
|
||||
)
|
||||
|
||||
// Search for a GIF
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/gifs"
|
||||
"go.m3o.com/gifs"
|
||||
)
|
||||
|
||||
// Search for a GIF
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/google"
|
||||
"go.m3o.com/google"
|
||||
)
|
||||
|
||||
// Search for videos on Google
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/google"
|
||||
"go.m3o.com/google"
|
||||
)
|
||||
|
||||
// Search for videos on Google
|
||||
|
||||
@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Helloworld/api
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Call
|
||||
|
||||
Call returns a personalised "Hello $name" response
|
||||
|
||||
|
||||
[https://m3o.com/helloworld/api#Call](https://m3o.com/helloworld/api#Call)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/helloworld"
|
||||
)
|
||||
|
||||
// Call returns a personalised "Hello $name" response
|
||||
func CallTheHelloworldService() {
|
||||
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := helloworldService.Call(&helloworld.CallRequest{
|
||||
Name: "John",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Stream
|
||||
|
||||
Stream returns a stream of "Hello $name" responses
|
||||
@@ -45,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/helloworld"
|
||||
"go.m3o.com/helloworld"
|
||||
)
|
||||
|
||||
// Stream returns a stream of "Hello $name" responses
|
||||
@@ -58,3 +31,30 @@ func StreamsAreCurrentlyTemporarilyNotSupportedInClients() {
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Call
|
||||
|
||||
Call returns a personalised "Hello $name" response
|
||||
|
||||
|
||||
[https://m3o.com/helloworld/api#Call](https://m3o.com/helloworld/api#Call)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/helloworld"
|
||||
)
|
||||
|
||||
// Call returns a personalised "Hello $name" response
|
||||
func CallTheHelloworldService() {
|
||||
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := helloworldService.Call(&helloworld.CallRequest{
|
||||
Name: "John",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/helloworld"
|
||||
"go.m3o.com/helloworld"
|
||||
)
|
||||
|
||||
// Call returns a personalised "Hello $name" response
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/helloworld"
|
||||
"go.m3o.com/helloworld"
|
||||
)
|
||||
|
||||
// Stream returns a stream of "Hello $name" responses
|
||||
|
||||
@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Holidays/api](
|
||||
|
||||
Endpoints:
|
||||
|
||||
## List
|
||||
|
||||
List the holiday dates for a given country and year
|
||||
|
||||
|
||||
[https://m3o.com/holidays/api#List](https://m3o.com/holidays/api#List)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// List the holiday dates for a given country and year
|
||||
func GetHolidays() {
|
||||
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := holidaysService.List(&holidays.ListRequest{
|
||||
Year: 2022,
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Countries
|
||||
|
||||
Get the list of countries that are supported by this API
|
||||
@@ -45,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/holidays"
|
||||
"go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// Get the list of countries that are supported by this API
|
||||
@@ -57,3 +30,30 @@ func ListCountries() {
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## List
|
||||
|
||||
List the holiday dates for a given country and year
|
||||
|
||||
|
||||
[https://m3o.com/holidays/api#List](https://m3o.com/holidays/api#List)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// List the holiday dates for a given country and year
|
||||
func GetHolidays() {
|
||||
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := holidaysService.List(&holidays.ListRequest{
|
||||
Year: 2022,
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/holidays"
|
||||
"go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// Get the list of countries that are supported by this API
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/holidays"
|
||||
"go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// List the holiday dates for a given country and year
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// Generate a unique ID. Defaults to uuid.
|
||||
@@ -45,7 +45,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// Generate a unique ID. Defaults to uuid.
|
||||
@@ -72,7 +72,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// Generate a unique ID. Defaults to uuid.
|
||||
@@ -99,7 +99,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// Generate a unique ID. Defaults to uuid.
|
||||
@@ -126,7 +126,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// List the types of IDs available. No query params needed.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// Generate a unique ID. Defaults to uuid.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// Generate a unique ID. Defaults to uuid.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// Generate a unique ID. Defaults to uuid.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// Generate a unique ID. Defaults to uuid.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/id"
|
||||
"go.m3o.com/id"
|
||||
)
|
||||
|
||||
// List the types of IDs available. No query params needed.
|
||||
|
||||
@@ -20,7 +20,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters.
|
||||
@@ -54,7 +54,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters.
|
||||
@@ -87,7 +87,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters.
|
||||
@@ -123,7 +123,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Convert an image from one format (jpeg, png etc.) to an other either on the fly (from base64 to base64),
|
||||
@@ -153,7 +153,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||
@@ -183,7 +183,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Convert an image from one format (jpeg, png etc.) to an other either on the fly (from base64 to base64),
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/image"
|
||||
"go.m3o.com/image"
|
||||
)
|
||||
|
||||
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/ip"
|
||||
"go.m3o.com/ip"
|
||||
)
|
||||
|
||||
// Lookup the geolocation information for an IP address
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/ip"
|
||||
"go.m3o.com/ip"
|
||||
)
|
||||
|
||||
// Lookup the geolocation information for an IP address
|
||||
|
||||
@@ -18,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/location"
|
||||
"go.m3o.com/location"
|
||||
)
|
||||
|
||||
// Save an entity's current position
|
||||
@@ -53,7 +53,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/location"
|
||||
"go.m3o.com/location"
|
||||
)
|
||||
|
||||
// Read an entity by its ID
|
||||
@@ -80,7 +80,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/location"
|
||||
"go.m3o.com/location"
|
||||
)
|
||||
|
||||
// Search for entities in a given radius
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/location"
|
||||
"go.m3o.com/location"
|
||||
)
|
||||
|
||||
// Read an entity by its ID
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/location"
|
||||
"go.m3o.com/location"
|
||||
)
|
||||
|
||||
// Save an entity's current position
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/location"
|
||||
"go.m3o.com/location"
|
||||
)
|
||||
|
||||
// Search for entities in a given radius
|
||||
|
||||
@@ -4,34 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Notes/api](htt
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Create
|
||||
|
||||
Create a new note
|
||||
|
||||
|
||||
[https://m3o.com/notes/api#Create](https://m3o.com/notes/api#Create)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// Create a new note
|
||||
func CreateAnote() {
|
||||
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := notesService.Create(¬es.CreateRequest{
|
||||
Text: "This is my note",
|
||||
Title: "New Note",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Read
|
||||
|
||||
Read a note
|
||||
@@ -46,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/notes"
|
||||
"go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// Read a note
|
||||
@@ -73,7 +45,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/notes"
|
||||
"go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// List all the notes
|
||||
@@ -99,7 +71,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/notes"
|
||||
"go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// Update a note
|
||||
@@ -130,7 +102,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/notes"
|
||||
"go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// Delete a note
|
||||
@@ -143,3 +115,31 @@ func DeleteAnote() {
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Create
|
||||
|
||||
Create a new note
|
||||
|
||||
|
||||
[https://m3o.com/notes/api#Create](https://m3o.com/notes/api#Create)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// Create a new note
|
||||
func CreateAnote() {
|
||||
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := notesService.Create(¬es.CreateRequest{
|
||||
Text: "This is my note",
|
||||
Title: "New Note",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/notes"
|
||||
"go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// Create a new note
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/notes"
|
||||
"go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// Delete a note
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/notes"
|
||||
"go.m3o.com/notes"
|
||||
)
|
||||
|
||||
// List all the notes
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user