first commit

This commit is contained in:
2022-03-17 15:59:24 +08:00
commit 2b0debb847
592 changed files with 73946 additions and 0 deletions

33
pkg/api/const.go Normal file
View File

@@ -0,0 +1,33 @@
package api
import (
"context"
"time"
)
const (
RespMiddleWareDisabled = "RespMiddleWareDisabled"
ReqError = "error"
ReqResult = "result"
)
const (
Address = "address"
Signature = "signature"
DeviceName = "deviceName"
DeviceType = "deviceType"
Uuid = "uuid"
Version = "version"
)
const HeaderTimeOut = 120 * time.Second
func NewAddrWithContext(ctx context.Context) string {
addr, ok := ctx.Value(Address).(string)
if !ok {
addr = ""
}
return addr
}