m3db

package
v0.0.0-...-a2bc2c8 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxNumberOfEnvironments = 15
	QsmEnvNumberKey         = "QSM_ENV_NUMBER"
)
View Source
const (
	PointIdx     = 0
	PathIdx      = 1
	SpaceIdx     = 2
	GlIdx        = 3
	MaxDataEntry = 4
)

Variables

View Source
var Log = m3util.NewLogger("m3db", m3util.INFO)
View Source
var TestMode bool

Functions

func AddTableDef

func AddTableDef(tDef *TableDefinition)

func CloseAll

func CloseAll()

func CloseEnv

func CloseEnv(env *QsmEnvironment)

func CopyFile

func CopyFile(src, dest string)

func DbDrop

func DbDrop(envNumber string)

func FillDb

func FillDb(envNumber string)

func RemoveEnvFromMap

func RemoveEnvFromMap(envId QsmEnvID)

func SetEnvQuietly

func SetEnvQuietly(key, value string)

func SetToTestMode

func SetToTestMode()

Types

type DbConnDetails

type DbConnDetails struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	DbName   string `json:"dbName"`
}

type QsmEnvID

type QsmEnvID int
const (
	NoEnv        QsmEnvID = iota // 0
	MainEnv                      // 1
	RunEnv                       // 2
	PerfTestEnv                  // 3
	ShellEnv                     // 4
	PointTestEnv                 // 5
	PathTestEnv                  // 6
	SpaceTestEnv                 // 7
	GlTestEnv                    // 8
	DbTempEnv                    // 9
	PointTempEnv                 // 10
	PathTempEnv                  // 11
	PointLoadEnv                 // 12
)

func GetDefaultEnvId

func GetDefaultEnvId() QsmEnvID

type QsmEnvironment

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

func GetDefaultEnvironment

func GetDefaultEnvironment() *QsmEnvironment

func GetEnvironment

func GetEnvironment(envId QsmEnvID) *QsmEnvironment

func (*QsmEnvironment) Destroy

func (env *QsmEnvironment) Destroy()

func (*QsmEnvironment) GetConnection

func (env *QsmEnvironment) GetConnection() *sql.DB

func (*QsmEnvironment) GetData

func (env *QsmEnvironment) GetData(dataIdx int) interface{}

func (*QsmEnvironment) GetDbConf

func (env *QsmEnvironment) GetDbConf() DbConnDetails

func (*QsmEnvironment) GetEnvNumber

func (env *QsmEnvironment) GetEnvNumber() string

func (*QsmEnvironment) GetForSaveAll

func (env *QsmEnvironment) GetForSaveAll(tableName string) (*TableExec, int, bool, error)

func (*QsmEnvironment) GetId

func (env *QsmEnvironment) GetId() QsmEnvID

func (*QsmEnvironment) GetOrCreateTableExec

func (env *QsmEnvironment) GetOrCreateTableExec(tableName string) (*TableExec, error)

func (*QsmEnvironment) Ping

func (env *QsmEnvironment) Ping() bool

func (*QsmEnvironment) SelectAllForLoad

func (env *QsmEnvironment) SelectAllForLoad(tableName string) (*TableExec, *sql.Rows)

func (*QsmEnvironment) SetData

func (env *QsmEnvironment) SetData(dataIdx int, d interface{})

type QsmError

type QsmError string

func MakeQsmErrorf

func MakeQsmErrorf(format string, args ...interface{}) QsmError

func (QsmError) Error

func (qsmError QsmError) Error() string

type QsmWrongCount

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

func (*QsmWrongCount) Actual

func (err *QsmWrongCount) Actual() int

func (*QsmWrongCount) Error

func (err *QsmWrongCount) Error() string

type TableDefinition

type TableDefinition struct {
	Name          string
	DdlColumns    string
	Insert        string
	SelectAll     string
	Queries       []string
	ExpectedCount int

	ErrorFilter func(err error) bool
}

type TableExec

type TableExec struct {
	TableDef    *TableDefinition
	InsertStmt  *sql.Stmt
	QueriesStmt []*sql.Stmt
	// contains filtered or unexported fields
}

func (*TableExec) Close

func (te *TableExec) Close() error

func (*TableExec) CloseRows

func (te *TableExec) CloseRows(rows *sql.Rows)

func (*TableExec) GetConnection

func (te *TableExec) GetConnection() *sql.DB

func (*TableExec) GetTableName

func (te *TableExec) GetTableName() string

func (*TableExec) Insert

func (te *TableExec) Insert(args ...interface{}) error

func (*TableExec) InsertReturnId

func (te *TableExec) InsertReturnId(args ...interface{}) (int64, error)

func (*TableExec) IsFiltered

func (te *TableExec) IsFiltered(err error) bool

func (*TableExec) Query

func (te *TableExec) Query(queryId int, args ...interface{}) (*sql.Rows, error)

func (*TableExec) QueryRow

func (te *TableExec) QueryRow(queryId int, args ...interface{}) *sql.Row

func (*TableExec) Update

func (te *TableExec) Update(queryId int, args ...interface{}) (int, error)

func (*TableExec) WasChecked

func (te *TableExec) WasChecked() bool

func (*TableExec) WasCreated

func (te *TableExec) WasCreated() bool

Jump to

Keyboard shortcuts

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