dialectors

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 6 Imported by: 3

Documentation

Overview

* * package: dialectors * file: dirlector.go * author: wuzhensheng * create: 2021-06-23 11:52:00 * description: *

* * package: dialectors * file: dirlector.go * author: wuzhensheng * create: 2021-06-23 11:52:00 * description: *

Index

Constants

View Source
const (
	DefaultTimeout         = 60 * time.Second
	DefaultIdleTime        = 10 * time.Minute
	DefaultMaxConnPoolSize = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DialectorConfig

type DialectorConfig struct {
	Username        string        `json:"username" yaml:"username"`
	Password        string        `json:"password" yaml:"password"`
	Space           string        `json:"space" yaml:"space"`
	Timeout         time.Duration `json:"timeout" yaml:"timeout"`
	IdleTime        time.Duration `json:"idle_time" yaml:"idle_time"`
	MaxConnPoolSize int           `json:"max_conn_pool_size" yaml:"max_conn_pool_size"`
	MinConnPoolSize int           `json:"min_conn_pool_size" yaml:"min_conn_pool_size"`
	Addresses       []string      `json:"addresses" yaml:"addresses"`
}

func (*DialectorConfig) LoadDefault

func (config *DialectorConfig) LoadDefault()

type IDialector

type IDialector interface {
	Execute(stmt string) (*ResultSet, error)
	Close()
}

IDialector mock nebula's pool. 取名来自 gorm 的 Dialector.

type NebulaDialector

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

func MustNewNebulaDialector

func MustNewNebulaDialector(cfg DialectorConfig) *NebulaDialector

MustNewNebulaDialector 语法糖, 必须新建一个 Nebula Dialector

func NewNebulaDialector

func NewNebulaDialector(cfg DialectorConfig) (*NebulaDialector, error)

func (*NebulaDialector) Close

func (d *NebulaDialector) Close()

func (*NebulaDialector) Execute

func (d *NebulaDialector) Execute(stmt string) (*ResultSet, error)

Execute TODO 可以缓存一个 session pool.

type ResultSet

type ResultSet struct {
	*nebula.ResultSet
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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