-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
30 lines (25 loc) · 1.03 KB
/
types.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
package core
import "time"
type CreateShort struct {
TargetURL string `form:"target-url" json:"targetUrl" binding:"required"`
ExpiresAt *string `form:"expires-at" json:"expiresAt"`
MaxUses *uint `form:"max-uses" json:"maxUses"`
}
type CreateUser struct {
Username string `form:"username" json:"username" binding:"required,printascii"`
Password string `form:"password" json:"password" binding:"required"`
PasswordConfirm string `form:"password-confirm" json:"passwordConfirm" binding:"required,eqcsfield=Password"`
}
type LoginUser struct {
Username string `form:"username" json:"username" binding:"required,printascii"`
Password string `form:"password" json:"password" binding:"required"`
}
type APIShort struct {
ShortID string
TargetURL string `json:"targetUrl"`
VisitCount uint `json:"visitCount,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
MaxUses *uint `json:"maxUses,omitempty"`
OwnerID *uint `json:"ownerId,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}