Documentation ¶
Overview ¶
Package httpupload provides a HTTP handler for Caddy server, enabling file uploads using PUT HTTP method.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPUpload ¶
type HTTPUpload struct { UploadDir string `json:"upload_dir,omitempty"` RoutePrefix string `json:"route_prefix,omitempty"` }
HTTPUpload is a struct that defines the module for handling HTTP PUT requests for file uploads.
func (HTTPUpload) CaddyModule ¶
func (HTTPUpload) CaddyModule() caddy.ModuleInfo
CaddyModule provides the module information to Caddy. It creates a new HTTPUpload module.
func (HTTPUpload) Provision ¶
func (h HTTPUpload) Provision(ctx caddy.Context) error
func (HTTPUpload) ServeHTTP ¶
func (h HTTPUpload) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
ServeHTTP handles the HTTP requests. If it's a PUT request, it handles the upload process and writes the file to the defined upload directory. If the request method is not PUT, it simply calls the next handler in the chain.
func (*HTTPUpload) UnmarshalCaddyfile ¶
func (h *HTTPUpload) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile reads the Caddyfile configuration into the HTTPUpload struct.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
gocovmerge
gocovmerge takes the results from multiple `go test -coverprofile` runs and merges them into one profile
|
gocovmerge takes the results from multiple `go test -coverprofile` runs and merges them into one profile |
e2e_tests
|
|
Click to show internal directories.
Click to hide internal directories.