Generation keys support for shorten url, unique key.
package main
import (
"fmt"
"github.com/9bany/kgs/pkg/key0"
)
func main() {
gen := key0.NewGen(key0.WithLen(int8(len)))
k, _ := gen.New()
fmt.Println(k)
}
- Build
docker build . -t kgs
- Run
docker run -p 8080:8080 kgs:latest
- Curl - Get key
curl localhost:8080/key
# {"key":"l6yCLFr"}
Thanks !