Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FormFileKey = "file" OverwriteQueryKey = "overwrite" )
View Source
var (
DefaultAddr = "127.0.0.1:8080"
)
View Source
var (
ErrFileSizeLimitExceeded = fmt.Errorf("file size limit exceeded")
)
Functions ¶
func SHA256Strategy ¶
func UUIDStrategy ¶
Types ¶
type ErrorResult ¶
type FileNamingStrategy ¶
var DefaultNamingStrategy FileNamingStrategy = UUIDStrategy
func ResolveFileNamingStrategy ¶
func ResolveFileNamingStrategy(name string) FileNamingStrategy
type Server ¶
type Server struct { ServerConfig // contains filtered or unexported fields }
type ServerConfig ¶
type ServerConfig struct { // Address where the server listens on. Addr string `json:"addr"` // Path to the document root. DocumentRoot string `json:"document_root"` // Determines whether to enable CORS header. EnableCORS bool `json:"enable_cors"` // Maximum upload size in bytes. MaxUploadSize int64 `json:"max_upload_size"` // File naming strategy. FileNamingStrategy string `json:"file_naming_strategy"` // Graceful shutdown timeout in milliseconds. ShutdownTimeout int `json:"shutdown_timeout"` // Enable authentication. EnableAuth bool `json:"enable_auth"` // Authentication tokens for read-only access. ReadOnlyTokens []string `json:"read_only_tokens"` // Authentication tokens for read-write access. ReadWriteTokens []string `json:"read_write_tokens"` }
ServerConfig is a configuration for Server.
Click to show internal directories.
Click to hide internal directories.