客户端授权验证

This commit is contained in:
奶爸
2019-12-09 16:02:49 +08:00
parent 986dc6114a
commit 58277ba0b6
13 changed files with 211 additions and 73 deletions

View File

@@ -7,6 +7,8 @@ const CtxKeyIsUserLogin = "ckiul"
// CtxKeyOauth2State ..
const CtxKeyOauth2State = "cko2s"
// CtxKeyServer ..
const CtxKeyServer = "cks"
// Common ..
type Common struct {

View File

@@ -2,6 +2,12 @@ package model
import pb "github.com/p14yground/nezha/proto"
const (
_ = iota
// MTReportState ..
MTReportState
)
// State ..
type State struct {
CPU float64
@@ -39,6 +45,8 @@ type Host struct {
Virtualization string
Uptime string
BootTime string
IP string
CountryCode string
Version string
}
@@ -52,6 +60,8 @@ func (h *Host) PB() *pb.Host {
Virtualization: h.Virtualization,
Uptime: h.Uptime,
BootTime: h.BootTime,
Ip: h.IP,
CountryCode: h.CountryCode,
Version: h.Version,
}
}