Skip to content

soxft/go-license

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-license

基于 Golang 开发的一套 在线 License 系统

client

go get -u github.com/soxft/go-license/client
import license "github.com/soxft/go-license/client"

var Pkey = `-----BEGIN RSA PUBLIC KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END RSA PUBLIC KEY-----`

func main() {
  license.Run(3, time.Second*30, "http://server:8080", Pkey)

  // main process
  go core()

  // 使用 license.Exit 阻塞运行
  <-license.Exit
}

server

func main() {
  server.Run()
}
// 设置指定 serial 的到期时间
license_server -m set -s serialNumber -d 2024-11-23