From 830169804e32eeb1954cde82013b2dc49b1078b9 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期一, 18 十一月 2019 18:28:50 +0800
Subject: [PATCH] add readme
---
licence.go | 2 --
README.md | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..93badd6
--- /dev/null
+++ b/README.md
@@ -0,0 +1,26 @@
+```
+package main
+
+import (
+ "fmt"
+
+ "basic.com/valib/licence.git"
+)
+
+const key = "flzxsqc,ysyhljt."
+
+func main() {
+ // 鑾峰彇鏈哄櫒鐮�
+ machineCode := licence.GetMachineCode()
+
+ // 鐢熸垚Licence
+ licenceCode := licence.GenerateLicence(machineCode, "2019-12-12 00:00:00", key)
+
+ fmt.Println("machineCode: ", machineCode)
+ fmt.Println("licenceCode: ", licenceCode)
+
+ // 楠岃瘉Licence锛� 0, 鎴愬姛 1, 鏃犳晥 2, 璁惧鏈巿鏉� 3, 杩囨湡
+ fmt.Println(licence.VerifyLicence(licenceCode))
+}
+
+```
\ No newline at end of file
diff --git a/licence.go b/licence.go
index ab955be..4cd111d 100644
--- a/licence.go
+++ b/licence.go
@@ -10,8 +10,6 @@
"github.com/shirou/gopsutil/host"
)
-const key = "flzxsqc,ysyhljt."
-
type Licence struct {
MachineCode string
Expires int64
--
Gitblit v1.8.0