Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-10-29 10:44:29 +00:00
parent 4e64b77e47
commit eb73d115f2
212 changed files with 970 additions and 970 deletions

View File

@@ -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(&currency.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(&currency.RatesRequest{
Code: "USD",
})
fmt.Println(rsp, err)
}
```

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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