s3browser-backend/internal/types/types.go

48 lines
1012 B
Go

package types
import (
"time"
"github.com/golang-jwt/jwt"
)
// AppConfig general config
type AppConfig struct {
S3Endoint string
S3AccessKey string
S3SecretKey string
S3SSL bool
DSN string
CacheTTL time.Duration
CacheCleanup time.Duration
Address string
LogDebug bool
}
// File represents a file with its metadata
type File struct {
ID ID `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 ID `json:"id"`
Name string `json:"name"`
Files []File `json:"files"`
Directorys []Directory `json:"directorys"`
}
type JWTClaims struct {
jwt.StandardClaims
}
type LoginResult struct {
Token string `json:"token"`
Successful bool `json:"successful"`
}