Documentation ¶
Index ¶
- func CleanURLPath(targetUrl string) string
- func GetMimetypeFromPath(targetPath string) string
- func GetSharedPath(path1 string, path2 string) string
- func HandleConnection(s *Server, c net.Conn)
- func URLToSandboxPath(targetUrl string, sandbox Sandbox) (string, error)
- type Context
- func (ctx *Context) BadRequest(info string)
- func (ctx *Context) CGIError(info string)
- func (ctx *Context) CertNotAuthorized(info string)
- func (ctx *Context) CertNotValid(info string)
- func (ctx *Context) ClientCertRequired(info string)
- func (c *Context) GetQuery() string
- func (ctx *Context) Gone(info string)
- func (ctx *Context) Input(prompt string)
- func (ctx *Context) InputAndDo(prompt string, handler InputHandler)
- func (ctx *Context) NotFound(info string)
- func (ctx *Context) PermFailure(info string)
- func (ctx *Context) ProxyError(info string)
- func (ctx *Context) ProxyRequestRefused(info string)
- func (ctx *Context) RedirectPerm(url string)
- func (ctx *Context) RedirectTemp(url string)
- func (ctx *Context) SendBytes(mimeType string, content []byte)
- func (ctx *Context) SendFile(mimeType string, path string) error
- func (ctx *Context) SendString(mimeType string, str string)
- func (ctx *Context) SendStringf(mimeType string, str string, values ...interface{})
- func (ctx *Context) SensitiveInput(prompt string)
- func (ctx *Context) ServerUnavailable(info string)
- func (ctx *Context) SlowDown(waitSeconds int)
- func (ctx *Context) Success(mimeType string)
- func (ctx *Context) TempFail(info string)
- type InputHandler
- type Route
- type RouteHandler
- type Router
- type RouterOpts
- type Sandbox
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanURLPath ¶ added in v0.1.1
func GetMimetypeFromPath ¶
func GetSharedPath ¶
Get the common part of two paths.
func HandleConnection ¶
Types ¶
type Context ¶
func (*Context) BadRequest ¶
func (*Context) CertNotAuthorized ¶
func (*Context) CertNotValid ¶
func (*Context) ClientCertRequired ¶
func (*Context) InputAndDo ¶
func (ctx *Context) InputAndDo(prompt string, handler InputHandler)
func (*Context) PermFailure ¶
func (*Context) ProxyError ¶
func (*Context) ProxyRequestRefused ¶
func (*Context) RedirectPerm ¶
func (*Context) RedirectTemp ¶
func (*Context) SendString ¶
func (*Context) SendStringf ¶
func (*Context) SensitiveInput ¶
func (*Context) ServerUnavailable ¶
type InputHandler ¶
type Route ¶
type Route struct { Path string Handler RouteHandler }
type RouteHandler ¶
type RouteHandler func(Context)
type Router ¶
type Router struct { Routes []Route Sandboxes []Sandbox ErrorHandler RouteHandler }
func BlankRouter ¶
func BlankRouter() Router
func NewRouter ¶
func NewRouter(config RouterOpts) Router
func (*Router) AddRoute ¶
func (r *Router) AddRoute(targetPath string, handler RouteHandler)
func (*Router) AddSandbox ¶
func (*Router) GetRouteHandler ¶
func (r *Router) GetRouteHandler(targetPath string) RouteHandler
Get the handler for a given route. If no route matches a handler, then return the default error handler.
type RouterOpts ¶
type RouterOpts struct {
ErrorHandler RouteHandler
}
Click to show internal directories.
Click to hide internal directories.