aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorvulonkaaz <7442677+vulonkaaz@users.noreply.github.com>2024-06-19 17:44:29 +0200
committervulonkaaz <7442677+vulonkaaz@users.noreply.github.com>2024-06-19 17:44:29 +0200
commit2fe3b4972f02be8b0c6143325d541ddda4b91559 (patch)
tree5b430810b19e0c6b1112c601b9e64b9e9ec72c61 /models
Initial version
Diffstat (limited to 'models')
-rw-r--r--models/post.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/models/post.go b/models/post.go
new file mode 100644
index 0000000..5bbd21f
--- /dev/null
+++ b/models/post.go
@@ -0,0 +1,33 @@
+package models
+
+import (
+ "database/sql"
+ "github.com/lib/pq"
+ "time"
+ "html/template"
+)
+
+type Post struct {
+ Id int `db:"id"`
+ Board string `db:"board"`
+ Picture template.URL `db:"picture"`
+ Thread sql.NullInt32 `db:"thread"`
+ ReplyTo sql.NullInt32 `db:"reply_to"`
+ IpAddress sql.NullString `db:"ip_address"`
+ Special sql.NullString `db:"special"`
+ CreatedAt time.Time `db:"created_at"`
+ UpdatedAt pq.NullTime `db:"updated_at"`
+}
+
+type Thread struct {
+ Id int `db:"id"`
+ Board string `db:"board"`
+ Picture template.URL `db:"picture"`
+ Thread sql.NullInt32 `db:"thread"`
+ ReplyTo sql.NullInt32 `db:"reply_to"`
+ IpAddress sql.NullString `db:"ip_address"`
+ Special sql.NullString `db:"special"`
+ CreatedAt time.Time `db:"created_at"`
+ UpdatedAt pq.NullTime `db:"updated_at"`
+ Replies int `db:"replies"`
+}