Documentation
¶
Index ¶
- Constants
- func GetString(code int) string
- func HandleCustom(url string, cb func(w ResponseWriter, r *Request))
- func HandleStaticFile(url string, filename string, contentType string)
- func HandleTemplate(url string, tmpl *Template)
- func Init(portint int) error
- func RenderTemplate(w ResponseWriter, tmpl *Template) error
- func Serve()
- type Request
- type ResponseWriter
- type ServerError
- type Template
Constants ¶
View Source
const ( InternalServerError = 500 PathError = 402 FileError = 336 NotFoundError = 404 )
Variables ¶
This section is empty.
Functions ¶
func HandleCustom ¶
func HandleCustom(url string, cb func(w ResponseWriter, r *Request))
func HandleStaticFile ¶
func HandleTemplate ¶
func RenderTemplate ¶
func RenderTemplate(w ResponseWriter, tmpl *Template) error
Types ¶
type ResponseWriter ¶
type ResponseWriter = http.ResponseWriter
type ServerError ¶
func Error ¶
func Error(errNum int, msg string, w ResponseWriter) *ServerError
func (*ServerError) ToErr ¶
func (s *ServerError) ToErr() (err error)
Click to show internal directories.
Click to hide internal directories.