Documentation ¶
Index ¶
- Constants
- func GenerateCommandRoutes(r *mux.Router) error
- func JsonpMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func LogMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func NewRouter(t *Trie) http.Handler
- func TagMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- type DelHandler
- type GetHandler
- type NewHandler
- type PathHandler
- type ResourceHandler
- type SetHandler
- type Trie
Constants ¶
View Source
const ( TagInfo = "_info" // describes the REST API usage TagHeaderName = "X-LIREST-TAG" // the HTTP tag used for the tag )
URL that starts with underscore are special tags tags supported: _info: describs the REST info for this url
Variables ¶
This section is empty.
Functions ¶
func GenerateCommandRoutes ¶
GenerateCommandRoutes produces routes based on commandRoutes
func JsonpMiddleware ¶
func JsonpMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
JsonpMiddleware wraps the json output with callback function name
func LogMiddleware ¶
func LogMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
LogMiddleware logs access
func TagMiddleware ¶
func TagMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
TagMiddleware handles the special tags
Types ¶
type PathHandler ¶
type PathHandler struct {
SubPath []string
}
PathHandler contains slice of next level subpath
func (*PathHandler) ServeHTTP ¶
func (h *PathHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP the HTTP handler
type ResourceHandler ¶
type ResourceHandler struct { Name string System describe.DescriptionSystem Api describe.DescriptionApi }
ResourceHandler Describe a resource handler
func (*ResourceHandler) ServeHTTP ¶
func (h *ResourceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP ResourceHandler's HTTP handler function
type SetHandler ¶
SetHandler responds to "PUT"
Click to show internal directories.
Click to hide internal directories.