From 81621c4f64f4a1c29906643f53314e2f71a014ae Mon Sep 17 00:00:00 2001 From: Baitinq Date: Mon, 27 May 2024 21:30:54 +0200 Subject: rest-api: connect to db and add /file/ GET endpoint TODO: Only get files for your specific user --- lib/BUILD.bazel | 8 ++++++++ lib/model.go | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 lib/BUILD.bazel create mode 100644 lib/model.go (limited to 'lib') 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"` +} -- cgit 1.4.1