mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-21 06:25:08 +00:00
Commit from m3o/m3o action
This commit is contained in:
68
examples/avatar/README.md
Executable file
68
examples/avatar/README.md
Executable file
@@ -0,0 +1,68 @@
|
||||
# Avatar
|
||||
|
||||
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Avatar/api](https://m3o.com/Avatar/api).
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Generate
|
||||
|
||||
|
||||
|
||||
|
||||
[https://m3o.com/avatar/api#Generate](https://m3o.com/avatar/api#Generate)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/avatar"
|
||||
)
|
||||
|
||||
//
|
||||
func GenerateAvatarAndReturnBase64stringOfTheAvatar() {
|
||||
avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := avatarService.Generate(&avatar.GenerateRequest{
|
||||
Format: "png",
|
||||
Gender: "female",
|
||||
Upload: true,
|
||||
Username: "",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
## Generate
|
||||
|
||||
|
||||
|
||||
|
||||
[https://m3o.com/avatar/api#Generate](https://m3o.com/avatar/api#Generate)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/avatar"
|
||||
)
|
||||
|
||||
//
|
||||
func GenerateAnAvatarAndUploadTheAvatarToMicrosCdn() {
|
||||
avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := avatarService.Generate(&avatar.GenerateRequest{
|
||||
Format: "jpeg",
|
||||
Gender: "female",
|
||||
Upload: false,
|
||||
Username: "",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user