Documentation ¶
Index ¶
Constants ¶
View Source
const Port = ":8080"
Variables ¶
This section is empty.
Functions ¶
func MachineIP ¶
func MachineIP() string
MachineIP returns the local (LAN) IP of the machine running the webserver
func RemoveSpaces ¶
RemoveSpaces efficiently trims spaces out of strings
func WriteHTTPMessage ¶
func WriteHTTPMessage(w http.ResponseWriter, code int, msg string)
WriteHTTPMessage sets the header and returns a message for the failure
Types ¶
type NeuteredFileSystem ¶
type NeuteredFileSystem struct {
FileSystem http.FileSystem
}
NeuteredFileSystem sets up a FileSystem to use with http.FilerServer
func (NeuteredFileSystem) Open ¶
func (nfs NeuteredFileSystem) Open(path string) (http.File, error)
Open satisfies the filesystem interface Directory/filesystem "neutering" technique from https://www.alexedwards.net/blog/disable-http-fileserver-directory-listings
type Uploader ¶
Uploader is our handle to the server instance
func NewUploader ¶
NewUploader returns an uploader object with a specific prefix to save files to
func (*Uploader) ReceiveHandler ¶
func (u *Uploader) ReceiveHandler(w http.ResponseWriter, r *http.Request)
ReceiveHandler takes a filepond upload POST and copies the file to the filesystem
Click to show internal directories.
Click to hide internal directories.