Documentation ¶
Index ¶
- func FormatJson400(w http.ResponseWriter, err interface{}) int
- func FormatJsonError(w http.ResponseWriter, code int, err interface{}) int
- func GetQueryShape(query string, ses query.HttpSession) ([]byte, error)
- func LogRequest(handler ResponseHandler) httprouter.Handle
- func MarkdownWithCSS(input []byte, title string) []byte
- func ParseJsonToTripleList(jsonBody []byte) ([]*quad.Quad, error)
- func RunJsonQuery(query string, ses query.HttpSession) (interface{}, error)
- func Serve(ts graph.TripleStore, cfg *config.Config)
- func SetupRoutes(ts graph.TripleStore, 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) 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 FormatJson400 ¶
func FormatJson400(w http.ResponseWriter, err interface{}) int
func FormatJsonError ¶
func FormatJsonError(w http.ResponseWriter, code int, err interface{}) int
func GetQueryShape ¶
func GetQueryShape(query string, ses query.HttpSession) ([]byte, error)
func LogRequest ¶
func LogRequest(handler ResponseHandler) httprouter.Handle
func MarkdownWithCSS ¶
func RunJsonQuery ¶
func RunJsonQuery(query string, ses query.HttpSession) (interface{}, error)
func SetupRoutes ¶
func SetupRoutes(ts graph.TripleStore, cfg *config.Config)
func WrapErrResult ¶
func WrapResult ¶
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) ApiV1 ¶
func (api *Api) ApiV1(r *httprouter.Router)
func (*Api) ServeV1Delete ¶
func (api *Api) ServeV1Delete(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
func (*Api) ServeV1Query ¶
func (api *Api) ServeV1Query(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
TODO(barakmich): Turn this into proper middleware.
func (*Api) ServeV1Shape ¶
func (api *Api) ServeV1Shape(w http.ResponseWriter, r *http.Request, params httprouter.Params) int
func (*Api) ServeV1Write ¶
func (api *Api) ServeV1Write(w http.ResponseWriter, r *http.Request, _ httprouter.Params) int
func (*Api) ServeV1WriteNQuad ¶
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.