This repository has been archived by the owner on Apr 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
structs.go
175 lines (164 loc) · 5.03 KB
/
structs.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
package triangulate
import (
"gorm.io/gorm"
"image"
"time"
)
type GeneratePollResponse struct {
Queue int `json:"queue"`
Link string `json:"link"`
Identifier string `json:"identifier"`
RandomImage bool `json:"randomImage"`
Thumbnail string `json:"thumbnail"`
Description string `json:"description"`
UserName string `json:"user_name"`
UserLocation string `json:"user_location"`
UserLink string `json:"user_link"`
ThumbnailLink string `json:"image_link"`
}
type User struct {
gorm.Model
EmailHash string `gorm:"unique"`
PasswordHash string
StripeCustomerID string
}
type Stat struct {
gorm.Model
Key string
Value int
}
type Image struct {
FileName string `json:"file_name"`
Identifier string `json:"identifier"`
Timestamp time.Time `json:"timestamp"`
RequestIP string `json:"request_ip"`
Width int
Height int
ImageType string
Shapes bool
Max int
Min int
ComplexityAmount int
ShapesStroke bool
StrokeThickness int
Triangulate bool
TriangulateBefore bool
MaxPoints int
PointsThreshold int
SobelThreshold int
TriangulateWireframe bool
TriangulateNoise bool
TriangulateGrayscale bool `json:"triangulate_grayscale"`
Image image.Image `gorm:"-"`
RandomImage bool `json:"randomImage"`
Thumbnail string `json:"thumbnail"`
Description string `json:"description"`
UserName string `json:"user_name"`
UserLocation string `json:"user_location"`
UserLink string `json:"user_link"`
ThumbnailLink string `json:"image_link"`
AuthenticatedUser bool
Text string
}
type Settings struct {
LoggedIn bool `json:"logged_in"`
PriceId string `json:"price_id"`
StripeKey string `json:"stripe_key"`
}
// TODO implement purging of sessions after x time
type AuthSession struct {
gorm.Model
UserID uint
AuthSessionID string
}
type PasswordReset struct {
gorm.Model
UserID uint
Code string
ExpiresAt time.Time
}
type Session struct {
TempSessionID string
StripeSessionID string
AuthSessionID string
}
type TempSession struct {
gorm.Model
SessionString string `gorm:"unique"`
StripeSessionID string
Email string
Password string
}
type UnsplashRandomImageResponse struct {
ID string `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Width int `json:"width"`
Height int `json:"height"`
Color string `json:"color"`
BlurHash string `json:"blur_hash"`
Downloads int `json:"downloads"`
Likes int `json:"likes"`
LikedByUser bool `json:"liked_by_user"`
Description string `json:"description"`
Exif struct {
Make string `json:"make"`
Model string `json:"model"`
ExposureTime string `json:"exposure_time"`
Aperture string `json:"aperture"`
FocalLength string `json:"focal_length"`
Iso int `json:"iso"`
} `json:"exif"`
Location struct {
Name string `json:"name"`
City string `json:"city"`
Country string `json:"country"`
Position struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
} `json:"position"`
} `json:"location"`
CurrentUserCollections []struct {
ID int `json:"id"`
Title string `json:"title"`
PublishedAt string `json:"published_at"`
LastCollectedAt string `json:"last_collected_at"`
UpdatedAt string `json:"updated_at"`
CoverPhoto interface{} `json:"cover_photo"`
User interface{} `json:"user"`
} `json:"current_user_collections"`
Urls struct {
Raw string `json:"raw"`
Full string `json:"full"`
Regular string `json:"regular"`
Small string `json:"small"`
Thumb string `json:"thumb"`
} `json:"urls"`
Links struct {
Self string `json:"self"`
HTML string `json:"html"`
Download string `json:"download"`
DownloadLocation string `json:"download_location"`
} `json:"links"`
User struct {
ID string `json:"id"`
UpdatedAt string `json:"updated_at"`
Username string `json:"username"`
Name string `json:"name"`
PortfolioURL string `json:"portfolio_url"`
Bio string `json:"bio"`
Location string `json:"location"`
TotalLikes int `json:"total_likes"`
TotalPhotos int `json:"total_photos"`
TotalCollections int `json:"total_collections"`
InstagramUsername string `json:"instagram_username"`
TwitterUsername string `json:"twitter_username"`
Links struct {
Self string `json:"self"`
HTML string `json:"html"`
Photos string `json:"photos"`
Likes string `json:"likes"`
Portfolio string `json:"portfolio"`
} `json:"links"`
} `json:"user"`
}