libpass
A Go package for generating secure and memorable passwords. It serves as the backbone for mempass and mempass-api
Install
go get github.com/eljamo/libpass/v7
Basic Usage
package main
import (
"fmt"
"github.com/eljamo/libpass/v7/config"
"github.com/eljamo/libpass/v7/service"
)
func main() {
cfg, err := config.New()
if err != nil {
fmt.Println(err)
}
svc, err := service.NewPasswordGeneratorService(cfg)
if err != nil {
fmt.Println(err)
}
pws, err := svc.Generate()
if err != nil {
fmt.Println(err)
}
fmt.Println(pws)
}
$ go run ./example/example.go
[^^77%TWIKI%ardently%STORM%58^^ ^^57.HIGH.DOLL.GRAY.67^^ ::90:passive:FEELS:WASTING:40::]
Contributing
If you'd like to contribute, please fork the repository and work your magic. Open a pull request to the main
branch if it is a bugfix
or feature
branch. If it is a hotfix
branch, open a pull request to the respective release
branch.
Run the tests
go test --race --shuffle on ./...
Run the example
go run ./example/example.go
Branching Strategy
bugfix/*
feature/*
main
release/v*
hotfix/*
Workflow Breakdown
Example Scenarios
-
Developing a feature:
- Create a
feature
branch from main
.
- Develop and test the feature on the
feature
branch.
- Merge the
feature
branch into main
.
-
Fixing a bug:
- Create a
bugfix
branch from main
.
- Fix and test the bug on the
bugfix
branch.
- Merge the
bugfix
branch into main
.
-
Making a release:
- Create a
release
branch from main
or another release
branch.
- Perform testing on
release
branch.
- Deploy the
release
branch.
-
Applying a hotfix:
- Create a
hotfix
branch from a release
branch.
- Fix the critical issue on
hotfix
branch.
- Merge
hotfix
branch into the release
and main
branches.