Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultServeMux = New()
DefaultServeMux is the default ServeMux.
Functions ¶
func Handle ¶
Handle registers the handler for the given pattern in the DefaultServeMux. The documentation for ServeMux explains how patterns are matched.
func NewStatusError ¶
Types ¶
type RestFunc ¶
RestFunc type is an adapter to allow the use of ordinary functions as REST middleware handlers. If f is a function with the appropriate signature, RestFunc(f) is a Handler object that calls f.
type ServeMux ¶
type ServeMux struct {
// contains filtered or unexported fields
}
func (*ServeMux) Handle ¶
Example ¶
package main import "golang.org/x/net/context" type HelloReq struct { Name string `rest:"name,path"` } func (h *HelloReq) Get(ctx context.Context) (interface{}, error) { return "Hello " + h.Name, nil } func main() { mux := New() mux.Handle("/:name", new(HelloReq)) }
Output:
type StatusError ¶
func (StatusError) Error ¶
func (h StatusError) Error() string
Click to show internal directories.
Click to hide internal directories.