Documentation ¶
Overview ¶
Package web contains HTTP handlers methods. There are 2 URLs: "/" - GET index page "/upload" - POST save file and settings "/<hash>" - GET and POST get file
Index ¶
- Constants
- func Download(w io.Writer, r *http.Request, cfg *conf.Cfg) (int, error)
- func Error(w io.Writer, cfg *conf.Cfg, code int, msg string, tplName string) int
- func ErrorUploadShort(w io.Writer, cfg *conf.Cfg, code int, msg string) int
- func Index(w io.Writer, _ *http.Request, cfg *conf.Cfg) (int, error)
- func Upload(w io.Writer, r *http.Request, cfg *conf.Cfg) (int, error)
- func UploadShort(w io.Writer, r *http.Request, cfg *conf.Cfg) (int, error)
- type IndexData
Constants ¶
View Source
const ( // TTL is default TTL value. If it conflicts with custom configuration then minimum value will be used. TTL = 86400 // Times is default times value Times = 1 // PasswordLength is default password length in bytes for auto-generated ones. PasswordLength = 8 )
Variables ¶
This section is empty.
Functions ¶
func ErrorUploadShort ¶ added in v1.1.0
ErrorUploadShort sets error response. It returns http status code.
Types ¶
Click to show internal directories.
Click to hide internal directories.