Documentation
¶
Index ¶
Constants ¶
View Source
const ( PORT = 7777 ConfigDirName = ".beamdrop" // MaxUploadSize defines the maximum upload file size (100MB by default) MaxUploadSize int64 = 100 * 1024 * 1024 // 100MB in bytes )
Variables ¶
View Source
var ( VERSION = "0.0.1" Commit = "unknown" BuildDate = "unknown" )
Set via -ldflags at build time
View Source
var ( ConfigDir string ConfigPath string DBName = "beamdrop.db" DBPath string // AllowedMIMETypes defines the allowed MIME types for uploads // Empty list means all types are allowed AllowedMIMETypes = []string{ "image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml", "image/bmp", "application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "text/plain", "text/csv", "text/html", "text/css", "text/javascript", "application/zip", "application/x-rar-compressed", "application/x-7z-compressed", "application/x-tar", "application/gzip", "audio/mpeg", "audio/wav", "audio/ogg", "audio/mp4", "audio/webm", "audio/flac", "video/mp4", "video/mpeg", "video/webm", "video/ogg", "video/x-msvideo", "video/quicktime", "application/json", "application/xml", "application/javascript", "application/octet-stream", } )
View Source
var DefaultPorts = []int{7777, 8080, 8888, 9000, 9999, 3000, 4000, 5000, 6000, 8000}
DefaultPorts is a list of ports to try if the primary port is unavailable
Functions ¶
func CreateTrashBin ¶
CreateTrashBin creates the trash bin directory if it doesn't exist inside the sharedDir
func FindAvailablePort ¶
FindAvailablePort tries to find an available port from the default ports list
func IsPortAvailable ¶
IsPortAvailable checks if a port is available for use
Types ¶
type Flags ¶
type Flags struct {
NoQR bool
Port int
Help bool
Password string
TLSCert string
TLSKey string
AllowedOrigins string // Comma-separated list of allowed CORS origins
APIAuth bool // Enable API key authentication for S3-like API
LogLevel string // "debug", "info", "warn", "error" (default "info")
RateLimit int // General rate limit in requests/min (0 = disabled)
ShutdownTimeout time.Duration // Graceful shutdown timeout (default 30s)
DBPath string // Path to database file (default: <sharedDir>/.beamdrop/beamdrop.db)
}
Click to show internal directories.
Click to hide internal directories.