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"` Src *EdgeNodeRef `yaml:"src"` Dst *EdgeNodeRef `yaml:"dst"` Rank *Rank `yaml:"rank,omitempty"` Props Props `yaml:"props,omitempty"` IgnoreExistedIndex *bool `yaml:"ignoreExistedIndex,omitempty"` Filter *specbase.Filter `yaml:"filter,omitempty"` Mode specbase.Mode `yaml:"mode,omitempty"` // 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 ¶ added in v4.1.0
func WithEdgeFilter(f *specbase.Filter) EdgeOption
func WithEdgeIgnoreExistedIndex ¶
func WithEdgeIgnoreExistedIndex(ignore bool) EdgeOption
func WithEdgeMode ¶ added in v4.1.0
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"` Nodes Nodes `yaml:"tags,omitempty"` Edges Edges `yaml:"edges,omitempty"` }
func NewGraph ¶
func NewGraph(name string, opts ...GraphOption) *Graph
func (*Graph) EdgeStatement ¶ added in v4.1.0
func (*Graph) EdgeStatementBuilder ¶ added in v4.1.0
func (g *Graph) EdgeStatementBuilder(e *Edge) specbase.StatementBuilder
func (*Graph) NodeStatement ¶ added in v4.1.0
func (*Graph) NodeStatementBuilder ¶ added in v4.1.0
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"` ID *NodeID `yaml:"id"` Props Props `yaml:"props,omitempty"` IgnoreExistedIndex *bool `yaml:"ignoreExistedIndex,omitempty"` Filter *specbase.Filter `yaml:"filter,omitempty"` Mode specbase.Mode `yaml:"mode,omitempty"` // 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:"-"` Type ValueType `yaml:"type"` Index int `yaml:"index"` ConcatItems []interface{} `yaml:"concatItems,omitempty"` // only support string and int, string for constant, int is for Index Function *string `yaml:"function"` // contains filtered or unexported fields }
NodeID is the VID in 3.x
type NodeOption ¶
type NodeOption func(*Node)
func WithNodeFilter ¶ added in v4.1.0
func WithNodeFilter(f *specbase.Filter) NodeOption
func WithNodeID ¶
func WithNodeID(id *NodeID) NodeOption
func WithNodeIgnoreExistedIndex ¶
func WithNodeIgnoreExistedIndex(ignore bool) NodeOption
func WithNodeMode ¶ added in v4.1.0
func WithNodeMode(m specbase.Mode) NodeOption
func WithNodeProps ¶
func WithNodeProps(props ...*Prop) NodeOption
type Prop ¶
type Prop struct { Name string `yaml:"name"` Type ValueType `yaml:"type"` Index int `yaml:"index"` Nullable bool `yaml:"nullable"` NullValue string `yaml:"nullValue"` AlternativeIndices []int `yaml:"alternativeIndices,omitempty"` DefaultValue *string `yaml:"defaultValue"` // contains filtered or unexported fields }
type ValueType ¶
type ValueType string
const ( ValueTypeBool ValueType = "BOOL" ValueTypeInt ValueType = "INT" ValueTypeString ValueType = "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.