Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-03-02 17:15:22 +00:00
parent bb0db592be
commit a2efcefd8b
23 changed files with 1433 additions and 1372 deletions

View File

@@ -6,7 +6,7 @@ Endpoints:
## Generate
Generate a strong random password
Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
[https://m3o.com/password/api#Generate](https://m3o.com/password/api#Generate)
@@ -21,7 +21,7 @@ import(
"go.m3o.com/password"
)
// Generate a strong random password
// Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
func GeneratePassword() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
@@ -32,3 +32,35 @@ func GeneratePassword() {
}
```
## Generate
Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
[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. Use the switches to control which character types are included, defaults to using all of them
func GeneratePasswordWithoutSpecialCharacters() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
Length: 16,
Lowercase: true,
Numbers: true,
Special: false,
Uppercase: true,
})
fmt.Println(rsp, err)
}
```

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/password"
)
// Generate a strong random password
// Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
func main() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{

View File

@@ -0,0 +1,21 @@
package main
import (
"fmt"
"os"
"go.m3o.com/password"
)
// Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
func main() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
Length: 16,
Lowercase: true,
Numbers: true,
Special: false,
Uppercase: true,
})
fmt.Println(rsp, err)
}