about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-05-27 21:30:54 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-05-27 23:52:44 +0200
commit81621c4f64f4a1c29906643f53314e2f71a014ae (patch)
tree503cc56b609dcad8f8eca6e64b6b9b15b02fd4fd /lib
parentpayload-processor: fmt (diff)
downloadfs-tracer-backend-81621c4f64f4a1c29906643f53314e2f71a014ae.tar.gz
fs-tracer-backend-81621c4f64f4a1c29906643f53314e2f71a014ae.tar.bz2
fs-tracer-backend-81621c4f64f4a1c29906643f53314e2f71a014ae.zip
rest-api: connect to db and add /file/ GET endpoint
TODO: Only get files for your specific user
Diffstat (limited to 'lib')
-rw-r--r--lib/BUILD.bazel8
-rw-r--r--lib/model.go11
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/BUILD.bazel b/lib/BUILD.bazel
new file mode 100644
index 0000000..a9a0e52
--- /dev/null
+++ b/lib/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "lib",
+    srcs = ["model.go"],
+    importpath = "github.com/Baitinq/fs-tracer-backend/lib",
+    visibility = ["//visibility:public"],
+)
diff --git a/lib/model.go b/lib/model.go
new file mode 100644
index 0000000..be86378
--- /dev/null
+++ b/lib/model.go
@@ -0,0 +1,11 @@
+package lib
+
+import "time"
+
+type File struct {
+	Id            int       `db:"id"`
+	User_id       string    `db:"user_id"`
+	Absolute_path string    `db:"absolute_path"`
+	Contents      string    `db:"contents"`
+	Timestamp     time.Time `db:"timestamp"`
+}