-
Notifications
You must be signed in to change notification settings - Fork 1
/
protocol.go
52 lines (45 loc) · 1.25 KB
/
protocol.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
package pitcher
import "time"
// User in Versatile
type User struct {
ID string `json:"_key"`
Email string `json:"email"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
OwnerToken string `json:"ownerToken"`
Password string `json:"password"`
Role string `json:"role"`
}
// SigninRequest .
type SigninRequest struct {
Email string `json:"email"`
Password string `json:"password"`
}
// Session .
type Session struct {
Agent string `json:"agent,omitempty"`
Token string `json:"token,omitempty"`
Role string `json:"role,omitempty"`
Created time.Time `json:"created,omitempty"`
ValidTo time.Time `json:"validTo,omitempty"`
// OwnerToken string `json:"ownerToken,omitempty"`
// Payload string `json:"payload,omitempty"`
// Policies []string `json:"policies,omitempty"`
}
// Data .
type Data struct {
ID string `json:"_key"`
Name string `json:"name"`
Type string `json:"type"`
LastValue string `json:"lastValue"`
}
// DataPublishRequest .
type DataPublishRequest struct {
Value interface{} `json:"value"`
}
// ErrorResponse .
type ErrorResponse struct {
Status int `json:"status"`
Description string `json:"description"`
ErrorCode string `json:"errorCode"`
}