-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.go
More file actions
43 lines (37 loc) · 1.07 KB
/
Copy pathmodels.go
File metadata and controls
43 lines (37 loc) · 1.07 KB
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
package main
import (
"sync/atomic"
"time"
"example.com/username/bootdev-chirpy/internal/database"
"github.com/google/uuid"
)
type User struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Email string `json:"email"`
Token string `json:"token"`
RefreshToken string `json:"refresh_token"`
IsChirpyRed bool `json:"is_chirpy_red"`
}
type Chirp struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Body string `json:"body"`
UserID uuid.UUID `json:"user_id"`
}
type parameters struct {
Body string `json:"body"`
Email string `json:"email"`
Password string `json:"password"`
UserId uuid.NullUUID `json:"user_id"`
ExpiresInSeconds int `json:"expires_in_seconds"`
}
type apiConfig struct {
fileserverHits atomic.Int32
db *database.Queries
platform string
secret string
polkaKey string
}