Compare commits

..

20 Commits

Author SHA1 Message Date
brian ef45dd2474 another round of edits, still need to figure out return types 2026-05-19 22:38:38 -06:00
brian f92155a253 after a few rounds with claude, still not done 2026-05-19 22:34:24 -06:00
brian 9ea4f756e5 fixing type for Storage interface 2026-05-19 22:07:33 -06:00
brian 52a472ef9f starting out 2026-05-19 21:15:27 -06:00
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
brian af4ab7d655 updating gitignore 2026-05-09 07:46:56 -06:00
brian 1c312f4358 adding a struct to manage file nodes 2026-05-07 19:25:57 -06:00
brian 3db77bc32a adding a changelog 2026-05-06 21:50:37 -06:00
brian 3b84e46c93 now reading from a files directory 2026-05-06 21:50:31 -06:00
9 changed files with 133 additions and 53 deletions
-5
View File
@@ -1,5 +0,0 @@
# HTTP Settings
PORT=8080
# App Settings
STORAGE_PATH=files
+33 -10
View File
@@ -1,14 +1,21 @@
# ---> Go
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
### Project Specific
# Files
.env
.env.bak
.env.backup
.env.production
.forgent.json
.container_id
.session_id
*.log
docker-compose.override.yml
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
drogobox
# Test binary, built with `go test -c`
@@ -17,13 +24,29 @@ drogobox
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
# Go workspace file
go.work
go.work.sum
# env file
.env
# Directories
### Editor Specific
# Files
/*.sublime-project
/*.sublime-workspace
# Directories
/.fleet
/.idea
/.nova
/.vscode
/.zed
### System Specific
# Files
.DS_Store
Thumbs.db
# Directories
__MACOSX
+34
View File
@@ -0,0 +1,34 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
-
### Changed
-
### Removed
-
## [0.0.0] - 2000-01-01
### Added
-
### Changed
-
### Removed
-
+3
View File
@@ -9,3 +9,6 @@ vet: fmt
build: vet
go build -o drogobox internal/app/main.go
test:
go test ./tests/...
+2 -4
View File
@@ -1,5 +1,3 @@
module drogobox.com/drogobox
module drogobox.com/drogobox-server
go 1.25.9
require github.com/joho/godotenv v1.5.1 // indirect
go 1.26.3
-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=
-32
View File
@@ -1,32 +0,0 @@
package main
import (
"fmt"
"log"
"os"
"github.com/joho/godotenv"
)
func resolveFileStorePath(path string) {
err := os.MkdirAll(path, os.ModePerm)
if err != nil {
log.Fatal(err)
}
}
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
port := os.Getenv("PORT")
storage_path := os.Getenv("STORAGE_PATH")
resolveFileStorePath(storage_path)
fmt.Printf("in the future I will listen on port: %s\n", port)
fmt.Printf("Reading files from: %s\n", storage_path)
}
+38
View File
@@ -0,0 +1,38 @@
package storage
import (
"io"
"os"
)
type LocalStorage struct {
BaseDir string
}
func (s *LocalStorage) UploadFile(dirPath string, filename string, data io.Reader) error {
//
}
func (s *LocalStorage) ListFiles(dirPath string) ([]FileNode, error) {
//
}
func (s *LocalStorage) ReadFile(filePath string) (*os.File, error) {
//
}
func (s *LocalStorage) WriteFile(dirPath string, filename string, data io.Reader) (int, error) {
// this is explicitly for writing text files that aren't being uploaded
}
func (s *LocalStorage) DeleteFile(filePath string) error {
//
}
func (s *LocalStorage) DeleteDirectory(dirPath string) error {
//
}
func (s *LocalStorage) DeleteDirectoryRecursive(dirPath string) error {
//
}
+23
View File
@@ -0,0 +1,23 @@
package storage
import (
"io"
"os"
)
type Storage interface {
UploadFile(dirPath string, filename string, data io.Reader) error
ListFiles(dirPath string) ([]FileNode, error)
ReadFile(filePath string) (*os.File, error)
WriteFile(dirPath string, filename string, data io.Reader) (int, error)
DeleteFile(filePath string) error
DeleteDirectory(dirPath string) error
DeleteDirectoryRecursive(dirPath string) error
}
type FileNode struct {
RelativeBasePath string
FileName string
IsDirectory bool
FileSize uint64
}