Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-12-09 15:06:12 +00:00
parent 92edd2c7df
commit f6a6c065b1
176 changed files with 918 additions and 1077 deletions

View File

@@ -14,5 +14,4 @@ func main() {
Postcode: "SW1A 2AA",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Query: "microsoft",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Name: "helloworld",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Message: "Launch it!",
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Value: 2,
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Key: "foo",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Key: "foo",
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Value: 2,
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Value: "bar",
})
fmt.Println(rsp, err)
}

View File

@@ -4,62 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Crypto/api](ht
Endpoints:
## Quote
Get the last quote for a given crypto ticker
[https://m3o.com/crypto/api#Quote](https://m3o.com/crypto/api#Quote)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Get the last quote for a given crypto ticker
func GetAcryptocurrencyQuote() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.Quote(&crypto.QuoteRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}
```
## History
Returns the history for the previous close
[https://m3o.com/crypto/api#History](https://m3o.com/crypto/api#History)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Returns the history for the previous close
func GetPreviousClose() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.History(&crypto.HistoryRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}
```
## News
Get news related to a currency
@@ -116,3 +60,59 @@ func GetCryptocurrencyPrice() {
}
```
## Quote
Get the last quote for a given crypto ticker
[https://m3o.com/crypto/api#Quote](https://m3o.com/crypto/api#Quote)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Get the last quote for a given crypto ticker
func GetAcryptocurrencyQuote() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.Quote(&crypto.QuoteRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}
```
## History
Returns the history for the previous close
[https://m3o.com/crypto/api#History](https://m3o.com/crypto/api#History)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Returns the history for the previous close
func GetPreviousClose() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.History(&crypto.HistoryRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}
```

View File

@@ -14,5 +14,4 @@ func main() {
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -12,5 +12,4 @@ func main() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Codes(&currency.CodesRequest{})
fmt.Println(rsp, err)
}

View File

@@ -16,5 +16,4 @@ func main() {
To: "GBP",
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
To: "GBP",
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Date: "2021-05-30",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Code: "USD",
})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,118 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Db/api](https:
Endpoints:
## DropTable
Drop a table in the DB
[https://m3o.com/db/api#DropTable](https://m3o.com/db/api#DropTable)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Drop a table in the DB
func DropTable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.DropTable(&db.DropTableRequest{
Table: "example",
})
fmt.Println(rsp, err)
}
```
## Count
Count records in a table
[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Count records in a table
func CountEntriesInAtable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Count(&db.CountRequest{
Table: "example",
})
fmt.Println(rsp, err)
}
```
## ListTables
List tables in the DB
[https://m3o.com/db/api#ListTables](https://m3o.com/db/api#ListTables)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// List tables in the DB
func ListTables() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.ListTables(&db.ListTablesRequest{
})
fmt.Println(rsp, err)
}
```
## RenameTable
Rename a table
[https://m3o.com/db/api#RenameTable](https://m3o.com/db/api#RenameTable)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Rename a table
func RenameTable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.RenameTable(&db.RenameTableRequest{
From: "examples2",
To: "examples3",
})
fmt.Println(rsp, err)
}
```
## Create
Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
@@ -36,6 +148,38 @@ Table: "example",
})
fmt.Println(rsp, err)
}
```
## Update
Update a record in the database. Include an "id" in the record to update.
[https://m3o.com/db/api#Update](https://m3o.com/db/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Update a record in the database. Include an "id" in the record to update.
func UpdateArecord() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Update(&db.UpdateRequest{
Record: map[string]interface{}{
"id": "1",
"age": 43,
},
Table: "example",
})
fmt.Println(rsp, err)
}
```
## Read
@@ -124,147 +268,3 @@ func TruncateTable() {
}
```
## DropTable
Drop a table in the DB
[https://m3o.com/db/api#DropTable](https://m3o.com/db/api#DropTable)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Drop a table in the DB
func DropTable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.DropTable(&db.DropTableRequest{
Table: "example",
})
fmt.Println(rsp, err)
}
```
## ListTables
List tables in the DB
[https://m3o.com/db/api#ListTables](https://m3o.com/db/api#ListTables)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// List tables in the DB
func ListTables() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.ListTables(&db.ListTablesRequest{
})
fmt.Println(rsp, err)
}
```
## RenameTable
Rename a table
[https://m3o.com/db/api#RenameTable](https://m3o.com/db/api#RenameTable)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Rename a table
func RenameTable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.RenameTable(&db.RenameTableRequest{
From: "examples2",
To: "examples3",
})
fmt.Println(rsp, err)
}
```
## Update
Update a record in the database. Include an "id" in the record to update.
[https://m3o.com/db/api#Update](https://m3o.com/db/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Update a record in the database. Include an "id" in the record to update.
func UpdateArecord() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Update(&db.UpdateRequest{
Record: map[string]interface{}{
"id": "1",
"age": 43,
},
Table: "example",
})
fmt.Println(rsp, err)
}
```
## Count
Count records in a table
[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Count records in a table
func CountEntriesInAtable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Count(&db.CountRequest{
Table: "example",
})
fmt.Println(rsp, err)
}
```

View File

@@ -14,5 +14,4 @@ func main() {
Table: "example",
})
fmt.Println(rsp, err)
}

View File

@@ -12,13 +12,12 @@ func main() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Create(&db.CreateRequest{
Record: map[string]interface{}{
"name": "Jane",
"age": 42,
"isActive": true,
"id": "1",
"name": "Jane",
"age": 42,
},
Table: "example",
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Table: "example",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Table: "example",
})
fmt.Println(rsp, err)
}

View File

@@ -12,5 +12,4 @@ func main() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.ListTables(&db.ListTablesRequest{})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Table: "example",
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
To: "examples3",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Table: "example",
})
fmt.Println(rsp, err)
}

View File

@@ -12,11 +12,10 @@ func main() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Update(&db.UpdateRequest{
Record: map[string]interface{}{
"age": 43,
"id": "1",
"age": 43,
},
Table: "example",
})
fmt.Println(rsp, err)
}

View File

@@ -18,5 +18,4 @@ func main() {
Please verify your email by clicking this link: $micro_verification_link`,
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Alias: ":beer:",
})
fmt.Println(rsp, err)
}

View File

@@ -12,5 +12,4 @@ func main() {
emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emojiService.Flag(&emoji.FlagRequest{})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Text: "let's grab a :beer:",
})
fmt.Println(rsp, err)
}

View File

@@ -16,5 +16,4 @@ func main() {
To: "+44782669123",
})
fmt.Println(rsp, err)
}

View File

@@ -4,33 +4,6 @@ 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
@@ -125,3 +98,30 @@ Location: &evchargers.Coordinates{
}
```
## 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)
}
```

View File

@@ -12,5 +12,4 @@ func main() {
evchargersService := evchargers.NewEvchargersService(os.Getenv("M3O_API_TOKEN"))
rsp, err := evchargersService.ReferenceData(&evchargers.ReferenceDataRequest{})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Box: &evchargers.BoundingBox{},
})
fmt.Println(rsp, err)
}

View File

@@ -18,5 +18,4 @@ func main() {
},
})
fmt.Println(rsp, err)
}

View File

@@ -19,5 +19,4 @@ func main() {
},
})
fmt.Println(rsp, err)
}

View File

@@ -10,7 +10,6 @@ import (
// Consume events from a given topic.
func main() {
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
stream, err := eventService.Consume(&event.ConsumeRequest{
Topic: "user",
})

View File

@@ -19,5 +19,4 @@ func main() {
Topic: "user",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Topic: "user",
})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,64 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/File/api](http
Endpoints:
## Delete
Delete a file by project name/path
[https://m3o.com/file/api#Delete](https://m3o.com/file/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/file"
)
// Delete a file by project name/path
func DeleteFile() {
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
rsp, err := fileService.Delete(&file.DeleteRequest{
Path: "/document/text-files/file.txt",
Project: "examples",
})
fmt.Println(rsp, err)
}
```
## Read
Read a file by path
[https://m3o.com/file/api#Read](https://m3o.com/file/api#Read)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/file"
)
// Read a file by path
func ReadFile() {
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
rsp, err := fileService.Read(&file.ReadRequest{
Path: "/document/text-files/file.txt",
Project: "examples",
})
fmt.Println(rsp, err)
}
```
## Save
Save a file
@@ -64,61 +122,3 @@ func ListFiles() {
}
```
## Delete
Delete a file by project name/path
[https://m3o.com/file/api#Delete](https://m3o.com/file/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/file"
)
// Delete a file by project name/path
func DeleteFile() {
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
rsp, err := fileService.Delete(&file.DeleteRequest{
Path: "/document/text-files/file.txt",
Project: "examples",
})
fmt.Println(rsp, err)
}
```
## Read
Read a file by path
[https://m3o.com/file/api#Read](https://m3o.com/file/api#Read)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/file"
)
// Read a file by path
func ReadFile() {
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
rsp, err := fileService.Read(&file.ReadRequest{
Path: "/document/text-files/file.txt",
Project: "examples",
})
fmt.Println(rsp, err)
}
```

View File

@@ -15,5 +15,4 @@ func main() {
Project: "examples",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Project: "examples",
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Project: "examples",
})
fmt.Println(rsp, err)
}

View File

@@ -18,5 +18,4 @@ func main() {
},
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Symbol: "GBPUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Symbol: "GBPUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Symbol: "GBPUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Function/api](
Endpoints:
## List
List all the deployed functions
[https://m3o.com/function/api#List](https://m3o.com/function/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// List all the deployed functions
func ListFunctions() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.List(&function.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Delete
Delete a function by name
@@ -148,3 +121,30 @@ Request: map[string]interface{}{
}
```
## List
List all the deployed functions
[https://m3o.com/function/api#List](https://m3o.com/function/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// List all the deployed functions
func ListFunctions() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.List(&function.ListRequest{
})
fmt.Println(rsp, err)
}
```

View File

@@ -15,5 +15,4 @@ func main() {
Request: map[string]interface{}{},
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Name: "helloworld",
})
fmt.Println(rsp, err)
}

View File

@@ -17,5 +17,4 @@ func main() {
Runtime: "nodejs14",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Name: "helloworld",
})
fmt.Println(rsp, err)
}

View File

@@ -12,5 +12,4 @@ func main() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.List(&function.ListRequest{})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,35 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Geocoding/api]
Endpoints:
## Reverse
Reverse lookup an address from gps coordinates
[https://m3o.com/geocoding/api#Reverse](https://m3o.com/geocoding/api#Reverse)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/geocoding"
)
// Reverse lookup an address from gps coordinates
func ReverseGeocodeLocation() {
geocodingService := geocoding.NewGeocodingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := geocodingService.Reverse(&geocoding.ReverseRequest{
Latitude: 51.5123064,
Longitude: -0.1216235,
})
fmt.Println(rsp, err)
}
```
## Lookup
Lookup returns a geocoded address including normalized address and gps coordinates. All fields are optional, provide more to get more accurate results
@@ -35,32 +64,3 @@ Postcode: "wc2b",
}
```
## Reverse
Reverse lookup an address from gps coordinates
[https://m3o.com/geocoding/api#Reverse](https://m3o.com/geocoding/api#Reverse)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/geocoding"
)
// Reverse lookup an address from gps coordinates
func ReverseGeocodeLocation() {
geocodingService := geocoding.NewGeocodingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := geocodingService.Reverse(&geocoding.ReverseRequest{
Latitude: 51.5123064,
Longitude: -0.1216235,
})
fmt.Println(rsp, err)
}
```

View File

@@ -17,5 +17,4 @@ func main() {
Postcode: "wc2b",
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Longitude: -0.1216235,
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Query: "dogs",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Query: "how to make donuts",
})
fmt.Println(rsp, err)
}

View File

@@ -4,34 +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"
"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
@@ -74,3 +46,31 @@ Name: "John",
}
}
```
## 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)
}
```

View File

@@ -14,5 +14,4 @@ func main() {
Name: "John",
})
fmt.Println(rsp, err)
}

View File

@@ -10,7 +10,6 @@ import (
// Stream returns a stream of "Hello $name" responses
func main() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
stream, err := helloworldService.Stream(&helloworld.StreamRequest{
Messages: 10,
Name: "John",

View File

@@ -12,5 +12,4 @@ func main() {
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
rsp, err := holidaysService.Countries(&holidays.CountriesRequest{})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Year: 2022,
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Type: "bigflake",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Type: "shortid",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Type: "snowflake",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Type: "uuid",
})
fmt.Println(rsp, err)
}

View File

@@ -12,5 +12,4 @@ func main() {
idService := id.NewIdService(os.Getenv("M3O_API_TOKEN"))
rsp, err := idService.Types(&id.TypesRequest{})
fmt.Println(rsp, err)
}

View File

@@ -18,5 +18,4 @@ func main() {
Url: "somewebsite.com/cat.png",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Url: "https://cdn.m3ocontent.com/micro/images/micro/41e23b39-48dd-42b6-9738-79a313414bb8/cat.png",
})
fmt.Println(rsp, err)
}

View File

@@ -20,5 +20,4 @@ func main() {
Width: 100,
})
fmt.Println(rsp, err)
}

View File

@@ -24,5 +24,4 @@ func main() {
Width: 100,
})
fmt.Println(rsp, err)
}

View File

@@ -21,5 +21,4 @@ func main() {
Width: 100,
})
fmt.Println(rsp, err)
}

View File

@@ -18,5 +18,4 @@ func main() {
Name: "cat.jpeg",
})
fmt.Println(rsp, err)
}

View File

@@ -18,5 +18,4 @@ func main() {
Url: "somewebsite.com/cat.png",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Ip: "93.148.214.31",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Count: 3,
})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,42 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Location/api](
Endpoints:
## Save
Save an entity's current position
[https://m3o.com/location/api#Save](https://m3o.com/location/api#Save)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/location"
)
// Save an entity's current position
func SaveAnEntity() {
locationService := location.NewLocationService(os.Getenv("M3O_API_TOKEN"))
rsp, err := locationService.Save(&location.SaveRequest{
Entity: &location.Entity{
Id: "1",
Location: &location.Point{
Latitude: 51.511061,
Longitude: -0.120022,
Timestamp: 1622802761,
},
Type: "bike",
},
})
fmt.Println(rsp, err)
}
```
## Read
Read an entity by its ID
@@ -66,39 +102,3 @@ Type: "bike",
}
```
## Save
Save an entity's current position
[https://m3o.com/location/api#Save](https://m3o.com/location/api#Save)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/location"
)
// Save an entity's current position
func SaveAnEntity() {
locationService := location.NewLocationService(os.Getenv("M3O_API_TOKEN"))
rsp, err := locationService.Save(&location.SaveRequest{
Entity: &location.Entity{
Id: "1",
Location: &location.Point{
Latitude: 51.511061,
Longitude: -0.120022,
Timestamp: 1622802761,
},
Type: "bike",
},
})
fmt.Println(rsp, err)
}
```

View File

@@ -14,5 +14,4 @@ func main() {
Id: "1",
})
fmt.Println(rsp, err)
}

View File

@@ -22,5 +22,4 @@ func main() {
},
})
fmt.Println(rsp, err)
}

View File

@@ -20,5 +20,4 @@ func main() {
Type: "bike",
})
fmt.Println(rsp, err)
}

View File

@@ -18,5 +18,4 @@ func main() {
Year: 2010,
})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,39 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Mq/api](https:
Endpoints:
## Publish
Publish a message. Specify a topic to group messages for a specific topic.
[https://m3o.com/mq/api#Publish](https://m3o.com/mq/api#Publish)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/mq"
)
// Publish a message. Specify a topic to group messages for a specific topic.
func PublishAmessage() {
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{
"type": "signup",
"user": "john",
"id": "1",
},
Topic: "events",
})
fmt.Println(rsp, err)
}
```
## Subscribe
Subscribe to messages for a given topic.
@@ -45,36 +78,3 @@ func SubscribeToAtopic() {
}
}
```
## Publish
Publish a message. Specify a topic to group messages for a specific topic.
[https://m3o.com/mq/api#Publish](https://m3o.com/mq/api#Publish)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/mq"
)
// Publish a message. Specify a topic to group messages for a specific topic.
func PublishAmessage() {
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{
"user": "john",
"id": "1",
"type": "signup",
},
Topic: "events",
})
fmt.Println(rsp, err)
}
```

View File

@@ -12,12 +12,11 @@ func main() {
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
"id": "1",
},
Topic: "events",
})
fmt.Println(rsp, err)
}

View File

@@ -10,7 +10,6 @@ import (
// Subscribe to messages for a given topic.
func main() {
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
stream, err := mqService.Subscribe(&mq.SubscribeRequest{
Topic: "events",
})

View File

@@ -16,5 +16,4 @@ func main() {
Locale: "us",
})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Nft/api](https
Endpoints:
## Assets
Return a list of assets
[https://m3o.com/nft/api#Assets](https://m3o.com/nft/api#Assets)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/nft"
)
// Return a list of assets
func GetAlistOfAssets() {
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := nftService.Assets(&nft.AssetsRequest{
Limit: 1,
})
fmt.Println(rsp, err)
}
```
## Create
Create your own NFT (coming soon)
@@ -61,31 +89,3 @@ func ListCollections() {
}
```
## Assets
Return a list of assets
[https://m3o.com/nft/api#Assets](https://m3o.com/nft/api#Assets)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/nft"
)
// Return a list of assets
func GetAlistOfAssets() {
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := nftService.Assets(&nft.AssetsRequest{
Limit: 1,
})
fmt.Println(rsp, err)
}
```

View File

@@ -14,5 +14,4 @@ func main() {
Limit: 1,
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Limit: 1,
})
fmt.Println(rsp, err)
}

View File

@@ -15,5 +15,4 @@ func main() {
Name: "Guybrush Threepwood",
})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,93 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Notes/api](htt
Endpoints:
## List
List all the notes
[https://m3o.com/notes/api#List](https://m3o.com/notes/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// List all the notes
func ListAllNotes() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.List(&notes.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Update
Update a note
[https://m3o.com/notes/api#Update](https://m3o.com/notes/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// Update a note
func UpdateAnote() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.Update(&notes.UpdateRequest{
Note: &notes.Note{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
Text: "Updated note text",
Title: "Update Note",
},
})
fmt.Println(rsp, err)
}
```
## Delete
Delete a note
[https://m3o.com/notes/api#Delete](https://m3o.com/notes/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// Delete a note
func DeleteAnote() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.Delete(&notes.DeleteRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```
## Events
Subscribe to notes events
@@ -102,90 +189,3 @@ func ReadAnote() {
}
```
## List
List all the notes
[https://m3o.com/notes/api#List](https://m3o.com/notes/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// List all the notes
func ListAllNotes() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.List(&notes.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Update
Update a note
[https://m3o.com/notes/api#Update](https://m3o.com/notes/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// Update a note
func UpdateAnote() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.Update(&notes.UpdateRequest{
Note: &notes.Note{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
Text: "Updated note text",
Title: "Update Note",
},
})
fmt.Println(rsp, err)
}
```
## Delete
Delete a note
[https://m3o.com/notes/api#Delete](https://m3o.com/notes/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// Delete a note
func DeleteAnote() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.Delete(&notes.DeleteRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```

View File

@@ -15,5 +15,4 @@ func main() {
Title: "New Note",
})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}

View File

@@ -10,7 +10,6 @@ import (
// Subscribe to notes events
func main() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
stream, err := notesService.Events(&notes.EventsRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})

View File

@@ -12,5 +12,4 @@ func main() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.List(&notes.ListRequest{})
fmt.Println(rsp, err)
}

View File

@@ -14,5 +14,4 @@ func main() {
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}

View File

@@ -18,5 +18,4 @@ func main() {
},
})
fmt.Println(rsp, err)
}

Some files were not shown because too many files have changed in this diff Show More