ngorm

package module
v0.0.0-...-59098b2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

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")
)
View Source
var (
	Debug bool
)

Functions

func ErrorColumnNotFound

func ErrorColumnNotFound(column string) error

func ErrorUnknownNebulaValueType

func ErrorUnknownNebulaValueType(t string) error

ErrorUnknownNebulaValueType 无法处理的 nebula 数据类型

func SetLogLevel

func SetLogLevel(level LogLevel)

Types

type Config

type Config struct {
	Servers  []Service
	Username string
	Password string
	PoolSize int
	LogLevel LogLevel
}

type FetchController

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

func (*FetchController) Find

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

func (*FetchController) Key

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

Key Tag properties.k-v key

func (*FetchController) Tags

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

func (*FetchController) Value

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

type GoController

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

func (*GoController) Find

func (g *GoController) Find(model interface{}) error

func (*GoController) Over

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

func (*GoController) Step

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

func (*GoController) Value

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

func (*GoController) Yield

func (g *GoController) Yield(yield string) *GoController

type LogLevel

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

type MatchController

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

func (*MatchController) Finds

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

func (*MatchController) Value

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

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

func (*NGDB) GOFrom

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

func (*NGDB) Match

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

func (*NGDB) Path

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

type PathController

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

func (*PathController) Find

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

func (*PathController) From

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

func (*PathController) Over

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

func (*PathController) To

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

func (*PathController) Upto

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

func (*PathController) Value

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

type Relationship

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

type Service

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