cayleyhttp

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleForRequest

func HandleForRequest(h *graph.Handle, wtyp string, wopt graph.Options, r *http.Request) (*graph.Handle, error)

HandleForRequest returns new graph.Handle for given writer name, options and request

Types

type APIv2

type APIv2 struct {
	// contains filtered or unexported fields
}

APIv2 holds state and configuration of a request

func NewAPIv2

func NewAPIv2(h *graph.Handle, wrappers ...HandlerWrapper) *APIv2

NewAPIv2 creates a new instance of APIv2 with default options

func NewAPIv2Writer

func NewAPIv2Writer(h *graph.Handle, wtype string, wopts graph.Options, wrappers ...HandlerWrapper) *APIv2

NewAPIv2Writer creates a new instance of APIv2

func NewBoundAPIv2

func NewBoundAPIv2(h *graph.Handle, r *httprouter.Router) *APIv2

NewBoundAPIv2 creates a new instance of APIv2 bound to a given httprouter.Router

func (*APIv2) ServeDelete

func (api *APIv2) ServeDelete(w http.ResponseWriter, r *http.Request)

ServeDelete deletes data received in the request body from the database. Responds with how many quads were deleted.

func (*APIv2) ServeFormats

func (api *APIv2) ServeFormats(w http.ResponseWriter, r *http.Request)

ServeFormats responds with formats known for the database

func (*APIv2) ServeHTTP

func (api *APIv2) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

func (*APIv2) ServeNamespaceRules

func (api *APIv2) ServeNamespaceRules(w http.ResponseWriter, r *http.Request)

ServeNamespaceRules serves requests for the namespace rules resource. The resource supports getting all registered rules and registering a rule. The resource wraps the quad/voc module.

func (*APIv2) ServeNodeDelete

func (api *APIv2) ServeNodeDelete(w http.ResponseWriter, r *http.Request)

ServeNodeDelete deletes all data associated with a node (an entity). Responds with how many quads were deleted.

func (*APIv2) ServeQuery

func (api *APIv2) ServeQuery(w http.ResponseWriter, r *http.Request)

ServeQuery executes a query received in the request and responds with the result

func (*APIv2) ServeRead

func (api *APIv2) ServeRead(w http.ResponseWriter, r *http.Request)

ServeRead responds with quads read from the database

func (*APIv2) ServeWrite

func (api *APIv2) ServeWrite(w http.ResponseWriter, r *http.Request)

ServeWrite writes data received in the request body to the database

func (*APIv2) SetBatchSize

func (api *APIv2) SetBatchSize(n int)

SetBatchSize sets batch-size mode for the request

func (*APIv2) SetQueryLimit

func (api *APIv2) SetQueryLimit(n int)

SetQueryLimit sets query limit for the request

func (*APIv2) SetQueryTimeout

func (api *APIv2) SetQueryTimeout(dt time.Duration)

SetQueryTimeout sets query timeout for the request

func (*APIv2) SetReadOnly

func (api *APIv2) SetReadOnly(ro bool)

SetReadOnly sets read-only mode for the request

type AcceptSpec

type AcceptSpec struct {
	Value string
	Q     float64
}

AcceptSpec describes an Accept* header.

func ParseAccept

func ParseAccept(header http.Header, key string) (specs []AcceptSpec)

ParseAccept parses Accept* headers.

type HandlerWrapper

type HandlerWrapper func(http.Handler) http.Handler

HandlerWrapper accepts a handler, wraps it with additional functionality and returns a new handler

type NamespaceRule

type NamespaceRule struct {
	Prefix    string `json:"prefix"`
	Namespace string `json:"namespace"`
}

NamespaceRule defines a prefix for a namespace when prepended to the suffix of a compact IRI, results in an IRI. For example rdfs is a prefix for the namespace http://www.w3.org/2000/01/rdf-schema#.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL