ngorm

package module
v1.1.9 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: 11 Imported by: 1

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")
)

Functions

func ErrorColumnNotFound added in v1.1.9

func ErrorColumnNotFound(column 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 {
	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 (f *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) Tags added in v1.1.9

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

func (*FetchController) Value added in v1.1.9

func (f *FetchController) Value() (*nebula.ResultSet, error)

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) Path added in v1.1.9

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

func (*FetchPathController) Props added in v1.1.9

func (fp *FetchPathController) Props(props ...string) *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) Over

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

func (*GoController) Step added in v1.1.9

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

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) 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) 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) 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