ngorm

package module
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

README

ngorm

介绍

nebula data binding orm 国产图数据库 nebula 的数据解析库 for golang

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorResultNotFound   = errors.New("no row found in nebula")
	ErrorModelNotPtr      = errors.New("model type must be ptr")
	ErrorInvalidModel     = errors.New("model ptr invalid")
	ErrorInvalidModelType = errors.New("model type invalid")
	ErrorColumnNotFound   = errors.New("model column not found")
	ErrorSyntax           = errors.New("syntax err")
)

Functions

func ErrorColumnNotFoundGen added in v1.3.7

func ErrorColumnNotFoundGen(column string) error

func ErrorSyntaxGen added in v1.3.9

func ErrorSyntaxGen(err string) error

func ErrorUnknownNebulaValueType added in v1.1.9

func ErrorUnknownNebulaValueType(t string) error

ErrorUnknownNebulaValueType 无法处理的 nebula 数据类型

func SetLogLevel added in v1.1.9

func SetLogLevel(level LogLevel)

Types

type Config

type Config struct {
	Ctx      context.Context
	Servers  []Service
	Username string
	Password string
	PoolSize int
	LogLevel LogLevel
}

type FetchController added in v1.1.9

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

func (*FetchController) Find added in v1.1.9

func (fc *FetchController) Find(model interface{}) error

func (*FetchController) Key added in v1.1.9

func (fc *FetchController) Key(key string) *FetchController

Key Tag properties.k-v key

func (*FetchController) SetTimeout added in v1.4.2

func (fc *FetchController) SetTimeout(second int) *FetchController

func (*FetchController) Tags added in v1.1.9

func (fc *FetchController) Tags(tags ...string) *FetchController

type FetchPathController added in v1.1.9

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

func (*FetchPathController) Find added in v1.1.9

func (fp *FetchPathController) Find(model interface{}) error

func (*FetchPathController) Key added in v1.3.6

func (*FetchPathController) Path added in v1.1.9

func (fp *FetchPathController) Path(paths ...string) *FetchPathController

func (*FetchPathController) SetTimeout added in v1.4.2

func (fp *FetchPathController) SetTimeout(second int) *FetchPathController

type GoController

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

func (*GoController) Finds added in v1.1.9

func (g *GoController) Finds(models ...interface{}) error

func (*GoController) Limit added in v1.3.8

func (g *GoController) Limit(limit int) *GoController

func (*GoController) Offset added in v1.3.8

func (g *GoController) Offset(offset int) *GoController

func (*GoController) Over

func (g *GoController) Over(over string) *GoController

func (*GoController) SetTimeout added in v1.4.2

func (g *GoController) SetTimeout(second int) *GoController

func (*GoController) Step added in v1.1.9

func (g *GoController) Step(steps ...int) *GoController

func (*GoController) StepLimit added in v1.3.8

func (g *GoController) StepLimit(limits []int) *GoController

StepLimit:

Examples:

// 表示 1 - 3 步 分别限制 2个, 3个, 4个 结果
// 在 管道 之前的限制,效果更加理想
GOFrom("xxx").Step(1, 3).Over("edge").Yield("edge._dst").StepLimit([]int{2,3,4})

func (*GoController) Value added in v1.1.9

func (g *GoController) Value() (*nebula.ResultSet, error)

func (*GoController) Yield

func (g *GoController) Yield(yields ...string) *GoController

type LogLevel added in v1.1.9

type LogLevel uint8
const (
	DebugLevel LogLevel = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
	PanicLevel
)

type MatchController added in v1.1.9

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

func (*MatchController) Finds added in v1.1.9

func (m *MatchController) Finds(models ...interface{}) error

func (*MatchController) SetTimeout added in v1.4.2

func (m *MatchController) SetTimeout(second int) *MatchController

func (*MatchController) Value added in v1.1.9

func (m *MatchController) Value() (*nebula.ResultSet, error)

Value return the original nebula result

type NGDB

type NGDB struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewNGDB

func NewNGDB(space string, config ...Config) (*NGDB, error)

func (*NGDB) Close

func (nd *NGDB) Close()

func (*NGDB) Fetch added in v1.1.9

func (db *NGDB) Fetch(ids ...string) *FetchController

func (*NGDB) FetchPath added in v1.1.9

func (db *NGDB) FetchPath(edge string) *FetchPathController

func (*NGDB) GOFrom added in v1.1.9

func (db *NGDB) GOFrom(from ...string) *GoController

func (*NGDB) Match

func (db *NGDB) Match(ngql string) *MatchController

func (*NGDB) Path added in v1.1.9

func (db *NGDB) Path(pathKind string) *PathController

func (*NGDB) Raw added in v1.1.9

func (db *NGDB) Raw(ngql string) *RawController

type PathController added in v1.1.9

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

func (*PathController) Find added in v1.1.9

func (pe *PathController) Find() ([][]Relationship, error)

func (*PathController) From added in v1.1.9

func (pe *PathController) From(from string) *PathController

func (*PathController) Over added in v1.1.9

func (pe *PathController) Over(over string) *PathController

func (*PathController) SetTimeout added in v1.4.2

func (pe *PathController) SetTimeout(second int) *PathController

func (*PathController) To added in v1.1.9

func (pe *PathController) To(to string) *PathController

func (*PathController) Upto added in v1.1.9

func (pe *PathController) Upto(num int) *PathController

func (*PathController) Value added in v1.1.9

func (pe *PathController) Value() (*nebula.ResultSet, error)

type RawController added in v1.1.9

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

func (*RawController) Value added in v1.1.9

func (r *RawController) Value() (*nebula.ResultSet, error)

type Relationship added in v1.1.9

type Relationship struct {
	From string `json:"from"`
	To   string `json:"to"`
	Edge string `json:"edge"`
}

type Service added in v1.1.9

type Service struct {
	Addr string `mapstructure:"addr"`
	Port int    `mapstructure:"port"`
}

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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