Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-03-02 10:16:25 +00:00
parent e56aeee2a7
commit fd8353bc9c
31 changed files with 1698 additions and 1605 deletions

34
examples/password/README.md Executable file
View File

@@ -0,0 +1,34 @@
# Password
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/password/api](https://m3o.com/password/api).
Endpoints:
## Generate
Generate a strong random password
[https://m3o.com/password/api#Generate](https://m3o.com/password/api#Generate)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/password"
)
// Generate a strong random password
func GeneratePassword() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
Length: 16,
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/password"
)
// Generate a strong random password
func main() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
Length: 16,
})
fmt.Println(rsp, err)
}