gremlingo

package
v3.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjacentToIncidentStrategy

func AdjacentToIncidentStrategy() *traversalStrategy

AdjacentToIncidentStrategy looks for Vertex- and value-emitting steps followed by a CountGlobalStep and replaces the pattern with an Edge- or Property-emitting step followed by a CountGlobalStep. Furthermore, if a vertex- or value-emitting step is the last step in a .Has(traversal), .And(traversal, ...) or .Or(traversal, ...) child traversal, it is replaced by an appropriate Edge- or Property-emitting step. Performing this replacement removes situations where the more expensive trip to an adjacent Graph Element (e.g. the Vertex on the other side of an Edge) can be satisfied by trips to incident Graph Elements (e.g. just the Edge itself).

func ByModulatorOptimizationStrategy

func ByModulatorOptimizationStrategy() *traversalStrategy

ByModulatorOptimizationStrategy looks for standard traversals in By-modulators and replaces them with more optimized traversals (e.g. TokenTraversal) if possible.

func ConnectiveStrategy

func ConnectiveStrategy() *traversalStrategy

ConnectiveStrategy rewrites the binary conjunction form of a.And().b into a AndStep of And(a,b) (likewise for OrStep).

func CountStrategy

func CountStrategy() *traversalStrategy

CountStrategy optimizes any occurrence of CountGlobalStep followed by an IsStep The idea is to limit the number of incoming elements in a way that it's enough for the IsStep to decide whether it evaluates true or false. If the traversal already contains a user supplied limit, the strategy won't modify it.

func EarlyLimitStrategy

func EarlyLimitStrategy() *traversalStrategy

EarlyLimitStrategy looks for RangeGlobalSteps that can be moved further left in the traversal and thus be applied earlier. It will also try to merge multiple RangeGlobalSteps into one. If the logical consequence of one or multiple RangeGlobalSteps is an empty result, the strategy will remove as many steps as possible and add a NoneStep instead.

func EdgeLabelVerificationStrategy

func EdgeLabelVerificationStrategy(logWarning, throwException bool) *traversalStrategy

EdgeLabelVerificationStrategy does not allow Edge traversal steps to have no label specified. Providing one or more labels is considered to be a best practice, however, TinkerPop will not force the specification of Edge labels; instead, providers or users will have to enable this strategy explicitly.

func ElementIdStrategy

func ElementIdStrategy() *traversalStrategy

ElementIdStrategy provides a degree of control over element identifier assignment as some Graphs don't provide that feature. This strategy provides for identifier assignment by enabling users to utilize Vertex and Edge indices under the hood, thus simulating that capability. By default, when an identifier is not supplied by the user, newly generated identifiers are UUID objects.

func FilterRankingStrategy

func FilterRankingStrategy() *traversalStrategy

FilterRankingStrategy reorders filter- and order-steps according to their rank. Step ranks are defined within the strategy and indicate when it is reasonable for a step to move in front of another. It will also do its best to push step labels as far "right" as possible in order to keep Traversers as small and bulkable as possible prior to the absolute need for Path-labeling.

func HaltedTraverserStrategy

func HaltedTraverserStrategy(haltedTraverserFactoryName string) *traversalStrategy

func IdentityRemovalStrategy

func IdentityRemovalStrategy() *traversalStrategy

IdentityRemovalStrategy looks for IdentityStep instances and removes them. If the identity step is labeled, its labels are added to the previous step. If the identity step is labeled and it's the first step in the traversal, it stays.

func IncidentToAdjacentStrategy

func IncidentToAdjacentStrategy() *traversalStrategy

IncidentToAdjacentStrategy looks for .OutE().InV(), .InE().OutV() and .BothE().OtherV() and replaces these step sequences with .Out(), .In() or .Both() respectively. The strategy won't modify the traversal if:

the Edge step is labeled
the traversal contains a Path step
the traversal contains a Lambda step

func InlineFilterStrategy

func InlineFilterStrategy() *traversalStrategy

InlineFilterStrategy analyzes filter-steps with child traversals that themselves are pure filters. If the child traversals are pure filters then the wrapping parent filter is not needed and thus, the children can be "inlined". Normalizing pure filters with inlining reduces the number of variations of a filter that a graph provider may need to reason about when writing their own strategies. As a result, this strategy helps increase the likelihood that a provider's filtering optimization will succeed at re-writing the traversal.

func LambdaRestrictionStrategy

func LambdaRestrictionStrategy() *traversalStrategy

LambdaRestrictionStrategy does not allow lambdas to be used in a Traversal. The contents of a lambda cannot be analyzed/optimized and thus, reduces the ability of other TraversalStrategy instances to reason about the traversal. This strategy is not activated by default. However, graph system providers may choose to make this a default strategy in order to ensure their respective strategies are better able to operate.

func LazyBarrierStrategy

func LazyBarrierStrategy() *traversalStrategy

LazyBarrierStrategy is an OLTP-only strategy that automatically inserts a NoOpBarrierStep after every FlatMapStep if neither Path-tracking nor partial Path-tracking is required, and the next step is not the traversal's last step or a Barrier. NoOpBarrierSteps allow Traversers to be bulked, thus this strategy is meant to reduce memory requirements and improve the overall query performance.

func MatchAlgorithmStrategy

func MatchAlgorithmStrategy(matchAlgorithm string) *traversalStrategy

func MatchPredicateStrategy

func MatchPredicateStrategy() *traversalStrategy

MatchPredicateStrategy will fold any post-Where() step that maintains a traversal constraint into Match(). MatchStep is intelligent with traversal constraint applications and thus, can more efficiently use the constraint of WhereTraversalStep or WherePredicateStep.

func OptionsStrategy

func OptionsStrategy(options map[string]interface{}) *traversalStrategy

OptionsStrategy will not alter the Traversal. It is only a holder for configuration options associated with the Traversal meant to be accessed by steps or other classes that might have some interaction with it. It is essentially a way for users to provide Traversal level configuration options that can be used in various ways by different Graph providers.

func OrderLimitStrategy

func OrderLimitStrategy() *traversalStrategy

OrderLimitStrategy is an OLAP strategy that folds a RangeGlobalStep into a preceding OrderGlobalStep. This helps to eliminate traversers early in the traversal and can significantly reduce the amount of memory required by the OLAP execution engine.

func PartitionStrategy

func PartitionStrategy(partitionKey, writePartition string, readPartitions []string, includeMetaProperties bool) *traversalStrategy

PartitionStrategy partitions the Vertices, Edges and Vertex properties of a Graph into String named partitions (i.e. buckets, subgraphs, etc.). It blinds a Traversal from "seeing" specified areas of the graph. The Traversal will ignore all Graph elements not in those "read" partitions.

func PathProcessorStrategy

func PathProcessorStrategy() *traversalStrategy

PathProcessorStrategy is an OLAP strategy that does its best to turn non-local children in Where() and Select() into local children by inlining components of the non-local child. In this way, PathProcessorStrategy helps to ensure that more traversals meet the local child constraint imposed on OLAP traversals.

func PathRetractionStrategy

func PathRetractionStrategy() *traversalStrategy

PathRetractionStrategy will remove Paths from the Traversers and increase the likelihood of bulking as Path data is not required after Select('b').

func ProductiveByStrategy

func ProductiveByStrategy(productiveKeys []string) *traversalStrategy

ProductiveByStrategy takes an argument of by() and wraps it CoalesceStep so that the result is either the initial Traversal argument or null. In this way, the By() is always "productive". This strategy is an "optimization" but it is perhaps more of a "decoration", but it should follow ByModulatorOptimizationStrategy which features optimizations relevant to this one.

func ReadOnlyStrategy

func ReadOnlyStrategy() *traversalStrategy

ReadOnlyStrategy detects steps marked with Mutating and returns an error if one is found.

func RemoteStrategy

func RemoteStrategy(connection DriverRemoteConnection) *traversalStrategy

func RepeatUnrollStrategy

func RepeatUnrollStrategy() *traversalStrategy

RepeatUnrollStrategy is an OLTP-only strategy that unrolls any RepeatStep if it uses a constant number of loops (Times(x)) and doesn't emit intermittent elements. If any of the following 3 steps appears within the Repeat-traversal, the strategy will not be applied:

DedupGlobalStep
LoopsStep
LambdaHolder

func ReservedKeysVerificationStrategy

func ReservedKeysVerificationStrategy(logWarning, throwException bool, keys []string) *traversalStrategy

ReservedKeysVerificationStrategy detects property keys that should not be used by the traversal. A term may be reserved by a particular graph implementation or as a convention given best practices.

func SeedStrategy

func SeedStrategy(seed int64) *traversalStrategy

SeedStrategy resets the specified Seed value for Seedable steps, which in turn will produce deterministic results from those steps. It is important to note that when using this strategy that it only guarantees deterministic results from a step but not from an entire Traversal. For example, if a Graph does no guarantee iteration order for g.V() then repeated runs of g.V().Coin(0.5) with this strategy will return the same number of results but not necessarily the same ones. The same problem can occur in OLAP-based Taversals where iteration order is not explicitly guaranteed. The only way to ensure completely deterministic results in that sense is to apply some form of order() in these cases.

func SubgraphStrategy

func SubgraphStrategy(vertices, edges, vertexProperties interface{}) *traversalStrategy

SubgraphStrategy provides a way to limit the view of a Traversal. By providing Traversal representations that represent a form of filtering criterion for Vertices and/or Edges, this strategy will inject that criterion into the appropriate places of a Traversal thus restricting what it Traverses and returns.

func VertexProgramStrategy

func VertexProgramStrategy(graphComputer, persist, result string, workers int,
	vertices, edges interface{}, configuration map[string]interface{}) *traversalStrategy

Types

type AnonymousTraversal

type AnonymousTraversal interface {
	// T__ creates an empty GraphTraversal.
	T__(args ...interface{}) *GraphTraversal
	// V adds the v step to the GraphTraversal.
	V(args ...interface{}) *GraphTraversal
	// AddE adds the addE step to the GraphTraversal.
	AddE(args ...interface{}) *GraphTraversal
	// AddV adds the addV step to the GraphTraversal.
	AddV(args ...interface{}) *GraphTraversal
	// Aggregate adds the aggregate step to the GraphTraversal.
	Aggregate(args ...interface{}) *GraphTraversal
	// And adds the and step to the GraphTraversal.
	And(args ...interface{}) *GraphTraversal
	// As adds the as step to the GraphTraversal.
	As(args ...interface{}) *GraphTraversal
	// Barrier adds the barrier step to the GraphTraversal.
	Barrier(args ...interface{}) *GraphTraversal
	// Both adds the both step to the GraphTraversal.
	Both(args ...interface{}) *GraphTraversal
	// BothE adds the bothE step to the GraphTraversal.
	BothE(args ...interface{}) *GraphTraversal
	// BothV adds the bothV step to the GraphTraversal.
	BothV(args ...interface{}) *GraphTraversal
	// Branch adds the branch step to the GraphTraversal.
	Branch(args ...interface{}) *GraphTraversal
	// By adds the by step to the GraphTraversal.
	By(args ...interface{}) *GraphTraversal
	// Cap adds the cap step to the GraphTraversal.
	Cap(args ...interface{}) *GraphTraversal
	// Choose adds the choose step to the GraphTraversal.
	Choose(args ...interface{}) *GraphTraversal
	// Coalesce adds the coalesce step to the GraphTraversal.
	Coalesce(args ...interface{}) *GraphTraversal
	// Coin adds the coin step to the GraphTraversal.
	Coin(args ...interface{}) *GraphTraversal
	// ConnectedComponent adds the connectedComponent step to the GraphTraversal.
	ConnectedComponent(args ...interface{}) *GraphTraversal
	// Constant adds the constant step to the GraphTraversal.
	Constant(args ...interface{}) *GraphTraversal
	// Count adds the count step to the GraphTraversal.
	Count(args ...interface{}) *GraphTraversal
	// CyclicPath adds the cyclicPath step to the GraphTraversal.
	CyclicPath(args ...interface{}) *GraphTraversal
	// Dedup adds the dedup step to the GraphTraversal.
	Dedup(args ...interface{}) *GraphTraversal
	// Drop adds the drop step to the GraphTraversal.
	Drop(args ...interface{}) *GraphTraversal
	// ElementMap adds the elementMap step to the GraphTraversal.
	ElementMap(args ...interface{}) *GraphTraversal
	// Emit adds the emit step to the GraphTraversal.
	Emit(args ...interface{}) *GraphTraversal
	// Filter adds the filter step to the GraphTraversal.
	Filter(args ...interface{}) *GraphTraversal
	// FlatMap adds the flatMap step to the GraphTraversal.
	FlatMap(args ...interface{}) *GraphTraversal
	// Fold adds the fold step to the GraphTraversal.
	Fold(args ...interface{}) *GraphTraversal
	// From adds the from step to the GraphTraversal.
	From(args ...interface{}) *GraphTraversal
	// Group adds the group step to the GraphTraversal.
	Group(args ...interface{}) *GraphTraversal
	// GroupCount adds the groupCount step to the GraphTraversal.
	GroupCount(args ...interface{}) *GraphTraversal
	// Has adds the has step to the GraphTraversal.
	Has(args ...interface{}) *GraphTraversal
	// HasId adds the hasId step to the GraphTraversal.
	HasId(args ...interface{}) *GraphTraversal
	// HasKey adds the hasKey step to the GraphTraversal.
	HasKey(args ...interface{}) *GraphTraversal
	// HasLabel adds the hasLabel step to the GraphTraversal.
	HasLabel(args ...interface{}) *GraphTraversal
	// HasNot adds the hasNot step to the GraphTraversal.
	HasNot(args ...interface{}) *GraphTraversal
	// HasValue adds the hasValue step to the GraphTraversal.
	HasValue(args ...interface{}) *GraphTraversal
	// Id adds the id step to the GraphTraversal.
	Id(args ...interface{}) *GraphTraversal
	// Identity adds the identity step to the GraphTraversal.
	Identity(args ...interface{}) *GraphTraversal
	// InE adds the inE step to the GraphTraversal.
	InE(args ...interface{}) *GraphTraversal
	// InV adds the inV step to the GraphTraversal.
	InV(args ...interface{}) *GraphTraversal
	// In adds the in step to the GraphTraversal.
	In(args ...interface{}) *GraphTraversal
	// Index adds the index step to the GraphTraversal.
	Index(args ...interface{}) *GraphTraversal
	// Inject adds the inject step to the GraphTraversal.
	Inject(args ...interface{}) *GraphTraversal
	// Is adds the is step to the GraphTraversal.
	Is(args ...interface{}) *GraphTraversal
	// Key adds the key step to the GraphTraversal.
	Key(args ...interface{}) *GraphTraversal
	// Label adds the label step to the GraphTraversal.
	Label(args ...interface{}) *GraphTraversal
	// Limit adds the limit step to the GraphTraversal.
	Limit(args ...interface{}) *GraphTraversal
	// Local adds the local step to the GraphTraversal.
	Local(args ...interface{}) *GraphTraversal
	// Loops adds the loops step to the GraphTraversal.
	Loops(args ...interface{}) *GraphTraversal
	// Map adds the map step to the GraphTraversal.
	Map(args ...interface{}) *GraphTraversal
	// Match adds the match step to the GraphTraversal.
	Match(args ...interface{}) *GraphTraversal
	// Math adds the math step to the GraphTraversal.
	Math(args ...interface{}) *GraphTraversal
	// Max adds the max step to the GraphTraversal.
	Max(args ...interface{}) *GraphTraversal
	// Mean adds the mean step to the GraphTraversal.
	Mean(args ...interface{}) *GraphTraversal
	// Min adds the min step to the GraphTraversal.
	Min(args ...interface{}) *GraphTraversal
	// None adds the none step to the GraphTraversal.
	None(args ...interface{}) *GraphTraversal
	// Not adds the not step to the GraphTraversal.
	Not(args ...interface{}) *GraphTraversal
	// Option adds the option step to the GraphTraversal.
	Option(args ...interface{}) *GraphTraversal
	// Optional adds the optional step to the GraphTraversal.
	Optional(args ...interface{}) *GraphTraversal
	// Or adds the or step to the GraphTraversal.
	Or(args ...interface{}) *GraphTraversal
	// Order adds the order step to the GraphTraversal.
	Order(args ...interface{}) *GraphTraversal
	// OtherV adds the otherV step to the GraphTraversal.
	OtherV(args ...interface{}) *GraphTraversal
	// Out adds the out step to the GraphTraversal.
	Out(args ...interface{}) *GraphTraversal
	// OutE adds the outE step to the GraphTraversal.
	OutE(args ...interface{}) *GraphTraversal
	// OutV adds the outV step to the GraphTraversal.
	OutV(args ...interface{}) *GraphTraversal
	// PageRank adds the pageRank step to the GraphTraversal.
	PageRank(args ...interface{}) *GraphTraversal
	// Path adds the path step to the GraphTraversal.
	Path(args ...interface{}) *GraphTraversal
	// PeerPressure adds the peerPressure step to the GraphTraversal.
	PeerPressure(args ...interface{}) *GraphTraversal
	// Profile adds the profile step to the GraphTraversal.
	Profile(args ...interface{}) *GraphTraversal
	// Program adds the program step to the GraphTraversal.
	Program(args ...interface{}) *GraphTraversal
	// Project adds the project step to the GraphTraversal.
	Project(args ...interface{}) *GraphTraversal
	// Properties adds the properties step to the GraphTraversal.
	Properties(args ...interface{}) *GraphTraversal
	// Property adds the property step to the GraphTraversal.
	Property(args ...interface{}) *GraphTraversal
	// PropertyMap adds the propertyMap step to the GraphTraversal.
	PropertyMap(args ...interface{}) *GraphTraversal
	// Range adds the range step to the GraphTraversal.
	Range(args ...interface{}) *GraphTraversal
	// Read adds the read step to the GraphTraversal.
	Read(args ...interface{}) *GraphTraversal
	// Repeat adds the repeat step to the GraphTraversal.
	Repeat(args ...interface{}) *GraphTraversal
	// Sack adds the sack step to the GraphTraversal.
	Sack(args ...interface{}) *GraphTraversal
	// Sample adds the sample step to the GraphTraversal.
	Sample(args ...interface{}) *GraphTraversal
	// Select adds the select step to the GraphTraversal.
	Select(args ...interface{}) *GraphTraversal
	// ShortestPath adds the shortestPath step to the GraphTraversal.
	ShortestPath(args ...interface{}) *GraphTraversal
	// SideEffect adds the sideEffect step to the GraphTraversal.
	SideEffect(args ...interface{}) *GraphTraversal
	// SimplePath adds the simplePath step to the GraphTraversal.
	SimplePath(args ...interface{}) *GraphTraversal
	// Skip adds the skip step to the GraphTraversal.
	Skip(args ...interface{}) *GraphTraversal
	// Store adds the store step to the GraphTraversal.
	Store(args ...interface{}) *GraphTraversal
	// Subgraph adds the subgraph step to the GraphTraversal.
	Subgraph(args ...interface{}) *GraphTraversal
	// Sum adds the sum step to the GraphTraversal.
	Sum(args ...interface{}) *GraphTraversal
	// Tail adds the tail step to the GraphTraversal.
	Tail(args ...interface{}) *GraphTraversal
	// TimeLimit adds the timeLimit step to the GraphTraversal.
	TimeLimit(args ...interface{}) *GraphTraversal
	// Times adds the times step to the GraphTraversal.
	Times(args ...interface{}) *GraphTraversal
	// To adds the to step to the GraphTraversal.
	To(args ...interface{}) *GraphTraversal
	// ToE adds the toE step to the GraphTraversal.
	ToE(args ...interface{}) *GraphTraversal
	// ToV adds the toV step to the GraphTraversal.
	ToV(args ...interface{}) *GraphTraversal
	// Tree adds the tree step to the GraphTraversal.
	Tree(args ...interface{}) *GraphTraversal
	// Unfold adds the unfold step to the GraphTraversal.
	Unfold(args ...interface{}) *GraphTraversal
	// Union adds the union step to the GraphTraversal.
	Union(args ...interface{}) *GraphTraversal
	// Until adds the until step to the GraphTraversal.
	Until(args ...interface{}) *GraphTraversal
	// Value adds the value step to the GraphTraversal.
	Value(args ...interface{}) *GraphTraversal
	// ValueMap adds the valueMap step to the GraphTraversal.
	ValueMap(args ...interface{}) *GraphTraversal
	// Values adds the values step to the GraphTraversal.
	Values(args ...interface{}) *GraphTraversal
	// Where adds the where step to the GraphTraversal.
	Where(args ...interface{}) *GraphTraversal
	// With adds the with step to the GraphTraversal.
	With(args ...interface{}) *GraphTraversal
	// Write adds the write step to the GraphTraversal.
	Write(args ...interface{}) *GraphTraversal
}

AnonymousTraversal interface for anonymous traversals.

var T__ AnonymousTraversal = &anonymousTraversal{
	func() *GraphTraversal {
		return NewGraphTraversal(nil, nil, newBytecode(nil), nil)
	},
}

type AnonymousTraversalSource

type AnonymousTraversalSource interface {
	// WithRemote used to set the DriverRemoteConnection within the AnonymousTraversalSource
	WithRemote(drc *DriverRemoteConnection) *GraphTraversalSource
}

AnonymousTraversalSource interface for generating anonymous traversals.

func Traversal_

func Traversal_() AnonymousTraversalSource

Traversal_ gets an AnonymousTraversalSource.

type AuthInfo

type AuthInfo struct {
	Header   http.Header
	Username string
	Password string
}

AuthInfo is an option struct that allows authentication information to be specified. Authentication can be provided via http.Header Header directly. Basic authentication can also be used via the BasicAuthInfo function.

func BasicAuthInfo

func BasicAuthInfo(username string, password string) *AuthInfo

BasicAuthInfo provides a way to generate AuthInfo. Enter username and password and get the AuthInfo back.

func HeaderAuthInfo

func HeaderAuthInfo(header http.Header) *AuthInfo

HeaderAuthInfo provides a way to generate AuthInfo with only Header information.

type Barrier

type Barrier string

Barrier is any step that requires all left traversers to be processed prior to emitting result traversers to the right.

const (
	NormSack Barrier = "normSack"
)

type Binding

type Binding struct {
	Key   string
	Value interface{}
}

Binding associates a string variable with a value

func (*Binding) String

func (b *Binding) String() string

String returns the key value binding in string format

type Bindings

type Bindings struct{}

Bindings are used to associate a variable with a value. They enable the creation of Binding, usually used with Lambda scripts to avoid continued recompilation costs. Bindings allow a remote engine to cache traversals that will be reused over and over again save that some parameterization may change. Used as g.V().Out(&Bindings{}.Of("key", value))

func (*Bindings) Of

func (*Bindings) Of(key string, value interface{}) *Binding

Of creates a Binding

type Cardinality

type Cardinality string

Cardinality of Vertex Properties.

const (
	Single Cardinality = "single"
	List   Cardinality = "list"
	Set_   Cardinality = "set"
)

type Client

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

Client is used to connect and interact with a Gremlin-supported server.

func NewClient

func NewClient(url string, configurations ...func(settings *ClientSettings)) (*Client, error)

NewClient creates a Client and configures it with the given parameters. During creation of the Client, a connection is created, which establishes a websocket. Important note: to avoid leaking a connection, always close the Client.

func (*Client) Close

func (client *Client) Close()

Close closes the client via connection. This is idempotent due to the underlying close() methods being idempotent as well.

func (*Client) Submit

func (client *Client) Submit(traversalString string, bindings ...map[string]interface{}) (ResultSet, error)

Submit submits a Gremlin script to the server and returns a ResultSet.

type ClientSettings

type ClientSettings struct {
	TraversalSource   string
	TransporterType   TransporterType
	LogVerbosity      LogVerbosity
	Logger            Logger
	Language          language.Tag
	AuthInfo          *AuthInfo
	TlsConfig         *tls.Config
	KeepAliveInterval time.Duration
	WriteDeadline     time.Duration
	// Minimum amount of concurrent active traversals on a connection to trigger creation of a new connection
	NewConnectionThreshold int
	// Maximum number of concurrent connections. Default: number of runtime processors
	MaximumConcurrentConnections int
	Session                      string
}

ClientSettings is used to modify a Client's settings on initialization.

type Column

type Column string

Column references a particular type of column in a complex data structure.

const (
	// Keys associated with the data structure.
	Keys Column = "keys"
	// Values associated with the data structure.
	Values Column = "values"
)

type DataType

type DataType uint8

DataType graphBinary types.

const (
	IntType               DataType = 0x01
	LongType              DataType = 0x02
	StringType            DataType = 0x03
	DateType              DataType = 0x04
	TimestampType         DataType = 0x05
	DoubleType            DataType = 0x07
	FloatType             DataType = 0x08
	ListType              DataType = 0x09
	MapType               DataType = 0x0a
	SetType               DataType = 0x0b
	UUIDType              DataType = 0x0c
	EdgeType              DataType = 0x0d
	PathType              DataType = 0x0e
	PropertyType          DataType = 0x0f
	VertexType            DataType = 0x11
	VertexPropertyType    DataType = 0x12
	BarrierType           DataType = 0x13
	BindingType           DataType = 0x14
	CardinalityType       DataType = 0x16
	BytecodeType          DataType = 0x15
	ColumnType            DataType = 0x17
	DirectionType         DataType = 0x18
	OperatorType          DataType = 0x19
	OrderType             DataType = 0x1a
	PickType              DataType = 0x1b
	PopType               DataType = 0x1c
	LambdaType            DataType = 0x1d
	PType                 DataType = 0x1e
	ScopeType             DataType = 0x1f
	TType                 DataType = 0x20
	TraverserType         DataType = 0x21
	BigIntegerType        DataType = 0x23
	ByteType              DataType = 0x24
	ShortType             DataType = 0x26
	BooleanType           DataType = 0x27
	TextPType             DataType = 0x28
	TraversalStrategyType DataType = 0x29
	BulkSetType           DataType = 0x2a
	DurationType          DataType = 0x81
	NullType              DataType = 0xFE
)

DataType defined as constants.

type Direction

type Direction string

Direction is used to denote the direction of an Edge or location of a Vertex on an Edge.

const (
	// In refers to an incoming direction.
	In Direction = "IN"
	// Out refers to an outgoing direction.
	Out Direction = "OUT"
	// Both refers to either direction In or Out.
	Both Direction = "BOTH"
)

type DriverRemoteConnection

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

DriverRemoteConnection is a remote connection.

func NewDriverRemoteConnection

func NewDriverRemoteConnection(
	url string,
	configurations ...func(settings *DriverRemoteConnectionSettings)) (*DriverRemoteConnection, error)

NewDriverRemoteConnection creates a new DriverRemoteConnection. If no custom connection settings are passed in, a connection will be created with "g" as the default TraversalSource, Gorilla as the default Transporter, Info as the default LogVerbosity, a default logger stuct, and English and as the default language

func (*DriverRemoteConnection) Close

func (driver *DriverRemoteConnection) Close()

Close closes the DriverRemoteConnection. Errors if any will be logged

func (*DriverRemoteConnection) CreateSession

func (driver *DriverRemoteConnection) CreateSession(sessionId ...string) (*DriverRemoteConnection, error)

CreateSession generates a new Session. sessionId stores the optional UUID param. It can be used to create a Session with a specific UUID.

func (*DriverRemoteConnection) GetSessionId

func (driver *DriverRemoteConnection) GetSessionId() string

func (*DriverRemoteConnection) Submit

func (driver *DriverRemoteConnection) Submit(traversalString string) (ResultSet, error)

Submit sends a string traversal to the server.

type DriverRemoteConnectionSettings

type DriverRemoteConnectionSettings struct {
	TraversalSource   string
	TransporterType   TransporterType
	LogVerbosity      LogVerbosity
	Logger            Logger
	Language          language.Tag
	AuthInfo          *AuthInfo
	TlsConfig         *tls.Config
	KeepAliveInterval time.Duration
	WriteDeadline     time.Duration
	// Minimum amount of concurrent active traversals on a connection to trigger creation of a new connection
	NewConnectionThreshold int
	// Maximum number of concurrent connections. Default: number of runtime processors
	MaximumConcurrentConnections int
	Session                      string

	// TODO: Figure out exact extent of configurability for these and expose appropriate types/helpers
	Protocol   protocol
	Serializer serializer
}

DriverRemoteConnectionSettings are used to configure the DriverRemoteConnection.

type Edge

type Edge struct {
	Element
	OutV Vertex
	InV  Vertex
}

Edge links two Vertex structs along with its Property Objects. An edge has both a direction and a Label.

func (*Edge) String

func (e *Edge) String() string

String returns the string representation of the edge.

type Element

type Element struct {
	Id    interface{}
	Label string
}

Element is the base structure for both Vertex and Edge. The inherited identifier must be unique to the inheriting classes.

type Graph

type Graph struct {
}

Graph is used to store the graph.

type GraphTraversal

type GraphTraversal struct {
	*Traversal
}

GraphTraversal stores a Traversal.

func NewGraphTraversal

func NewGraphTraversal(graph *Graph, traversalStrategies *TraversalStrategies, bytecode *bytecode, remote *DriverRemoteConnection) *GraphTraversal

NewGraphTraversal make a new GraphTraversal.

func (*GraphTraversal) AddE

func (g *GraphTraversal) AddE(args ...interface{}) *GraphTraversal

AddE adds the addE step to the GraphTraversal.

func (*GraphTraversal) AddV

func (g *GraphTraversal) AddV(args ...interface{}) *GraphTraversal

AddV adds the addV step to the GraphTraversal.

func (*GraphTraversal) Aggregate

func (g *GraphTraversal) Aggregate(args ...interface{}) *GraphTraversal

Aggregate adds the aggregate step to the GraphTraversal.

func (*GraphTraversal) And

func (g *GraphTraversal) And(args ...interface{}) *GraphTraversal

And adds the and step to the GraphTraversal.

func (*GraphTraversal) As

func (g *GraphTraversal) As(args ...interface{}) *GraphTraversal

As adds the as step to the GraphTraversal.

func (*GraphTraversal) Barrier

func (g *GraphTraversal) Barrier(args ...interface{}) *GraphTraversal

Barrier adds the barrier step to the GraphTraversal.

func (*GraphTraversal) Both

func (g *GraphTraversal) Both(args ...interface{}) *GraphTraversal

Both adds the both step to the GraphTraversal.

func (*GraphTraversal) BothE

func (g *GraphTraversal) BothE(args ...interface{}) *GraphTraversal

BothE adds the bothE step to the GraphTraversal.

func (*GraphTraversal) BothV

func (g *GraphTraversal) BothV(args ...interface{}) *GraphTraversal

BothV adds the bothV step to the GraphTraversal.

func (*GraphTraversal) Branch

func (g *GraphTraversal) Branch(args ...interface{}) *GraphTraversal

Branch adds the branch step to the GraphTraversal.

func (*GraphTraversal) By

func (g *GraphTraversal) By(args ...interface{}) *GraphTraversal

By adds the by step to the GraphTraversal.

func (*GraphTraversal) Cap

func (g *GraphTraversal) Cap(args ...interface{}) *GraphTraversal

Cap adds the cap step to the GraphTraversal.

func (*GraphTraversal) Choose

func (g *GraphTraversal) Choose(args ...interface{}) *GraphTraversal

Choose adds the choose step to the GraphTraversal.

func (*GraphTraversal) Clone

func (g *GraphTraversal) Clone() *GraphTraversal

Clone make a copy of a traversal that is reset for iteration.

func (*GraphTraversal) Coalesce

func (g *GraphTraversal) Coalesce(args ...interface{}) *GraphTraversal

Coalesce adds the coalesce step to the GraphTraversal.

func (*GraphTraversal) Coin

func (g *GraphTraversal) Coin(args ...interface{}) *GraphTraversal

Coin adds the coint step to the GraphTraversal.

func (*GraphTraversal) ConnectedComponent

func (g *GraphTraversal) ConnectedComponent(args ...interface{}) *GraphTraversal

ConnectedComponent adds the connectedComponent step to the GraphTraversal.

func (*GraphTraversal) Constant

func (g *GraphTraversal) Constant(args ...interface{}) *GraphTraversal

Constant adds the constant step to the GraphTraversal.

func (*GraphTraversal) Count

func (g *GraphTraversal) Count(args ...interface{}) *GraphTraversal

Count adds the count step to the GraphTraversal.

func (*GraphTraversal) CyclicPath

func (g *GraphTraversal) CyclicPath(args ...interface{}) *GraphTraversal

CyclicPath adds the cyclicPath step to the GraphTraversal.

func (*GraphTraversal) Dedup

func (g *GraphTraversal) Dedup(args ...interface{}) *GraphTraversal

Dedup adds the dedup step to the GraphTraversal.

func (*GraphTraversal) Drop

func (g *GraphTraversal) Drop(args ...interface{}) *GraphTraversal

Drop adds the drop step to the GraphTraversal.

func (*GraphTraversal) ElementMap

func (g *GraphTraversal) ElementMap(args ...interface{}) *GraphTraversal

ElementMap adds the elementMap step to the GraphTraversal.

func (*GraphTraversal) Emit

func (g *GraphTraversal) Emit(args ...interface{}) *GraphTraversal

Emit adds the emit step to the GraphTraversal.

func (*GraphTraversal) Filter

func (g *GraphTraversal) Filter(args ...interface{}) *GraphTraversal

Filter adds the filter step to the GraphTraversal.

func (*GraphTraversal) FlatMap

func (g *GraphTraversal) FlatMap(args ...interface{}) *GraphTraversal

FlatMap adds the flatMap step to the GraphTraversal.

func (*GraphTraversal) Fold

func (g *GraphTraversal) Fold(args ...interface{}) *GraphTraversal

Fold adds the fold step to the GraphTraversal.

func (*GraphTraversal) From

func (g *GraphTraversal) From(args ...interface{}) *GraphTraversal

From adds the from step to the GraphTraversal.

func (*GraphTraversal) Group

func (g *GraphTraversal) Group(args ...interface{}) *GraphTraversal

Group adds the group step to the GraphTraversal.

func (*GraphTraversal) GroupCount

func (g *GraphTraversal) GroupCount(args ...interface{}) *GraphTraversal

GroupCount adds the groupCount step to the GraphTraversal.

func (*GraphTraversal) Has

func (g *GraphTraversal) Has(args ...interface{}) *GraphTraversal

Has adds the has step to the GraphTraversal.

func (*GraphTraversal) HasId

func (g *GraphTraversal) HasId(args ...interface{}) *GraphTraversal

HasId adds the hasId step to the GraphTraversal.

func (*GraphTraversal) HasKey

func (g *GraphTraversal) HasKey(args ...interface{}) *GraphTraversal

HasKey adds the hasKey step to the GraphTraversal.

func (*GraphTraversal) HasLabel

func (g *GraphTraversal) HasLabel(args ...interface{}) *GraphTraversal

HasLabel adds the hasLabel step to the GraphTraversal.

func (*GraphTraversal) HasNot

func (g *GraphTraversal) HasNot(args ...interface{}) *GraphTraversal

HasNot adds the hasNot step to the GraphTraversal.

func (*GraphTraversal) HasValue

func (g *GraphTraversal) HasValue(args ...interface{}) *GraphTraversal

HasValue adds the hasValue step to the GraphTraversal.

func (*GraphTraversal) Id

func (g *GraphTraversal) Id(args ...interface{}) *GraphTraversal

Id adds the id step to the GraphTraversal.

func (*GraphTraversal) Identity

func (g *GraphTraversal) Identity(args ...interface{}) *GraphTraversal

Identity adds the identity step to the GraphTraversal.

func (*GraphTraversal) In

func (g *GraphTraversal) In(args ...interface{}) *GraphTraversal

In adds the in step to the GraphTraversal.

func (*GraphTraversal) InE

func (g *GraphTraversal) InE(args ...interface{}) *GraphTraversal

InE adds the inE step to the GraphTraversal.

func (*GraphTraversal) InV

func (g *GraphTraversal) InV(args ...interface{}) *GraphTraversal

InV adds the inV step to the GraphTraversal.

func (*GraphTraversal) Index

func (g *GraphTraversal) Index(args ...interface{}) *GraphTraversal

Index adds the index step to the GraphTraversal.

func (*GraphTraversal) Inject

func (g *GraphTraversal) Inject(args ...interface{}) *GraphTraversal

Inject adds the inject step to the GraphTraversal.

func (*GraphTraversal) Is

func (g *GraphTraversal) Is(args ...interface{}) *GraphTraversal

Is adds the is step to the GraphTraversal.

func (*GraphTraversal) Key

func (g *GraphTraversal) Key(args ...interface{}) *GraphTraversal

Key adds the key step to the GraphTraversal.

func (*GraphTraversal) Label

func (g *GraphTraversal) Label(args ...interface{}) *GraphTraversal

Label adds the label step to the GraphTraversal.

func (*GraphTraversal) Limit

func (g *GraphTraversal) Limit(args ...interface{}) *GraphTraversal

Limit adds the limit step to the GraphTraversal.

func (*GraphTraversal) Local

func (g *GraphTraversal) Local(args ...interface{}) *GraphTraversal

Local adds the local step to the GraphTraversal.

func (*GraphTraversal) Loops

func (g *GraphTraversal) Loops(args ...interface{}) *GraphTraversal

Loops adds the loops step to the GraphTraversal.

func (*GraphTraversal) Map

func (g *GraphTraversal) Map(args ...interface{}) *GraphTraversal

Map adds the map step to the GraphTraversal.

func (*GraphTraversal) Match

func (g *GraphTraversal) Match(args ...interface{}) *GraphTraversal

Match adds the match step to the GraphTraversal.

func (*GraphTraversal) Math

func (g *GraphTraversal) Math(args ...interface{}) *GraphTraversal

Math adds the math step to the GraphTraversal.

func (*GraphTraversal) Max

func (g *GraphTraversal) Max(args ...interface{}) *GraphTraversal

Max adds the max step to the GraphTraversal.

func (*GraphTraversal) Mean

func (g *GraphTraversal) Mean(args ...interface{}) *GraphTraversal

Mean adds the mean step to the GraphTraversal.

func (*GraphTraversal) Min

func (g *GraphTraversal) Min(args ...interface{}) *GraphTraversal

Min adds the min step to the GraphTraversal.

func (*GraphTraversal) None

func (g *GraphTraversal) None(args ...interface{}) *GraphTraversal

None adds the none step to the GraphTraversal.

func (*GraphTraversal) Not

func (g *GraphTraversal) Not(args ...interface{}) *GraphTraversal

Not adds the not step to the GraphTraversal.

func (*GraphTraversal) Option

func (g *GraphTraversal) Option(args ...interface{}) *GraphTraversal

Option adds the option step to the GraphTraversal.

func (*GraphTraversal) Optional

func (g *GraphTraversal) Optional(args ...interface{}) *GraphTraversal

Optional adds the optional step to the GraphTraversal.

func (*GraphTraversal) Or

func (g *GraphTraversal) Or(args ...interface{}) *GraphTraversal

Or adds the or step to the GraphTraversal.

func (*GraphTraversal) Order

func (g *GraphTraversal) Order(args ...interface{}) *GraphTraversal

Order adds the order step to the GraphTraversal.

func (*GraphTraversal) OtherV

func (g *GraphTraversal) OtherV(args ...interface{}) *GraphTraversal

OtherV adds the otherV step to the GraphTraversal.

func (*GraphTraversal) Out

func (g *GraphTraversal) Out(args ...interface{}) *GraphTraversal

Out adds the out step to the GraphTraversal.

func (*GraphTraversal) OutE

func (g *GraphTraversal) OutE(args ...interface{}) *GraphTraversal

OutE adds the outE step to the GraphTraversal.

func (*GraphTraversal) OutV

func (g *GraphTraversal) OutV(args ...interface{}) *GraphTraversal

OutV adds the outV step to the GraphTraversal.

func (*GraphTraversal) PageRank

func (g *GraphTraversal) PageRank(args ...interface{}) *GraphTraversal

PageRank adds the pageRank step to the GraphTraversal.

func (*GraphTraversal) Path

func (g *GraphTraversal) Path(args ...interface{}) *GraphTraversal

Path adds the path step to the GraphTraversal.

func (*GraphTraversal) PeerPressure

func (g *GraphTraversal) PeerPressure(args ...interface{}) *GraphTraversal

PeerPressure adds the peerPressure step to the GraphTraversal.

func (*GraphTraversal) Profile

func (g *GraphTraversal) Profile(args ...interface{}) *GraphTraversal

Profile adds the profile step to the GraphTraversal.

func (*GraphTraversal) Program

func (g *GraphTraversal) Program(args ...interface{}) *GraphTraversal

Program adds the program step to the GraphTraversal.

func (*GraphTraversal) Project

func (g *GraphTraversal) Project(args ...interface{}) *GraphTraversal

Project adds the project step to the GraphTraversal.

func (*GraphTraversal) Properties

func (g *GraphTraversal) Properties(args ...interface{}) *GraphTraversal

Properties adds the properties step to the GraphTraversal.

func (*GraphTraversal) Property

func (g *GraphTraversal) Property(args ...interface{}) *GraphTraversal

Property adds the property step to the GraphTraversal.

func (*GraphTraversal) PropertyMap

func (g *GraphTraversal) PropertyMap(args ...interface{}) *GraphTraversal

PropertyMap adds the propertyMap step to the GraphTraversal.

func (*GraphTraversal) Range

func (g *GraphTraversal) Range(args ...interface{}) *GraphTraversal

Range adds the range step to the GraphTraversal.

func (*GraphTraversal) Read

func (g *GraphTraversal) Read(args ...interface{}) *GraphTraversal

Read adds the read step to the GraphTraversal.

func (*GraphTraversal) Repeat

func (g *GraphTraversal) Repeat(args ...interface{}) *GraphTraversal

Repeat adds the repeat step to the GraphTraversal.

func (*GraphTraversal) Sack

func (g *GraphTraversal) Sack(args ...interface{}) *GraphTraversal

Sack adds the sack step to the GraphTraversal.

func (*GraphTraversal) Sample

func (g *GraphTraversal) Sample(args ...interface{}) *GraphTraversal

Sample adds the sample step to the GraphTraversal.

func (*GraphTraversal) Select

func (g *GraphTraversal) Select(args ...interface{}) *GraphTraversal

Select adds the select step to the GraphTraversal.

func (*GraphTraversal) ShortestPath

func (g *GraphTraversal) ShortestPath(args ...interface{}) *GraphTraversal

ShortestPath adds the shortestPath step to the GraphTraversal.

func (*GraphTraversal) SideEffect

func (g *GraphTraversal) SideEffect(args ...interface{}) *GraphTraversal

SideEffect adds the sideEffect step to the GraphTraversal.

func (*GraphTraversal) SimplePath

func (g *GraphTraversal) SimplePath(args ...interface{}) *GraphTraversal

SimplePath adds the simplePath step to the GraphTraversal.

func (*GraphTraversal) Skip

func (g *GraphTraversal) Skip(args ...interface{}) *GraphTraversal

Skip adds the skip step to the GraphTraversal.

func (*GraphTraversal) Store

func (g *GraphTraversal) Store(args ...interface{}) *GraphTraversal

Store adds the store step to the GraphTraversal.

func (*GraphTraversal) Subgraph

func (g *GraphTraversal) Subgraph(args ...interface{}) *GraphTraversal

Subgraph adds the subgraph step to the GraphTraversal.

func (*GraphTraversal) Sum

func (g *GraphTraversal) Sum(args ...interface{}) *GraphTraversal

Sum adds the sum step to the GraphTraversal.

func (*GraphTraversal) Tail

func (g *GraphTraversal) Tail(args ...interface{}) *GraphTraversal

Tail adds the tail step to the GraphTraversal.

func (*GraphTraversal) TimeLimit

func (g *GraphTraversal) TimeLimit(args ...interface{}) *GraphTraversal

TimeLimit adds the timeLimit step to the GraphTraversal.

func (*GraphTraversal) Times

func (g *GraphTraversal) Times(args ...interface{}) *GraphTraversal

Times adds the times step to the GraphTraversal.

func (*GraphTraversal) To

func (g *GraphTraversal) To(args ...interface{}) *GraphTraversal

To adds the to step to the GraphTraversal.

func (*GraphTraversal) ToE

func (g *GraphTraversal) ToE(args ...interface{}) *GraphTraversal

ToE adds the toE step to the GraphTraversal.

func (*GraphTraversal) ToV

func (g *GraphTraversal) ToV(args ...interface{}) *GraphTraversal

ToV adds the toV step to the GraphTraversal.

func (*GraphTraversal) Tree

func (g *GraphTraversal) Tree(args ...interface{}) *GraphTraversal

Tree adds the tree step to the GraphTraversal.

func (*GraphTraversal) Unfold

func (g *GraphTraversal) Unfold(args ...interface{}) *GraphTraversal

Unfold adds the unfold step to the GraphTraversal.

func (*GraphTraversal) Union

func (g *GraphTraversal) Union(args ...interface{}) *GraphTraversal

Union adds the union step to the GraphTraversal.

func (*GraphTraversal) Until

func (g *GraphTraversal) Until(args ...interface{}) *GraphTraversal

Until adds the until step to the GraphTraversal.

func (*GraphTraversal) V

func (g *GraphTraversal) V(args ...interface{}) *GraphTraversal

V adds the v step to the GraphTraversal.

func (*GraphTraversal) Value

func (g *GraphTraversal) Value(args ...interface{}) *GraphTraversal

Value adds the value step to the GraphTraversal.

func (*GraphTraversal) ValueMap

func (g *GraphTraversal) ValueMap(args ...interface{}) *GraphTraversal

ValueMap adds the valueMap step to the GraphTraversal.

func (*GraphTraversal) Values

func (g *GraphTraversal) Values(args ...interface{}) *GraphTraversal

Values adds the values step to the GraphTraversal.

func (*GraphTraversal) Where

func (g *GraphTraversal) Where(args ...interface{}) *GraphTraversal

Where adds the where step to the GraphTraversal.

func (*GraphTraversal) With

func (g *GraphTraversal) With(args ...interface{}) *GraphTraversal

With adds the with step to the GraphTraversal.

func (*GraphTraversal) Write

func (g *GraphTraversal) Write(args ...interface{}) *GraphTraversal

Write adds the write step to the GraphTraversal.

type GraphTraversalSource

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

GraphTraversalSource can be used to start GraphTraversal.

func NewDefaultGraphTraversalSource

func NewDefaultGraphTraversalSource() *GraphTraversalSource

NewDefaultGraphTraversalSource creates a new graph GraphTraversalSource without a graph, strategy, or existing traversal.

func NewGraphTraversalSource

func NewGraphTraversalSource(graph *Graph, traversalStrategies *TraversalStrategies, bytecode *bytecode, remoteConnection *DriverRemoteConnection) *GraphTraversalSource

NewGraphTraversalSource creates a graph traversal source, the primary DSL of the Gremlin traversal machine.

func (*GraphTraversalSource) AddE

func (gts *GraphTraversalSource) AddE(args ...interface{}) *GraphTraversal

AddE adds an Edge to start the traversal.

func (*GraphTraversalSource) AddV

func (gts *GraphTraversalSource) AddV(args ...interface{}) *GraphTraversal

AddV adds a Vertex to start the traversal.

func (*GraphTraversalSource) E

func (gts *GraphTraversalSource) E(args ...interface{}) *GraphTraversal

E reads edges from the graph to start the traversal.

func (*GraphTraversalSource) GetBytecode

func (gts *GraphTraversalSource) GetBytecode() *bytecode

GetBytecode gets the traversal bytecode associated with this graph traversal source.

func (*GraphTraversalSource) GetGraphTraversal

func (gts *GraphTraversalSource) GetGraphTraversal() *GraphTraversal

GetGraphTraversal gets the graph traversal associated with this graph traversal source.

func (*GraphTraversalSource) GetTraversalStrategies

func (gts *GraphTraversalSource) GetTraversalStrategies() *TraversalStrategies

GetTraversalStrategies gets the graph traversal strategies associated with this graph traversal source.

func (*GraphTraversalSource) Inject

func (gts *GraphTraversalSource) Inject(args ...interface{}) *GraphTraversal

Inject inserts arbitrary objects to start the traversal.

func (*GraphTraversalSource) Io

func (gts *GraphTraversalSource) Io(args ...interface{}) *GraphTraversal

Io adds the io steps to start the traversal.

func (*GraphTraversalSource) Tx

func (gts *GraphTraversalSource) Tx() *Transaction

func (*GraphTraversalSource) V

func (gts *GraphTraversalSource) V(args ...interface{}) *GraphTraversal

V reads vertices from the graph to start the traversal.

func (*GraphTraversalSource) With

func (gts *GraphTraversalSource) With(key interface{}, value interface{}) *GraphTraversalSource

With provides a configuration to a traversal in the form of a key value pair.

func (*GraphTraversalSource) WithBulk

func (gts *GraphTraversalSource) WithBulk(args ...interface{}) *GraphTraversalSource

WithBulk allows for control of bulking operations.

func (*GraphTraversalSource) WithPath

func (gts *GraphTraversalSource) WithPath(args ...interface{}) *GraphTraversalSource

WithPath adds a path to be used throughout the life of a spawned Traversal.

func (*GraphTraversalSource) WithRemote

func (gts *GraphTraversalSource) WithRemote(remoteConnection *DriverRemoteConnection) *GraphTraversalSource

WithRemote adds a remote to be used throughout the life of a spawned Traversal.

func (*GraphTraversalSource) WithSack

func (gts *GraphTraversalSource) WithSack(args ...interface{}) *GraphTraversalSource

WithSack adds a sack to be used throughout the life of a spawned Traversal.

func (*GraphTraversalSource) WithSideEffect

func (gts *GraphTraversalSource) WithSideEffect(args ...interface{}) *GraphTraversalSource

WithSideEffect adds a side effect to be used throughout the life of a spawned Traversal.

func (*GraphTraversalSource) WithStrategies

func (gts *GraphTraversalSource) WithStrategies(args ...interface{}) *GraphTraversalSource

WithStrategies adds an arbitrary collection of TraversalStrategies instances to the traversal source.

func (*GraphTraversalSource) WithoutStrategies

func (gts *GraphTraversalSource) WithoutStrategies(args ...interface{}) *GraphTraversalSource

WithoutStrategies removes an arbitrary collection of TraversalStrategies instances to the traversal source.

type Lambda

type Lambda struct {
	Script   string
	Language string
}

type LogVerbosity

type LogVerbosity int

LogVerbosity is an alias for valid logging verbosity levels.

const (
	// Debug verbosity will log everything, including fine details.
	Debug LogVerbosity = iota + 1
	// Info verbosity will log messages up to standard procedure flow.
	Info
	// Warning verbosity will log messages up to warnings.
	Warning
	// Error verbosity level log only error messages.
	Error
	// Off verbosity level disables logging.
	Off
)

type Logger

type Logger interface {
	Log(verbosity LogVerbosity, v ...interface{})
	Logf(verbosity LogVerbosity, format string, v ...interface{})
}

Logger is the interface required to be implemented for use with gremlingo.

type Operator

type Operator string

Operator is a set of operations for traversal steps.

const (
	// Sum is an addition.
	Sum Operator = "sum"
	// Minus is a subtraction.
	Minus Operator = "minus"
	// Mult is a multiplication.
	Mult Operator = "mult"
	// Div is a division.
	Div Operator = "div"
	// Min selects the smaller of the values.
	Min Operator = "min"
	// Max selects the larger of the values.
	Max Operator = "max"
	// Assign returns the second value to the function.
	Assign Operator = "assign"
	// And applies "and" to boolean values.
	And Operator = "and"
	// Or applies "or" to boolean values.
	Or Operator = "or"
	// AddAll Takes all objects in the second Slice and adds them to the first. If the first is null,
	// then the second Slice is returned and if the second is null then the first is returned.
	// If both are null then null is returned. Arguments must be of type Map or Slice.
	AddAll Operator = "addAll"
	// SumLong sums and adds long values.
	SumLong Operator = "sumLong"
)

type Order

type Order string

Order provides comparator instances for ordering traversers.

const (
	// Shuffle is Order in a random fashion.
	Shuffle Order = "shuffle"
	// Asc is Order in ascending fashion.
	Asc Order = "asc"
	// Desc is Order in descending fashion.
	Desc Order = "desc"
)

type Path

type Path struct {
	Labels  []Set
	Objects []interface{}
}

Path denotes a particular walk through a Graph as defined by a traversal. A list of Labels and a list of Objects is maintained in the path. The list of Labels are the Labels of the steps traversed, and the Objects are the Objects that are traversed.

func (*Path) GetPathObject

func (p *Path) GetPathObject(key string) (interface{}, error)

GetPathObject returns the Value that corresponds to the Key for the Path and error if the Value is not present or cannot be retrieved.

func (*Path) String

func (p *Path) String() string

String returns the string representation of the path.

type Pick

type Pick string
const (
	Any  Pick = "any"
	None Pick = "none"
)

type Pop

type Pop string

Pop is used to determine whether the first value, last value, or all values are gathered.

const (
	// First is the first item in an ordered collection.
	First Pop = "first"
	// Last is the last item in an ordered collection.
	Last Pop = "last"
	// All the items in an ordered collection.
	All Pop = "all"
	// Mixed is either a list (for multiple) or an object (for singles).
	Mixed Pop = "mixed"
)

type Predicate

type Predicate interface {
	// Between Predicate to determine if value is within (inclusive) the range of two specified values.
	Between(args ...interface{}) Predicate
	// Eq Predicate to determine if equal to.
	Eq(args ...interface{}) Predicate
	// Gt Predicate to determine if greater than.
	Gt(args ...interface{}) Predicate
	// Gte Predicate to determine if greater than or equal to.
	Gte(args ...interface{}) Predicate
	// Inside Predicate to determine if value is within range of specified values (exclusive).
	Inside(args ...interface{}) Predicate
	// Lt Predicate to determine if less than.
	Lt(args ...interface{}) Predicate
	// Lte Predicate to determine if less than or equal to.
	Lte(args ...interface{}) Predicate
	// Neq Predicate to determine if not equal to.
	Neq(args ...interface{}) Predicate
	// Not Predicate gives the opposite of the specified Predicate.
	Not(args ...interface{}) Predicate
	// Outside Predicate to determine of value is not within range of specified values (exclusive).
	Outside(args ...interface{}) Predicate
	// Test evaluates Predicate on given argument.
	Test(args ...interface{}) Predicate
	// Within Predicate determines if value is within given list of values.
	Within(args ...interface{}) Predicate
	// Without Predicate determines if value is not within the specified.
	Without(args ...interface{}) Predicate
	// And Predicate returns a Predicate composed of two predicates (logical AND of them).
	And(args ...interface{}) Predicate
	// Or Predicate returns a Predicate composed of two predicates (logical OR of them).
	Or(args ...interface{}) Predicate
}

Predicate interface.

var P Predicate = &p{}

type Property

type Property struct {
	Key     string
	Value   interface{}
	Element Element
}

Property denotes a Key/Value pair associated with an Edge. A property can be empty.

func (*Property) String

func (p *Property) String() string

String returns the string representation of the property.

type Result

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

Result Struct to abstract the Result and provide functions to use it.

func (*Result) GetBool

func (r *Result) GetBool() (bool, error)

GetBool gets the result by coercing it into a boolean, else returns an error if not parsable.

func (*Result) GetByte

func (r *Result) GetByte() (byte, error)

GetByte gets the result by coercing it into a byte (uint8), else returns an error if not parsable.

func (*Result) GetEdge

func (r *Result) GetEdge() (*Edge, error)

GetEdge returns the result if it is an edge, otherwise returns an error.

func (*Result) GetElement

func (r *Result) GetElement() (*Element, error)

GetElement returns the result if it is an Element, otherwise returns an error.

func (*Result) GetFloat32

func (r *Result) GetFloat32() (float32, error)

GetFloat32 gets the result by coercing it into a float32, else returns an error if not parsable.

func (*Result) GetFloat64

func (r *Result) GetFloat64() (float64, error)

GetFloat64 gets the result by coercing it into a float64, else returns an error if not parsable.

func (*Result) GetInt

func (r *Result) GetInt() (int, error)

GetInt gets the result by coercing it into an int, else returns an error if not parsable.

func (*Result) GetInt16

func (r *Result) GetInt16() (int16, error)

GetInt16 gets the result by coercing it into an int16, else returns an error if not parsable.

func (*Result) GetInt32

func (r *Result) GetInt32() (int32, error)

GetInt32 gets the result by coercing it into a rune(int32), else returns an error if not parsable.

func (*Result) GetInt64

func (r *Result) GetInt64() (int64, error)

GetInt64 gets the result by coercing it into an int64, else returns an error if not parsable.

func (*Result) GetInt8

func (r *Result) GetInt8() (int8, error)

GetInt8 gets the result by coercing it into an int16, else returns an error if not parsable.

func (*Result) GetInterface

func (r *Result) GetInterface() interface{}

GetInterface returns the result item.

func (*Result) GetPath

func (r *Result) GetPath() (*Path, error)

GetPath returns the result if it is a path, otherwise returns an error.

func (*Result) GetProperty

func (r *Result) GetProperty() (*Property, error)

GetProperty returns the result if it is a property, otherwise returns an error.

func (*Result) GetSlice

func (r *Result) GetSlice() (*[]interface{}, error)

GetSlice returns the Result if it is a Slice, otherwise returns an error.

func (*Result) GetString

func (r *Result) GetString() string

GetString gets the string representation of the result.

func (*Result) GetTraverser

func (r *Result) GetTraverser() (*Traverser, error)

GetTraverser returns the Result if it is a Traverser, otherwise returns an error.

func (*Result) GetType

func (r *Result) GetType() reflect.Type

GetType returns the type of the result.

func (*Result) GetUint

func (r *Result) GetUint() (uint, error)

GetUint gets the result by coercing it into an int, else returns an error if not parsable.

func (*Result) GetUint16

func (r *Result) GetUint16() (uint16, error)

GetUint16 gets the result by coercing it into an int16, else returns an error if not parsable.

func (*Result) GetUint32

func (r *Result) GetUint32() (uint32, error)

GetUint32 gets the result by coercing it into a rune(int32), else returns an error if not parsable.

func (*Result) GetUint64

func (r *Result) GetUint64() (uint64, error)

GetUint64 gets the result by coercing it into an int64, else returns an error if not parsable.

func (*Result) GetVertex

func (r *Result) GetVertex() (*Vertex, error)

GetVertex returns the result if it is a Vertex, otherwise returns an error.

func (*Result) GetVertexProperty

func (r *Result) GetVertexProperty() (*VertexProperty, error)

GetVertexProperty returns the result if it is a Vertex property, otherwise returns an error.

func (*Result) IsNil

func (r *Result) IsNil() bool

IsNil checks if the result is null.

func (*Result) String

func (r *Result) String() string

String returns the string representation of the Result struct in Go-syntax format.

type ResultSet

type ResultSet interface {
	GetAggregateTo() string

	GetStatusAttributes() map[string]interface{}
	GetRequestID() string
	IsEmpty() bool
	Close()
	Channel() chan *Result

	All() ([]*Result, error)
	GetError() error
	// contains filtered or unexported methods
}

ResultSet interface to define the functions of a ResultSet.

type Scope

type Scope string

Scope is used in many Step instance can have a variable scope which alter the manner in which the step will behave in relation to how the traversers are processed.

const (
	// Global informs the step to operate on the entire traversal.
	Global Scope = "global"
	// Local informs the step to operate on the current object in the step.
	Local Scope = "local"
)

type Set

type Set interface {
	// ToSlice is the only method that needs to be implemented in order for a custom Set to operate properly.
	// ToSlice must return a slice that contains all the elements of the underlying Set with no duplicates.
	ToSlice() []interface{}
}

Set describes the necessary methods that need to be implemented for Gremlin-Go to recognize for use as a Gremlin Set.

type SimpleSet

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

SimpleSet is a basic implementation of a Set for use with Gremlin-Go.

func NewSimpleSet

func NewSimpleSet(args ...interface{}) *SimpleSet

NewSimpleSet creates a new SimpleSet containing all passed in args with duplicates excluded according to Golang equality operator rules.

func (*SimpleSet) Add

func (s *SimpleSet) Add(val interface{})

Add adds an item to the SimpleSet only if it is not already a part of it.

func (*SimpleSet) Contains

func (s *SimpleSet) Contains(val interface{}) bool

Contains checks if a value is contained in the SimpleSet or not. Items are considered already contained in the set according to Golang equality operator rules.

func (*SimpleSet) Remove

func (s *SimpleSet) Remove(val interface{})

Remove removes a value from the SimpleSet if it is in the set according to Golang equality operator rules.

func (*SimpleSet) ToSlice

func (s *SimpleSet) ToSlice() []interface{}

ToSlice must return a slice that contains all the elements of the underlying Set with no duplicates.

type T

type T string

T is string symbols.

const (
	Id    T = "id"
	Label T = "label"
	Id_   T = "id_"
	Key   T = "key"
	Value T = "value"
)

type TextPredicate

type TextPredicate interface {
	// Containing TextPredicate determines if a string contains a given value.
	Containing(args ...interface{}) TextPredicate
	// EndingWith TextPredicate determines if a string ends with a given value.
	EndingWith(args ...interface{}) TextPredicate
	// NotContaining TextPredicate determines if a string does not contain a given value.
	NotContaining(args ...interface{}) TextPredicate
	// NotEndingWith TextPredicate determines if a string does not end with a given value.
	NotEndingWith(args ...interface{}) TextPredicate
	// NotStartingWith TextPredicate determines if a string does not start with a given value.
	NotStartingWith(args ...interface{}) TextPredicate
	// StartingWith TextPredicate determines if a string starts with a given value.
	StartingWith(args ...interface{}) TextPredicate
	// And TextPredicate returns a TextPredicate composed of two predicates (logical AND of them).
	And(args ...interface{}) TextPredicate
	// Or TextPredicate returns a TextPredicate composed of two predicates (logical OR of them).
	Or(args ...interface{}) TextPredicate
}
var TextP TextPredicate = &textP{}

type Transaction

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

func (*Transaction) Begin

func (t *Transaction) Begin() (*GraphTraversalSource, error)

func (*Transaction) Close

func (t *Transaction) Close() error

func (*Transaction) Commit

func (t *Transaction) Commit() error

func (*Transaction) IsOpen

func (t *Transaction) IsOpen() bool

func (*Transaction) Rollback

func (t *Transaction) Rollback() error

type TransporterType

type TransporterType int

TransporterType is an alias for valid transport protocols.

const (
	// Gorilla transport layer: github.com/gorilla/websocket
	Gorilla TransporterType = iota + 1
)

type Traversal

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

Traversal is the primary way in which graphs are processed.

func (*Traversal) HasNext

func (t *Traversal) HasNext() (bool, error)

HasNext returns true if the result is not empty.

func (*Traversal) Iterate

func (t *Traversal) Iterate() (*Traversal, <-chan error, error)

Iterate all the Traverser instances in the traversal and returns the empty traversal.

func (*Traversal) Next

func (t *Traversal) Next() (*Result, error)

Next returns next result.

func (*Traversal) ToList

func (t *Traversal) ToList() ([]*Result, error)

ToList returns the result in a list.

func (*Traversal) ToSet

func (t *Traversal) ToSet() (map[*Result]bool, error)

ToSet returns the results in a set.

type TraversalStrategies

type TraversalStrategies struct {
}

TraversalStrategies is interceptor methods to alter the execution of the traversal (e.g. query re-writing).

type Traverser

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

Traverser is the objects propagating through the traversal.

type Vertex

type Vertex struct {
	Element
}

Vertex contains a single Vertex which has a Label and an Id.

func (*Vertex) String

func (v *Vertex) String() string

String returns the string representation of the vertex.

type VertexProperty

type VertexProperty struct {
	Element
	Key    string // This is the Label of Vertex.
	Value  interface{}
	Vertex Vertex // Vertex that owns the property.
}

VertexProperty is similar to property in that it denotes a key/value pair associated with a Vertex, but is different in that it also represents an entity that is an Element and can have properties of its own.

func (*VertexProperty) String

func (vp *VertexProperty) String() string

String returns the string representation of the vertex property.

Jump to

Keyboard shortcuts

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