age

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.

* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.

* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.

* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.

Index

Constants

View Source
const MaxInt = int(MaxUint >> 1)
View Source
const MaxUint = ^uint(0)
View Source
const MinInt = -MaxInt - 1
View Source
const MinUint = 0

Variables

This section is empty.

Functions

func GetReady

func GetReady(db *sql.DB, graphName string) (bool, error)

GetReady prepare AGE extension load AGE extension set graph path

func IsEntity

func IsEntity(v interface{}) bool

Types

type AGErrorListener

type AGErrorListener struct {
	*antlr.DefaultErrorListener
	// contains filtered or unexported fields
}

func NewAGErrorListener

func NewAGErrorListener() *AGErrorListener

func (*AGErrorListener) ClearErrs added in v0.0.4

func (el *AGErrorListener) ClearErrs()

func (*AGErrorListener) GetErrs added in v0.0.4

func (el *AGErrorListener) GetErrs() []antlr.RecognitionException

func (*AGErrorListener) SyntaxError

func (el *AGErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)

type AGUnmarshaler

type AGUnmarshaler struct {
	Unmarshaller
	// contains filtered or unexported fields
}

func NewAGUnmarshaler

func NewAGUnmarshaler() *AGUnmarshaler

type Age

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

func ConnectAge

func ConnectAge(graphName string, dsn string) (*Age, error)

* @param dsn host=127.0.0.1 port=5432 dbname=postgres user=postgres password=agens sslmode=disable

func NewAge

func NewAge(graphName string, db *sql.DB) *Age

func (*Age) Begin

func (a *Age) Begin() (*AgeTx, error)

func (*Age) Close

func (a *Age) Close() error

func (*Age) DB

func (a *Age) DB() *sql.DB

func (*Age) GetReady

func (age *Age) GetReady() (bool, error)

type AgeError

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

func (*AgeError) Error

func (e *AgeError) Error() string

type AgeParseError

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

func (*AgeParseError) Error

func (e *AgeParseError) Error() string

type AgeTx

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

func (*AgeTx) Commit

func (t *AgeTx) Commit() error

func (*AgeTx) ExecCypher

func (a *AgeTx) ExecCypher(columnCount int, cypher string, args ...interface{}) (*CypherCursor, error)

* CREATE , DROP ....

func (*AgeTx) Rollback

func (t *AgeTx) Rollback() error

type Cursor

type Cursor interface {
	Next() bool
	Close() error
}

func NewCypherCursor

func NewCypherCursor(columnCount int, rows *sql.Rows) Cursor

type CursorProvider

type CursorProvider func(columnCount int, rows *sql.Rows) Cursor

type CypherCursor

type CypherCursor struct {
	Cursor
	// contains filtered or unexported fields
}

func ExecCypher

func ExecCypher(tx *sql.Tx, graphName string, columnCount int, cypher string, args ...interface{}) (*CypherCursor, error)

ExecCypher : execute cypher query CREATE , DROP .... MATCH .... RETURN .... CREATE , DROP .... RETURN ...

func (*CypherCursor) Close

func (c *CypherCursor) Close() error

func (*CypherCursor) GetRow

func (c *CypherCursor) GetRow() ([]Entity, error)

func (*CypherCursor) Next

func (c *CypherCursor) Next() bool

type Edge

type Edge struct {
	*LabeledEntity
	// contains filtered or unexported fields
}

func NewEdge

func NewEdge(id int64, label string, start int64, end int64, props map[string]interface{}) *Edge

func (*Edge) EndId

func (e *Edge) EndId() int64

func (*Edge) GType

func (e *Edge) GType() GTYPE

func (*Edge) StartId

func (e *Edge) StartId() int64

func (*Edge) String

func (e *Edge) String() string

type Entity

type Entity interface {
	GType() GTYPE
	String() string
}

Entity object interface for parsed AGE result data : Vertex, Edge, Path and SimpleEntity

type GTYPE

type GTYPE uint8

GTYPE representing entity types for AGE result data : Vertex, Edge, Path and SimpleEntity

const (
	G_OTHER GTYPE = 1 + iota
	G_VERTEX
	G_EDGE
	G_PATH
	G_MAP_PATH
	G_STR
	G_INT
	G_INTBIG
	G_FLOAT
	G_FLOATBIG
	G_BOOL
	G_NULL
	G_MAP
	G_ARR
)

type LabeledEntity

type LabeledEntity struct {
	Entity
	// contains filtered or unexported fields
}

func (*LabeledEntity) Id

func (n *LabeledEntity) Id() int64

func (*LabeledEntity) Label

func (n *LabeledEntity) Label() string

func (*LabeledEntity) Prop

func (n *LabeledEntity) Prop(key string) interface{}

func (*LabeledEntity) Props

func (n *LabeledEntity) Props() map[string]interface{}

return properties

type MapPath

type MapPath struct {
	Entity
	// contains filtered or unexported fields
}

func NewMapPath

func NewMapPath(entities []interface{}) *MapPath

func (*MapPath) GType

func (e *MapPath) GType() GTYPE

func (*MapPath) Get

func (e *MapPath) Get(index int) interface{}

func (*MapPath) Size

func (e *MapPath) Size() int

func (*MapPath) String

func (p *MapPath) String() string

type Path

type Path struct {
	Entity
	// contains filtered or unexported fields
}

func NewPath

func NewPath(entities []Entity) *Path

func (*Path) GType

func (e *Path) GType() GTYPE

func (*Path) Get

func (e *Path) Get(index int) Entity

func (*Path) GetAsEdge

func (e *Path) GetAsEdge(index int) *Edge

func (*Path) GetAsVertex

func (e *Path) GetAsVertex(index int) *Vertex

func (*Path) Size

func (e *Path) Size() int

func (*Path) String

func (p *Path) String() string

type SimpleEntity

type SimpleEntity struct {
	Entity
	// contains filtered or unexported fields
}

func NewSimpleEntity

func NewSimpleEntity(value interface{}) *SimpleEntity

func (*SimpleEntity) AsArr

func (e *SimpleEntity) AsArr() []interface{}

func (*SimpleEntity) AsBigFloat

func (e *SimpleEntity) AsBigFloat() *big.Float

func (*SimpleEntity) AsBigInt

func (e *SimpleEntity) AsBigInt() *big.Int

func (*SimpleEntity) AsBool

func (e *SimpleEntity) AsBool() bool

func (*SimpleEntity) AsFloat

func (e *SimpleEntity) AsFloat() float64

func (*SimpleEntity) AsInt

func (e *SimpleEntity) AsInt() int

func (*SimpleEntity) AsInt64

func (e *SimpleEntity) AsInt64() int64

func (*SimpleEntity) AsMap

func (e *SimpleEntity) AsMap() map[string]interface{}

func (*SimpleEntity) AsStr

func (e *SimpleEntity) AsStr() string

func (*SimpleEntity) GType

func (e *SimpleEntity) GType() GTYPE

func (*SimpleEntity) IsNull

func (e *SimpleEntity) IsNull() bool

func (*SimpleEntity) String

func (e *SimpleEntity) String() string

func (*SimpleEntity) Value

func (e *SimpleEntity) Value() interface{}

type UnmarshalVisitor

type UnmarshalVisitor struct {
	parser.AgtypeVisitor
	// contains filtered or unexported fields
}

func (*UnmarshalVisitor) Visit

func (v *UnmarshalVisitor) Visit(tree antlr.ParseTree) interface{}

func (*UnmarshalVisitor) VisitAgType added in v0.0.4

func (v *UnmarshalVisitor) VisitAgType(ctx *parser.AgTypeContext) interface{}

func (*UnmarshalVisitor) VisitAgValue added in v0.0.4

func (v *UnmarshalVisitor) VisitAgValue(ctx *parser.AgValueContext) interface{}

func (*UnmarshalVisitor) VisitArray added in v0.0.4

func (v *UnmarshalVisitor) VisitArray(ctx *parser.ArrayContext) interface{}

Visit a parse tree produced by AgtypeParser#array.

func (*UnmarshalVisitor) VisitArrayValue added in v0.0.4

func (v *UnmarshalVisitor) VisitArrayValue(ctx *parser.ArrayValueContext) interface{}

func (*UnmarshalVisitor) VisitChildren

func (v *UnmarshalVisitor) VisitChildren(node antlr.RuleNode) interface{}

func (*UnmarshalVisitor) VisitErrorNode

func (v *UnmarshalVisitor) VisitErrorNode(node antlr.ErrorNode) interface{}

func (*UnmarshalVisitor) VisitFalseBoolean added in v0.0.4

func (v *UnmarshalVisitor) VisitFalseBoolean(ctx *parser.FalseBooleanContext) interface{}

func (*UnmarshalVisitor) VisitFloatLiteral added in v0.0.4

func (v *UnmarshalVisitor) VisitFloatLiteral(ctx *parser.FloatLiteralContext) interface{}

func (*UnmarshalVisitor) VisitFloatValue added in v0.0.4

func (v *UnmarshalVisitor) VisitFloatValue(ctx *parser.FloatValueContext) interface{}

Visit a parse tree produced by AgtypeParser#FloatValue.

func (*UnmarshalVisitor) VisitIntegerValue added in v0.0.4

func (v *UnmarshalVisitor) VisitIntegerValue(ctx *parser.IntegerValueContext) interface{}

func (*UnmarshalVisitor) VisitNullValue added in v0.0.4

func (v *UnmarshalVisitor) VisitNullValue(ctx *parser.NullValueContext) interface{}

func (*UnmarshalVisitor) VisitObj added in v0.0.4

func (v *UnmarshalVisitor) VisitObj(ctx *parser.ObjContext) interface{}

func (*UnmarshalVisitor) VisitObjectValue added in v0.0.4

func (v *UnmarshalVisitor) VisitObjectValue(ctx *parser.ObjectValueContext) interface{}

Visit a parse tree produced by AgtypeParser#ObjectValue.

func (*UnmarshalVisitor) VisitPair

func (v *UnmarshalVisitor) VisitPair(ctx *parser.PairContext) interface{}

func (*UnmarshalVisitor) VisitStringValue added in v0.0.4

func (v *UnmarshalVisitor) VisitStringValue(ctx *parser.StringValueContext) interface{}

func (*UnmarshalVisitor) VisitTerminal

func (v *UnmarshalVisitor) VisitTerminal(node antlr.TerminalNode) interface{}

func (*UnmarshalVisitor) VisitTrueBoolean added in v0.0.4

func (v *UnmarshalVisitor) VisitTrueBoolean(ctx *parser.TrueBooleanContext) interface{}

func (*UnmarshalVisitor) VisitValue

func (v *UnmarshalVisitor) VisitValue(ctx *parser.ValueContext) interface{}

Visit a parse tree produced by AgtypeParser#value.

type Unmarshaller

type Unmarshaller interface {
	// contains filtered or unexported methods
}

type Vertex

type Vertex struct {
	*LabeledEntity
}

func NewVertex

func NewVertex(id int64, label string, props map[string]interface{}) *Vertex

func (*Vertex) GType

func (v *Vertex) GType() GTYPE

func (*Vertex) String

func (v *Vertex) String() string

Jump to

Keyboard shortcuts

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