Compare commits

12 Commits

Author SHA1 Message Date
brian 7df6eb3bd5 adding back some supplementary files 2026-05-19 15:44:37 -06:00
brian fc0629090e starting over after doing some planning 2026-05-19 15:42:39 -06:00
brian 8f03b92bc4 wip: a list command 2026-05-12 21:05:34 -06:00
brian 66fc781260 wip: moving things around to logically group them 2026-05-12 21:05:03 -06:00
brian a7eaa45869 wip: a list command 2026-05-12 20:39:19 -06:00
brian 928a6024ad empty out changelog 2026-05-12 20:24:41 -06:00
brian 9b23688ee4 using Cobra for cli stuff 2026-05-09 09:59:42 -06:00
brian 3b5e133773 now reading mimetype, poorly 2026-05-09 09:41:49 -06:00
brian 96dd4949c2 finally getting info on files 2026-05-09 09:31:04 -06:00
brian 56fd10bccf only keep certain files for testing 2026-05-09 09:30:30 -06:00
brian 3d61c4fc4b updated dummy files 2026-05-09 09:29:33 -06:00
brian b6c4698fa9 must use full path for files 2026-05-09 08:49:51 -06:00
8 changed files with 6 additions and 74 deletions
-5
View File
@@ -1,5 +0,0 @@
# HTTP Settings
PORT=8080
# App Settings
STORAGE_PATH=files
+3 -4
View File
@@ -9,16 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- v1.1 German Translation
-
### Changed
- Use frontmatter title & description in each language version template
-
### Removed
- Trademark sign previously shown after the project description in version
0.3.0
-
## [0.0.0] - 2000-01-01
+3
View File
@@ -9,3 +9,6 @@ vet: fmt
build: vet
go build -o drogobox internal/app/main.go
test:
go test ./tests/...
View File
View File
-5
View File
@@ -1,5 +0,0 @@
module drogobox.com/drogobox
go 1.25.9
require github.com/joho/godotenv v1.5.1 // indirect
-2
View File
@@ -1,2 +0,0 @@
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
-58
View File
@@ -1,58 +0,0 @@
package main
import (
"fmt"
"log"
"os"
"github.com/joho/godotenv"
)
func resolveFileStorePath(file_store_path string) {
err := os.MkdirAll(file_store_path, os.ModePerm)
if err != nil {
log.Fatal(err)
}
}
type StoredFileNode struct {
Name string `json:"name"` // full file name with extension
Path string `json:"path"` // path to file
Size int64 `json:"size"` // byte size of file
Extension string `json:"extension"` // the file name extension
MimeType string `json:"mime_type"` // mime type regarless of extension
Permissions string `json:"permissions"` // UNIX permissions
IsFolder bool `json:"is_folder"` // directory flag
Modified time.Time `json:"modified_at"` // last modification date
}
func readFilesFromFileStorePath(file_store_path string) {
files, err := os.ReadDir(file_store_path)
if err != nil {
log.Fatal(err)
}
for _, file := range files {
if !file.IsDir() {
fmt.Println(file.Name())
}
}
}
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
port := os.Getenv("PORT")
file_store_path := os.Getenv("STORAGE_PATH")
resolveFileStorePath(file_store_path)
fmt.Printf("in the future I will listen on port: %s\n", port)
fmt.Printf("Reading files from: %s\n", file_store_path)
readFilesFromFileStorePath(file_store_path)
}