first commit
This commit is contained in:
33
pkg/api/const.go
Normal file
33
pkg/api/const.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user