Documentation ¶
Index ¶
- func Error(err error, w http.ResponseWriter)
- type FileServer
- func (s *FileServer) DeleteFileHandler(w http.ResponseWriter, r *http.Request)
- func (s *FileServer) EnsureDir(fileName string) error
- func (s *FileServer) GetFileHandler(w http.ResponseWriter, r *http.Request)
- func (s *FileServer) PostFileHandler(w http.ResponseWriter, r *http.Request)
- func (s *FileServer) Serve()
- func (s *FileServer) SetupArgs(args argparse.Args)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(err error, w http.ResponseWriter)
ErrorHandler writes error content to the response and logs the error.
Types ¶
type FileServer ¶
type FileServer struct {
// contains filtered or unexported fields
}
FileServer is a struct that contains the necessary information to serve files.
var FileServerInstance FileServer
FileServerInstance is the main file server instance.
func (*FileServer) DeleteFileHandler ¶
func (s *FileServer) DeleteFileHandler(w http.ResponseWriter, r *http.Request)
DeleteFileHandler is a function that handles DELETE requests.
func (*FileServer) EnsureDir ¶
func (s *FileServer) EnsureDir(fileName string) error
func (*FileServer) GetFileHandler ¶
func (s *FileServer) GetFileHandler(w http.ResponseWriter, r *http.Request)
GetFileHandler is a function that handles GET requests.
func (*FileServer) PostFileHandler ¶
func (s *FileServer) PostFileHandler(w http.ResponseWriter, r *http.Request)
PostFileHandler is a function that handles POST requests.
func (*FileServer) Serve ¶
func (s *FileServer) Serve()
Serve is a function that starts the file server.
func (*FileServer) SetupArgs ¶
func (s *FileServer) SetupArgs(args argparse.Args)
SetupArgs is a function that sets up the arguments for the fileserver.
Click to show internal directories.
Click to hide internal directories.