graph

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	Element
	OutV, InV Vertex
}

An Edge between two vertices.

func NewEdge

func NewEdge(id interface{}, label string, outV, inV Vertex) Edge

NewEdge create a new graph edge.

func (Edge) MarshalGraphson

func (e Edge) MarshalGraphson() ([]byte, error)

MarshalGraphson implements graphson.Marshaler interface.

func (Edge) String

func (e Edge) String() string

String implements fmt.Stringer interface.

func (*Edge) UnmarshalGraphson

func (e *Edge) UnmarshalGraphson(data []byte) error

UnmarshalGraphson implements graphson.Unmarshaler interface.

type Element

type Element struct {
	ID    interface{} `json:"id"`
	Label string      `json:"label"`
}

Element defines a base struct for graph elements.

func NewElement

func NewElement(id interface{}, label string) Element

NewElement create a new graph element.

type Property

type Property struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

Property denotes a key/value pair associated with an edge.

func NewProperty

func NewProperty(key string, value interface{}) Property

NewProperty create a new graph edge property.

func (Property) GraphsonType

func (Property) GraphsonType() graphson.Type

GraphsonType implements graphson.Typer interface.

func (Property) String

func (p Property) String() string

String implements fmt.Stringer interface.

type ValueMap

type ValueMap []map[string]interface{}

ValueMap models a .valueMap() gremlin response.

func (ValueMap) Decode

func (m ValueMap) Decode(v interface{}) error

Decode decodes a value map into v.

type Vertex

type Vertex struct {
	Element
}

Vertex represents a graph vertex.

func NewVertex

func NewVertex(id interface{}, label string) Vertex

NewVertex create a new graph vertex.

func (Vertex) GraphsonType

func (Vertex) GraphsonType() graphson.Type

GraphsonType implements graphson.Typer interface.

func (Vertex) String

func (v Vertex) String() string

String implements fmt.Stringer interface.

type VertexProperty

type VertexProperty struct {
	ID    interface{} `json:"id"`
	Key   string      `json:"label"`
	Value interface{} `json:"value"`
}

VertexProperty denotes a key/value pair associated with a vertex.

func NewVertexProperty

func NewVertexProperty(id interface{}, key string, value interface{}) VertexProperty

NewVertexProperty create a new graph vertex property.

func (VertexProperty) GraphsonType

func (VertexProperty) GraphsonType() graphson.Type

GraphsonType implements graphson.Typer interface.

func (VertexProperty) String

func (vp VertexProperty) String() string

String implements fmt.Stringer interface.

Directories

Path Synopsis
dsl
Package dsl provide an API for writing gremlin dsl queries almost as-is in Go without using strings in the code.
Package dsl provide an API for writing gremlin dsl queries almost as-is in Go without using strings in the code.
__
g
p

Jump to

Keyboard shortcuts

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