diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-05-27 21:30:54 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-05-27 23:52:44 +0200 |
commit | 81621c4f64f4a1c29906643f53314e2f71a014ae (patch) | |
tree | 503cc56b609dcad8f8eca6e64b6b9b15b02fd4fd /lib | |
parent | payload-processor: fmt (diff) | |
download | fs-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.bazel | 8 | ||||
-rw-r--r-- | lib/model.go | 11 |
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"` +} |