mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-23 15:11:36 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package address
|
package address
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewAddressService(token string) *AddressService {
|
func NewAddressService(token string) *AddressService {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package answer
|
package answer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewAnswerService(token string) *AnswerService {
|
func NewAnswerService(token string) *AnswerService {
|
||||||
|
|||||||
2
cache/cache.go
vendored
2
cache/cache.go
vendored
@@ -1,7 +1,7 @@
|
|||||||
package cache
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCacheService(token string) *CacheService {
|
func NewCacheService(token string) *CacheService {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package crypto
|
package crypto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCryptoService(token string) *CryptoService {
|
func NewCryptoService(token string) *CryptoService {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package currency
|
package currency
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCurrencyService(token string) *CurrencyService {
|
func NewCurrencyService(token string) *CurrencyService {
|
||||||
|
|||||||
2
db/db.go
2
db/db.go
@@ -1,7 +1,7 @@
|
|||||||
package db
|
package db
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewDbService(token string) *DbService {
|
func NewDbService(token string) *DbService {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package email
|
package email
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewEmailService(token string) *EmailService {
|
func NewEmailService(token string) *EmailService {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package emoji
|
package emoji
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewEmojiService(token string) *EmojiService {
|
func NewEmojiService(token string) *EmojiService {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package evchargers
|
package evchargers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/m3o/m3o-go/client"
|
"go.m3o.com/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewEvchargersService(token string) *EvchargersService {
|
func NewEvchargersService(token string) *EvchargersService {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/address"
|
"go.m3o.com/address"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Lookup a list of UK addresses by postcode
|
// Lookup a list of UK addresses by postcode
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/address"
|
"go.m3o.com/address"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Lookup a list of UK addresses by postcode
|
// Lookup a list of UK addresses by postcode
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/answer"
|
"go.m3o.com/answer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Ask a question and receive an instant answer
|
// Ask a question and receive an instant answer
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/answer"
|
"go.m3o.com/answer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Ask a question and receive an instant 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:
|
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
|
||||||
|
|
||||||
Increment a value (if it's a number)
|
Increment a value (if it's a number)
|
||||||
@@ -100,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/cache"
|
"go.m3o.com/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Increment a value (if it's a number)
|
// Increment a value (if it's a number)
|
||||||
@@ -128,7 +46,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/cache"
|
"go.m3o.com/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Decrement a value (if it's a number)
|
// Decrement a value (if it's a number)
|
||||||
@@ -142,3 +60,85 @@ Value: 2,
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/cache"
|
"go.m3o.com/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Decrement a value (if it's a number)
|
// 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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/cache"
|
"go.m3o.com/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a value from the 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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/cache"
|
"go.m3o.com/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get an item from the cache by key
|
// 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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/cache"
|
"go.m3o.com/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Increment a value (if it's a number)
|
// 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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/cache"
|
"go.m3o.com/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Set an item in the cache. Overwrites any existing value already set.
|
// 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:
|
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
|
## Price
|
||||||
|
|
||||||
Get the last price for a given crypto ticker
|
Get the last price for a given crypto ticker
|
||||||
@@ -45,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/crypto"
|
"go.m3o.com/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the last price for a given crypto ticker
|
// Get the last price for a given crypto ticker
|
||||||
@@ -72,7 +45,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/crypto"
|
"go.m3o.com/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the last quote for a given crypto ticker
|
// Get the last quote for a given crypto ticker
|
||||||
@@ -99,7 +72,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/crypto"
|
"go.m3o.com/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Returns the history for the previous close
|
// Returns the history for the previous close
|
||||||
@@ -112,3 +85,30 @@ func GetPreviousClose() {
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/crypto"
|
"go.m3o.com/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Returns the history for the previous close
|
// Returns the history for the previous close
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/crypto"
|
"go.m3o.com/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get news related to a currency
|
// Get news related to a currency
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/crypto"
|
"go.m3o.com/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the last price for a given crypto ticker
|
// Get the last price for a given crypto ticker
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/crypto"
|
"go.m3o.com/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the last quote for a given crypto ticker
|
// 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:
|
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
|
||||||
|
|
||||||
Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||||
@@ -45,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||||
@@ -73,7 +46,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||||
@@ -102,7 +75,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Returns the historic rates for a currency on a given date
|
// Returns the historic rates for a currency on a given date
|
||||||
@@ -130,7 +103,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Codes returns the supported currency codes for the API
|
// Codes returns the supported currency codes for the API
|
||||||
@@ -142,3 +115,30 @@ func GetSupportedCodes() {
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Codes returns the supported currency codes for the API
|
// Codes returns the supported currency codes for the API
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Returns the historic rates for a currency on a given date
|
// Returns the historic rates for a currency on a given date
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/currency"
|
"go.m3o.com/currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Rates returns the currency rates for a given code e.g USD
|
// 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:
|
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
|
||||||
|
|
||||||
Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
||||||
@@ -72,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// 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"))
|
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{}{
|
||||||
"isActive": true,
|
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"name": "Jane",
|
"name": "Jane",
|
||||||
"age": 42,
|
"age": 42,
|
||||||
|
"isActive": true,
|
||||||
},
|
},
|
||||||
Table: "users",
|
Table: "users",
|
||||||
|
|
||||||
@@ -105,7 +51,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// Update a record in the database. Include an "id" in the record to update.
|
||||||
@@ -136,7 +82,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// Read data from a table. Lookup can be by ID or via querying any field in the record.
|
||||||
@@ -164,7 +110,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/db"
|
"go.m3o.com/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a record in the database by id.
|
// Delete a record in the database by id.
|
||||||
@@ -178,3 +124,57 @@ Table: "users",
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/db"
|
"go.m3o.com/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Count records in a table
|
// Count records in a table
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// 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"))
|
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: "users",
|
Table: "users",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/db"
|
"go.m3o.com/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a record in the database by id.
|
// Delete a record in the database by id.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// Read data from a table. Lookup can be by ID or via querying any field in the record.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/db"
|
"go.m3o.com/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Truncate the records in a table
|
// Truncate the records in a table
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// Update a record in the database. Include an "id" in the record to update.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// Send an email by passing in from, to, subject, and a text or html body
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// 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:
|
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
|
||||||
|
|
||||||
Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
|
Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
|
||||||
@@ -18,7 +73,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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>'
|
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
|
||||||
@@ -47,7 +102,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/emoji"
|
"go.m3o.com/emoji"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Find an emoji by its alias e.g :beer:
|
// Find an emoji by its alias e.g :beer:
|
||||||
@@ -60,58 +115,3 @@ func FindEmoji() {
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/emoji"
|
"go.m3o.com/emoji"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Find an emoji by its alias e.g :beer:
|
// Find an emoji by its alias e.g :beer:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// Get the flag for a country. Requires country code e.g GB for great britain
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/emoji"
|
"go.m3o.com/emoji"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Print text and renders the emojis with aliases e.g
|
// Print text and renders the emojis with aliases e.g
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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>'
|
// 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:
|
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
|
||||||
|
|
||||||
Search by giving a coordinate and a max distance, or bounding box and optional filters
|
Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||||
@@ -18,7 +44,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||||
@@ -49,7 +75,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||||
@@ -77,7 +103,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// 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)
|
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"
|
"fmt"
|
||||||
"os"
|
"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
|
// Retrieve reference data as used by this API and in conjunction with the Search endpoint
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// Search by giving a coordinate and a max distance, or bounding box and optional filters
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// 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:
|
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
|
||||||
|
|
||||||
List files by their project and optionally a path.
|
List files by their project and optionally a path.
|
||||||
@@ -18,7 +49,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/file"
|
"go.m3o.com/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List files by their project and optionally a path.
|
// List files by their project and optionally a path.
|
||||||
@@ -45,7 +76,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/file"
|
"go.m3o.com/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a file by project name/path
|
// Delete a file by project name/path
|
||||||
@@ -73,7 +104,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/file"
|
"go.m3o.com/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Read a file by path
|
// Read a file by path
|
||||||
@@ -87,34 +118,3 @@ Project: "examples",
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/file"
|
"go.m3o.com/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a file by project name/path
|
// Delete a file by project name/path
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/file"
|
"go.m3o.com/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List files by their project and optionally a path.
|
// List files by their project and optionally a path.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/file"
|
"go.m3o.com/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Read a file by path
|
// Read a file by path
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/file"
|
"go.m3o.com/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Save a file
|
// Save a file
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/forex"
|
"go.m3o.com/forex"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the latest price for a given forex ticker
|
// Get the latest price for a given forex ticker
|
||||||
@@ -45,7 +45,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/forex"
|
"go.m3o.com/forex"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the latest quote for the forex
|
// Get the latest quote for the forex
|
||||||
@@ -72,7 +72,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/forex"
|
"go.m3o.com/forex"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Returns the data for the previous close
|
// Returns the data for the previous close
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/forex"
|
"go.m3o.com/forex"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Returns the data for the previous close
|
// Returns the data for the previous close
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/forex"
|
"go.m3o.com/forex"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the latest price for a given forex ticker
|
// Get the latest price for a given forex ticker
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/forex"
|
"go.m3o.com/forex"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the latest quote for the forex
|
// Get the latest quote for the forex
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Deploy a group of functions
|
// Deploy a group of functions
|
||||||
@@ -49,7 +49,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Call a function by name
|
// Call a function by name
|
||||||
@@ -78,7 +78,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List all the deployed functions
|
// List all the deployed functions
|
||||||
@@ -104,7 +104,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a function by name
|
// Delete a function by name
|
||||||
@@ -132,7 +132,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the info for a deployed function
|
// Get the info for a deployed function
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Call a function by name
|
// Call a function by name
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a function by name
|
// Delete a function by name
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Deploy a group of functions
|
// Deploy a group of functions
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the info for a deployed function
|
// Get the info for a deployed function
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/function"
|
"go.m3o.com/function"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List all the deployed functions
|
// List all the deployed functions
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// 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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/geocoding"
|
"go.m3o.com/geocoding"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reverse lookup an address from gps coordinates
|
// Reverse lookup an address from gps coordinates
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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
|
// 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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/geocoding"
|
"go.m3o.com/geocoding"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reverse lookup an address from gps coordinates
|
// Reverse lookup an address from gps coordinates
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/gifs"
|
"go.m3o.com/gifs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Search for a GIF
|
// Search for a GIF
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/gifs"
|
"go.m3o.com/gifs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Search for a GIF
|
// Search for a GIF
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/google"
|
"go.m3o.com/google"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Search for videos on Google
|
// Search for videos on Google
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/google"
|
"go.m3o.com/google"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Search for videos on 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:
|
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
|
||||||
|
|
||||||
Stream returns a stream of "Hello $name" responses
|
Stream returns a stream of "Hello $name" responses
|
||||||
@@ -45,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/helloworld"
|
"go.m3o.com/helloworld"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Stream returns a stream of "Hello $name" responses
|
// Stream returns a stream of "Hello $name" responses
|
||||||
@@ -58,3 +31,30 @@ func StreamsAreCurrentlyTemporarilyNotSupportedInClients() {
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/helloworld"
|
"go.m3o.com/helloworld"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Call returns a personalised "Hello $name" response
|
// Call returns a personalised "Hello $name" response
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/helloworld"
|
"go.m3o.com/helloworld"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Stream returns a stream of "Hello $name" responses
|
// 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:
|
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
|
## Countries
|
||||||
|
|
||||||
Get the list of countries that are supported by this API
|
Get the list of countries that are supported by this API
|
||||||
@@ -45,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/holidays"
|
"go.m3o.com/holidays"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the list of countries that are supported by this API
|
// Get the list of countries that are supported by this API
|
||||||
@@ -57,3 +30,30 @@ func ListCountries() {
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/holidays"
|
"go.m3o.com/holidays"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the list of countries that are supported by this API
|
// Get the list of countries that are supported by this API
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/holidays"
|
"go.m3o.com/holidays"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List the holiday dates for a given country and year
|
// List the holiday dates for a given country and year
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate a unique ID. Defaults to uuid.
|
// Generate a unique ID. Defaults to uuid.
|
||||||
@@ -45,7 +45,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate a unique ID. Defaults to uuid.
|
// Generate a unique ID. Defaults to uuid.
|
||||||
@@ -72,7 +72,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate a unique ID. Defaults to uuid.
|
// Generate a unique ID. Defaults to uuid.
|
||||||
@@ -99,7 +99,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate a unique ID. Defaults to uuid.
|
// Generate a unique ID. Defaults to uuid.
|
||||||
@@ -126,7 +126,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List the types of IDs available. No query params needed.
|
// List the types of IDs available. No query params needed.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate a unique ID. Defaults to uuid.
|
// Generate a unique ID. Defaults to uuid.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate a unique ID. Defaults to uuid.
|
// Generate a unique ID. Defaults to uuid.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate a unique ID. Defaults to uuid.
|
// Generate a unique ID. Defaults to uuid.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate a unique ID. Defaults to uuid.
|
// Generate a unique ID. Defaults to uuid.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/id"
|
"go.m3o.com/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List the types of IDs available. No query params needed.
|
// List the types of IDs available. No query params needed.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// 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"
|
"fmt"
|
||||||
"os"
|
"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.
|
// 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"
|
"fmt"
|
||||||
"os"
|
"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.
|
// 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"
|
"fmt"
|
||||||
"os"
|
"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),
|
// 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"
|
"fmt"
|
||||||
"os"
|
"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.
|
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||||
@@ -183,7 +183,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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),
|
// 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"
|
"fmt"
|
||||||
"os"
|
"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.
|
// 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"
|
"fmt"
|
||||||
"os"
|
"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.
|
// 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"
|
"fmt"
|
||||||
"os"
|
"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.
|
// 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"
|
"fmt"
|
||||||
"os"
|
"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.
|
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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.
|
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/ip"
|
"go.m3o.com/ip"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Lookup the geolocation information for an IP address
|
// Lookup the geolocation information for an IP address
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/ip"
|
"go.m3o.com/ip"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Lookup the geolocation information for an IP address
|
// Lookup the geolocation information for an IP address
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/location"
|
"go.m3o.com/location"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Save an entity's current position
|
// Save an entity's current position
|
||||||
@@ -53,7 +53,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/location"
|
"go.m3o.com/location"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Read an entity by its ID
|
// Read an entity by its ID
|
||||||
@@ -80,7 +80,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/location"
|
"go.m3o.com/location"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Search for entities in a given radius
|
// Search for entities in a given radius
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/location"
|
"go.m3o.com/location"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Read an entity by its ID
|
// Read an entity by its ID
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/location"
|
"go.m3o.com/location"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Save an entity's current position
|
// Save an entity's current position
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/location"
|
"go.m3o.com/location"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Search for entities in a given radius
|
// 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:
|
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
|
||||||
|
|
||||||
Read a note
|
Read a note
|
||||||
@@ -46,7 +18,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/notes"
|
"go.m3o.com/notes"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Read a note
|
// Read a note
|
||||||
@@ -73,7 +45,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/notes"
|
"go.m3o.com/notes"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List all the notes
|
// List all the notes
|
||||||
@@ -99,7 +71,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/notes"
|
"go.m3o.com/notes"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Update a note
|
// Update a note
|
||||||
@@ -130,7 +102,7 @@ import(
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/notes"
|
"go.m3o.com/notes"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a note
|
// Delete a note
|
||||||
@@ -143,3 +115,31 @@ func DeleteAnote() {
|
|||||||
fmt.Println(rsp, err)
|
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"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/notes"
|
"go.m3o.com/notes"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create a new note
|
// Create a new note
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/notes"
|
"go.m3o.com/notes"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete a note
|
// Delete a note
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go.m3o.com/notes"
|
"go.m3o.com/notes"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List all the 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