Documentation
¶
Overview ¶
Package gremlin is an in-process Apache TinkerPop Gremlin server over the shared openCypher property graph.
It speaks the Gremlin Server WebSocket protocol (GraphSON v2/v3 and GraphBinary v1) and the HTTP endpoint, and runs Gremlin scripts and bytecode against the same nodes and relationships as openCypher and Bolt.
Index ¶
Constants ¶
const ( CodeMalformedQuery = "MalformedQueryException" CodeInvalidParameter = "InvalidParameterException" CodeConstraintViolation = "ConstraintViolationException" CodeUnsupported = "UnsupportedOperationException" CodeTimeLimit = "TimeLimitExceededException" CodeCancelled = "CancelledByUserException" CodeInternal = "InternalFailureException" )
Neptune error codes returned by the HTTP endpoint; WebSocket clients get the Gremlin Server status instead.
const ( StatusSuccess = 200 StatusNoContent = 204 StatusPartial = 206 StatusInvalidRequest = 499 StatusServerError = 500 StatusScriptEvalError = 597 StatusServerTimeout = 598 StatusSerializationErr = 599 )
Gremlin Server response status codes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine runs Gremlin against an openCypher graph.
func NewEngine ¶
func NewEngine() *Engine
NewEngine returns an engine with every supported step registered.
type Error ¶
Error is a query failure carrying the Gremlin Server status and the Neptune error code.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map is an insertion-ordered map whose keys may be any value.
type Options ¶
type Options struct {
// Track registers a running query and returns its cancellable context and a finish callback.
Track func(parent context.Context, query string) (context.Context, func())
Timeout time.Duration
}
Options configures a Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves Gremlin over WebSocket and HTTP against one graph.
type Step ¶
type Step struct {
Name string
Args []any
Mods []Step
// Pre marks a modulator written before its step (until/emit before repeat).
Pre bool
}
Step is one step with its arguments and the modulators ("by", "from", modTimes, ...) that follow it.
type Traversal ¶
type Traversal struct {
Steps []Step
}
Traversal is a parsed Gremlin traversal: the steps after g (or inside an anonymous __).