-
Notifications
You must be signed in to change notification settings - Fork 3
/
model.go
108 lines (92 loc) · 1.9 KB
/
model.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package base
import (
"net/http"
"net/url"
"time"
)
const (
RegionUsEast1 = "us-east-1"
RegionApSingapore = "ap-singapore-1"
timeFormatV4 = "20060102T150405Z"
)
type ServiceInfo struct {
Timeout time.Duration
Scheme string
Host string
Header http.Header
Credentials Credentials
}
type ApiInfo struct {
Method string
Path string
Query url.Values
Form url.Values
Timeout time.Duration
Header http.Header
}
type Credentials struct {
AccessKeyID string
SecretAccessKey string
Service string
Region string
SessionToken string
}
type metadata struct {
algorithm string
credentialScope string
signedHeaders string
date string
region string
service string
}
// 统一的JSON返回结果
type CommonResponse struct {
ResponseMetadata ResponseMetadata
Result interface{} `json:"Result,omitempty"`
}
type BaseResp struct {
Status string
CreatedTime int64
UpdatedTime int64
}
type ErrorObj struct {
CodeN int
Code string
Message string
}
type ResponseMetadata struct {
RequestId string
Service string `json:",omitempty"`
Region string `json:",omitempty"`
Action string `json:",omitempty"`
Version string `json:",omitempty"`
Error *ErrorObj `json:",omitempty"`
}
type Policy struct {
Statement []*Statement
}
const (
StatementEffectAllow = "Allow"
StatementEffectDeny = "Deny"
)
type Statement struct {
Effect string
Action []string
Resource []string
Condition string `json:",omitempty"`
}
type SecurityToken2 struct {
AccessKeyID string
SecretAccessKey string
SessionToken string
ExpiredTime string
CurrentTime string
}
type InnerToken struct {
LTAccessKeyId string
AccessKeyId string
SignedSecretAccessKey string
ExpiredTime int64
PolicyString string
Signature string
}