graph

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

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 any, 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    any    `json:"id"`
	Label string `json:"label"`
}

Element defines a base struct for graph elements.

func NewElement

func NewElement(id any, label string) Element

NewElement create a new graph element.

type Property

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

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

func NewProperty

func NewProperty(key string, value any) 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]any

ValueMap models a .valueMap() gremlin response.

func (ValueMap) Decode

func (m ValueMap) Decode(v any) error

Decode decodes a value map into v.

type Vertex

type Vertex struct {
	Element
}

Vertex represents a graph vertex.

func NewVertex

func NewVertex(id any, 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    any    `json:"id"`
	Key   string `json:"label"`
	Value any    `json:"value"`
}

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

func NewVertexProperty

func NewVertexProperty(id any, key string, value any) 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