-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetsdone.go
140 lines (121 loc) · 3.6 KB
/
getsdone.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package main
import (
"database/sql"
)
const (
APP_NAME = "getsdone"
BLOCK_KEY = "abcdefabcdefabcd"
GETSDONE = APP_NAME
HASH_LENGTH = 32
HMAC_KEY = "spain this summer"
IV = "this is ricky bo"
LOCAL_HOST = "127.0.0.1"
PEPPER = "getsdone is the bomb"
SALT_LENGTH = 24
TOKEN_LENGTH = 32
VERSION = "0.1"
)
const (
ICON_MAX_BYTES = 1024 * 100
)
const (
PASSWD_RULE_LENGTH = 8
)
const (
TASK_OPEN = "open"
TASK_COMPLETED = "completed"
TASK_ASSIGNED = "assigned"
TASK_DEFERRED = "deferred"
TASK_ALL = "all"
)
const (
ACTION_COMPLETED = "completed"
ACTION_DEFERRED = "deferred"
ACTION_UNDEFERRED = "undeferred"
)
const (
CONTACT_ACCEPTED = "accepted"
CONTACT_DECLINED = "declined"
CONTACT_PENDING = "pending"
CONTACT_REQUESTED = "requested"
)
const (
UPDATE_TASK_DEFERRED = 1
UPDATE_TASK_UNDEFERRED = 0
)
type VersionInfo struct {
Version string `json:"version"`
}
type Rank struct {
ID string `json:"id"`
Name string `json:"name"`
Count int `json:"count"`
}
type User struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Mobile sql.NullString `json:"mobile"`
Password string `json:"password"`
Salt string `json:"salt"`
Registered bool `json:"registered"`
Icon sql.NullString `json:"icon"`
Token sql.NullString `json:"token"`
RankID string `json:"rankdId"`
RankName string `json:"rankName"`
Created string `json:"created"`
Updated string `json:"updated"`
}
type UserInfo struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Icon sql.NullString `json:"icon"`
RankName string `json:"rankName"`
Created string `json:"created"`
Updated string `json:"updated"`
}
type Contact struct {
ID string `json:"id"`
ContactID string `json:"contactId"`
UserID string `json:"userId"`
ContactName string `json:"contactName"`
ContactIcon sql.NullString `json:"contactIcon"`
State string `json:"state"`
}
type Comment struct {
ID string `json:"id"`
UserID string `json:"userId"`
UserName string `json:"userName"`
UserIcon sql.NullString `json:"userIcon"`
TaskID string `json:"taskId"`
Comment string `json:"comment"`
Created string `json:"created"`
Updated string `json:"updated"`
}
type Task struct {
ID string `json:"id"`
OwnerID string `json:"ownerId"`
OwnerName string `json:"ownerName"`
OwnerIcon sql.NullString `json:"ownerIcon"`
DelegateID sql.NullString `json:"delegateId"`
OriginID sql.NullString `json:"originId"`
StateID sql.NullString `json:"stateId"`
PriorityID sql.NullString `json:"priorityId"`
Task string `json:"task"`
Deferred bool `json:"deferred"`
Visibility bool `json:"visibility"`
Actual sql.NullString `json:"actual"`
Comments []Comment `json:"comments"`
Created string `json:"created"`
Updated string `json:"updated"`
}
type Hashtag struct {
ID string `json:"id"`
Tag string `json:"tag"`
}
type CookieData struct {
ID string `json:"id"`
Token string `json:"token"`
Icon string `json:"icon"`
}