Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 477 Bytes

README.md

File metadata and controls

37 lines (31 loc) · 477 Bytes

kgs - Key generate service

Generation keys support for shorten url, unique key.

Usage

1. Go code

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)
}

2. Docker

  1. Build
docker build . -t kgs
  1. Run
docker run -p 8080:8080 kgs:latest
  1. Curl - Get key
curl localhost:8080/key
# {"key":"l6yCLFr"}

Thanks !