Documentation ¶
Index ¶
- func IsSupportedNodeIDFunction(function string) bool
- func IsSupportedNodeIDValueType(t ValueType) bool
- func IsSupportedPropValueType(t ValueType) bool
- type Edge
- type EdgeNodeRef
- type EdgeOption
- func WithEdgeDst(dst *EdgeNodeRef) EdgeOption
- func WithEdgeFilter(f *specbase.Filter) EdgeOption
- func WithEdgeIgnoreExistedIndex(ignore bool) EdgeOption
- func WithEdgeMode(m specbase.Mode) EdgeOption
- func WithEdgeProps(props ...*Prop) EdgeOption
- func WithEdgeSrc(src *EdgeNodeRef) EdgeOption
- func WithRank(rank *Rank) EdgeOption
- type Edges
- type Graph
- func (g *Graph) AddEdges(edges ...*Edge)
- func (g *Graph) AddNodes(nodes ...*Node)
- func (g *Graph) Complete()
- func (g *Graph) EdgeStatement(e *Edge, records ...Record) (statement string, nRecord int, err error)
- func (g *Graph) EdgeStatementBuilder(e *Edge) specbase.StatementBuilder
- func (g *Graph) GetEdgeByName(name string) (*Edge, bool)
- func (g *Graph) GetNodeByName(name string) (*Node, bool)
- func (g *Graph) NodeStatement(n *Node, records ...Record) (statement string, nRecord int, err error)
- func (g *Graph) NodeStatementBuilder(n *Node) specbase.StatementBuilder
- func (g *Graph) Validate() error
- type GraphOption
- type Node
- type NodeID
- type NodeOption
- type Nodes
- type Prop
- type Props
- type Rank
- type Record
- type Records
- type ValueType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Edge ¶
type Edge struct { Name string `yaml:"name" json:"name"` Src *EdgeNodeRef `yaml:"src" json:"src"` Dst *EdgeNodeRef `yaml:"dst" json:"dst"` Rank *Rank `yaml:"rank,omitempty" json:"rank,omitempty,optional"` Props Props `yaml:"props,omitempty" json:"props,omitempty,optional"` IgnoreExistedIndex *bool `yaml:"ignoreExistedIndex,omitempty" json:"ignoreExistedIndex,omitempty,optional,default=false"` Filter *specbase.Filter `yaml:"filter,omitempty" json:"filter,omitempty,optional"` Mode specbase.Mode `yaml:"mode,omitempty" json:"mode,omitempty,optional,default=insert"` // contains filtered or unexported fields }
func NewEdge ¶
func NewEdge(name string, opts ...EdgeOption) *Edge
func (*Edge) Options ¶
func (e *Edge) Options(opts ...EdgeOption) *Edge
type EdgeNodeRef ¶
func (*EdgeNodeRef) Complete ¶
func (n *EdgeNodeRef) Complete()
func (*EdgeNodeRef) Validate ¶
func (n *EdgeNodeRef) Validate() error
type EdgeOption ¶
type EdgeOption func(*Edge)
func WithEdgeDst ¶
func WithEdgeDst(dst *EdgeNodeRef) EdgeOption
func WithEdgeFilter ¶
func WithEdgeFilter(f *specbase.Filter) EdgeOption
func WithEdgeIgnoreExistedIndex ¶
func WithEdgeIgnoreExistedIndex(ignore bool) EdgeOption
func WithEdgeMode ¶
func WithEdgeMode(m specbase.Mode) EdgeOption
func WithEdgeProps ¶
func WithEdgeProps(props ...*Prop) EdgeOption
func WithEdgeSrc ¶
func WithEdgeSrc(src *EdgeNodeRef) EdgeOption
func WithRank ¶
func WithRank(rank *Rank) EdgeOption
type Graph ¶
type Graph struct { Name string `yaml:"name" json:"name"` Nodes Nodes `yaml:"tags,omitempty" json:"tags,omitempty,optional"` Edges Edges `yaml:"edges,omitempty" json:"edges,omitempty,optional"` }
func NewGraph ¶
func NewGraph(name string, opts ...GraphOption) *Graph
func (*Graph) EdgeStatement ¶
func (*Graph) EdgeStatementBuilder ¶
func (g *Graph) EdgeStatementBuilder(e *Edge) specbase.StatementBuilder
func (*Graph) NodeStatement ¶
func (*Graph) NodeStatementBuilder ¶
func (g *Graph) NodeStatementBuilder(n *Node) specbase.StatementBuilder
type GraphOption ¶
type GraphOption func(*Graph)
func WithGraphEdges ¶
func WithGraphEdges(edges ...*Edge) GraphOption
func WithGraphNodes ¶
func WithGraphNodes(nodes ...*Node) GraphOption
type Node ¶
type Node struct { Name string `yaml:"name" json:"name"` ID *NodeID `yaml:"id" json:"id"` Props Props `yaml:"props,omitempty" json:"props,omitempty,optional"` IgnoreExistedIndex *bool `yaml:"ignoreExistedIndex,omitempty" json:"ignoreExistedIndex,omitempty,default=false"` Filter *specbase.Filter `yaml:"filter,omitempty" json:"filter,omitempty,optional"` Mode specbase.Mode `yaml:"mode,omitempty" json:"mode,omitempty,default=insert"` // contains filtered or unexported fields }
Node is VERTEX in 3.x
func NewNode ¶
func NewNode(name string, opts ...NodeOption) *Node
func (*Node) Options ¶
func (n *Node) Options(opts ...NodeOption) *Node
type NodeID ¶
type NodeID struct { Name string `yaml:"-" json:"-"` Type ValueType `yaml:"type" json:"type"` Index int `yaml:"index" json:"index"` ConcatItems []interface{} `yaml:"concatItems,omitempty" json:"concatItems,omitempty,optional"` // only support string and int, string for constant, int is for Index Function *string `yaml:"function" json:"function,omitempty,optional"` // contains filtered or unexported fields }
NodeID is the VID in 3.x
type NodeOption ¶
type NodeOption func(*Node)
func WithNodeFilter ¶
func WithNodeFilter(f *specbase.Filter) NodeOption
func WithNodeID ¶
func WithNodeID(id *NodeID) NodeOption
func WithNodeIgnoreExistedIndex ¶
func WithNodeIgnoreExistedIndex(ignore bool) NodeOption
func WithNodeMode ¶
func WithNodeMode(m specbase.Mode) NodeOption
func WithNodeProps ¶
func WithNodeProps(props ...*Prop) NodeOption
type Prop ¶
type Prop struct { Name string `yaml:"name" json:"name"` Type ValueType `yaml:"type" json:"type"` Index int `yaml:"index" json:"index"` Nullable bool `yaml:"nullable" json:"nullable,omitempty,optional,default=false"` NullValue string `yaml:"nullValue" json:"nullValue,omitempty,optional"` AlternativeIndices []int `yaml:"alternativeIndices,omitempty" json:"alternativeIndices,omitempty,optional"` DefaultValue *string `yaml:"defaultValue" json:"defaultValue,omitempty,optional"` // contains filtered or unexported fields }
type Rank ¶
type Rank struct { Index int `yaml:"index" json:"index"` // contains filtered or unexported fields }
type ValueType ¶
type ValueType string
const ( ValueTypeBool ValueType = "BOOL" ValueTypeInt ValueType = "INT" ValueTypeInt8 ValueType = "INT8" ValueTypeInt16 ValueType = "INT16" ValueTypeInt32 ValueType = "INT32" ValueTypeInt64 ValueType = "INT64" ValueTypeString ValueType = "STRING" ValueTypeFixedString ValueType = "FIXED_STRING" ValueTypeFloat ValueType = "FLOAT" ValueTypeDouble ValueType = "DOUBLE" ValueTypeDate ValueType = "DATE" ValueTypeTime ValueType = "TIME" ValueTypeDateTime ValueType = "DATETIME" ValueTypeTimestamp ValueType = "TIMESTAMP" ValueTypeGeo ValueType = "GEOGRAPHY" ValueTypeGeoPoint ValueType = "GEOGRAPHY(POINT)" ValueTypeGeoLineString ValueType = "GEOGRAPHY(LINESTRING)" ValueTypeGeoPolygon ValueType = "GEOGRAPHY(POLYGON)" ValueTypeDefault = ValueTypeString )
Click to show internal directories.
Click to hide internal directories.