-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.go
35 lines (29 loc) · 895 Bytes
/
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
package helpers
type ResponseForm struct {
Success bool `json:"success"`
Result interface{} `json:"result,omitempty"`
Data interface{} `json:"data,omitempty"`
Messages []string `json:"messages,omitempty"`
Errors []ResponseError `json:"errors,omitempty"`
ResultInfo *ResultInfo `json:"result_info,omitempty"`
}
// ResponseError
// backward complatible Error
type ResponseError Error
type ResultInfo struct {
Page int `json:"page"`
PerPage int `json:"per_page"`
Count int `json:"count"`
TotalCont int `json:"total_count"`
}
type AuthType string
const (
BasicAuth AuthType = "basic"
BearerToken AuthType = "bearer"
)
type HttpAuth struct {
Type AuthType `json:"auth_type"`
Token string `json:"token,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}