s3browser-backend/internal/types/types.go

49 lines
1.0 KiB
Go
Raw Normal View History

2021-09-24 13:39:23 +00:00
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
2021-11-04 19:28:37 +00:00
DSN string
2021-09-24 13:39:23 +00:00
CacheTTL time.Duration
CacheCleanup time.Duration
Address string
LogDebug bool
}
// File represents a file with its metadata
type File struct {
ID ID `json:"id"`
2021-09-24 13:39:23 +00:00
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"`
2021-09-24 13:39:23 +00:00
Name string `json:"name"`
Files []File `json:"files"`
Directorys []Directory `json:"directorys"`
}
type JWTClaims struct {
jwt.StandardClaims
}
2021-09-24 13:54:03 +00:00
type LoginResult struct {
Token string `json:"token"`
Successful bool `json:"successful"`
}