the big refactor

This commit is contained in:
2021-09-24 15:39:23 +02:00
parent a3e66cd351
commit ed932e3c92
13 changed files with 196 additions and 171 deletions

42
internal/types/types.go Normal file
View File

@@ -0,0 +1,42 @@
package types
import (
"time"
"github.com/golang-jwt/jwt"
)
// AppConfig general config
type AppConfig struct {
S3Endoint string
S3AccessKey string
S3SecretKey string
S3SSL bool
S3Bucket string
CacheTTL time.Duration
CacheCleanup time.Duration
Address string
LogDebug bool
}
// File represents a file with its metadata
type File struct {
ID string `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
ContentType string `json:"contentType"`
ETag string `json:"etag"`
LastModified time.Time `json:"lastModified"`
}
// Directory represents a directory with its metadata
type Directory struct {
ID string `json:"id"`
Name string `json:"name"`
Files []File `json:"files"`
Directorys []Directory `json:"directorys"`
}
type JWTClaims struct {
jwt.StandardClaims
}