-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
33 lines (28 loc) · 852 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package zauth
import (
"errors"
"time"
)
var (
EmptyParamsErr = errors.New("Parameter should not be empty")
InsufficientBalanceErr = errors.New("Insufficient balance")
InvalidParamsErr = errors.New("Invalid params")
ExpiredRequestErr = errors.New("Expired request")
NoAuthorizationErr = errors.New("Authorization failed")
AuthTagPrefix = "credit-v"
ApiVersion = "1.0"
)
type Account struct {
Uname string `json:"uname"`
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
}
type Authorization struct {
Tag string `json:"tag"`
Version string `json:"version"`
Ak string `json:"ak"`
Ts time.Time `json:"timestamp"`
Expire int64 `json:"expire"`
SignHeaders []string `json:"sign_headers"`
Signature string `json:"signature"`
}