-
Notifications
You must be signed in to change notification settings - Fork 6
/
models.go
25 lines (22 loc) · 889 Bytes
/
models.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
package main
import (
"time"
)
// Link describes a link in the database
type Link struct {
ID string `bson:"_id" json:"id"`
URL string `bson:"url" json:"url"`
Clicks uint `bson:"clicks" json:"clicks"`
ShortID string `bson:"short_id" json:"short_id"`
ShortIDInt uint `bson:"short_id_int" json:"short_id_int" sql:",unique"`
UpdatedAt *time.Time `bson:"updated_at,omitempty" json:"updated_at"`
CreatedAt *time.Time `bson:"created_at,omitempty" json:"created_at"`
}
// Counter has the info about total counter so far
type Counter struct {
ID string `bson:"_id" json:"id"`
Count uint `bson:"count" json:"count"`
UpdatedAt *time.Time `bson:"updated_at,omitempty" json:"updated_at"`
CreatedAt *time.Time `bson:"created_at,omitempty" json:"created_at"`
StatType string `bson:"stat_type" json:"stat_type"`
}