Documentation ¶
Index ¶
- func GetQueryShape(q string, ses query.HTTP) ([]byte, error)
- func LogRequest(handler ResponseHandler) httprouter.Handle
- func MarkdownWithCSS(input []byte, title string) []byte
- func ParseJSONToQuadList(jsonBody []byte) ([]quad.Quad, error)
- func Run(q string, ses query.HTTP) (interface{}, error)
- func Serve(handle *graph.Handle, cfg *config.Config)
- func SetupRoutes(handle *graph.Handle, cfg *config.Config)
- func WrapErrResult(err error) ([]byte, error)
- func WrapResult(result interface{}) ([]byte, error)
- type API
- func (api *API) APIv1(r *httprouter.Router)
- func (api *API) GetHandleForRequest(r *http.Request) (*graph.Handle, error)
- func (api *API) ServeV1Delete(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
- func (api *API) ServeV1Query(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
- func (api *API) ServeV1Shape(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
- func (api *API) ServeV1Write(w http.ResponseWriter, r *http.Request, _ httprouter.Params) int
- func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
- type DocRequestHandler
- type ErrorQueryWrapper
- type ResponseHandler
- type SuccessQueryWrapper
- type TemplateRequestHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogRequest ¶
func LogRequest(handler ResponseHandler) httprouter.Handle
func MarkdownWithCSS ¶
func ParseJSONToQuadList ¶ added in v0.4.1
func WrapErrResult ¶
func WrapResult ¶
Types ¶
type API ¶ added in v0.4.1
type API struct {
// contains filtered or unexported fields
}
func (*API) APIv1 ¶ added in v0.4.1
func (api *API) APIv1(r *httprouter.Router)
func (*API) GetHandleForRequest ¶ added in v0.4.1
func (*API) ServeV1Delete ¶ added in v0.4.1
func (api *API) ServeV1Delete(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
func (*API) ServeV1Query ¶ added in v0.4.1
func (api *API) ServeV1Query(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
TODO(barakmich): Turn this into proper middleware.
func (*API) ServeV1Shape ¶ added in v0.4.1
func (api *API) ServeV1Shape(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
func (*API) ServeV1Write ¶ added in v0.4.1
func (api *API) ServeV1Write(w http.ResponseWriter, r *http.Request, _ httprouter.Params) int
func (*API) ServeV1WriteNQuad ¶ added in v0.4.1
func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
type DocRequestHandler ¶
type DocRequestHandler struct {
// contains filtered or unexported fields
}
func (*DocRequestHandler) ServeHTTP ¶
func (h *DocRequestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, params httprouter.Params)
type ErrorQueryWrapper ¶
type ErrorQueryWrapper struct {
Error string `json:"error"`
}
type ResponseHandler ¶
type ResponseHandler func(http.ResponseWriter, *http.Request, httprouter.Params) int
type SuccessQueryWrapper ¶
type SuccessQueryWrapper struct {
Result interface{} `json:"result"`
}
type TemplateRequestHandler ¶
type TemplateRequestHandler struct {
// contains filtered or unexported fields
}
func (*TemplateRequestHandler) ServeHTTP ¶
func (h *TemplateRequestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, params httprouter.Params)
Click to show internal directories.
Click to hide internal directories.