aboutsummaryrefslogtreecommitdiff
path: root/pkg/model
diff options
context:
space:
mode:
authorJulien Dessaux2021-04-10 20:11:35 +0200
committerJulien Dessaux2021-04-12 11:11:38 +0200
commitb7c3e058e9b161065b9024458fc7be0b3c5e8cb5 (patch)
treed8a5d047f2aaabb7118a86123cd61761aa4bda6a /pkg/model
parentBegan implementing a database backend (diff)
downloadtrains-b7c3e058e9b161065b9024458fc7be0b3c5e8cb5.tar.gz
trains-b7c3e058e9b161065b9024458fc7be0b3c5e8cb5.tar.bz2
trains-b7c3e058e9b161065b9024458fc7be0b3c5e8cb5.zip
Implemented a user table and the CreateUser function
Diffstat (limited to 'pkg/model')
-rw-r--r--pkg/model/users.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/model/users.go b/pkg/model/users.go
new file mode 100644
index 0000000..dfef67b
--- /dev/null
+++ b/pkg/model/users.go
@@ -0,0 +1,17 @@
+package model
+
+import "time"
+
+type User struct {
+ Id int `json:"id"`
+ Username string `json:"username"`
+ Email string `json:"email"`
+ Created_at *time.Time `json:"created_at"`
+ Last_login_at *time.Time `json:"last_login_at"`
+}
+
+type UserRegistration struct {
+ Username string `json:"username"`
+ Password string `json:"password"`
+ Email string `json:"email"`
+}