Compare commits
12 Commits
af4ab7d655
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
7df6eb3bd5
|
|||
|
fc0629090e
|
|||
|
8f03b92bc4
|
|||
|
66fc781260
|
|||
|
a7eaa45869
|
|||
|
928a6024ad
|
|||
|
9b23688ee4
|
|||
|
3b5e133773
|
|||
|
96dd4949c2
|
|||
|
56fd10bccf
|
|||
|
3d61c4fc4b
|
|||
|
b6c4698fa9
|
@@ -1,5 +0,0 @@
|
|||||||
# HTTP Settings
|
|
||||||
PORT=8080
|
|
||||||
|
|
||||||
# App Settings
|
|
||||||
STORAGE_PATH=files
|
|
||||||
+3
-4
@@ -9,16 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- v1.1 German Translation
|
-
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Use frontmatter title & description in each language version template
|
-
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
- Trademark sign previously shown after the project description in version
|
-
|
||||||
0.3.0
|
|
||||||
|
|
||||||
## [0.0.0] - 2000-01-01
|
## [0.0.0] - 2000-01-01
|
||||||
|
|
||||||
|
|||||||
@@ -9,3 +9,6 @@ vet: fmt
|
|||||||
|
|
||||||
build: vet
|
build: vet
|
||||||
go build -o drogobox internal/app/main.go
|
go build -o drogobox internal/app/main.go
|
||||||
|
|
||||||
|
test:
|
||||||
|
go test ./tests/...
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
module drogobox.com/drogobox
|
|
||||||
|
|
||||||
go 1.25.9
|
|
||||||
|
|
||||||
require github.com/joho/godotenv v1.5.1 // indirect
|
|
||||||
@@ -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=
|
|
||||||
@@ -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)
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user