contract

package
v0.0.0-...-54fc5f9 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2017 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//SortAsc - for method GetTableImage
	SortAsc = 0
	//SortDesc - for method GetTableImage
	SortDesc = 1
)
View Source
const (
	//ClearMethodTruncate - clears table using: TRUNCATE table
	//Do not use with transaction because of https://dev.mysql.com/doc/refman/5.5/en/implicit-commit.html
	ClearMethodTruncate = 0
	//ClearMethodNoClear - do not clear table
	ClearMethodNoClear = 1
	//ClearMethodDeleteAll - clears table using: DELETE FROM table
	ClearMethodDeleteAll = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image []Row

Image - base type for set of rows

type ImageProvider

type ImageProvider interface {
	Parse(interface{}) (Image, error)
	CanParse(source interface{}) bool
}

ImageProvider - transformer of raw input to Image

type Installer

type Installer interface {
	InstallImage(Image) error
	GetTableRowsCount(string) (int64, error)
	GetTableImage(string, ...interface{}) (Image, error)
	WithTransaction() error
	Rollback() error
	SetClearMethod(int) Installer
}

Installer - executes requests based in Image structure in real DB

type InstallerConfig

type InstallerConfig struct {
	//Engine for installing dumps, located in /installers/
	Type string
	//DSN string for database
	ConnString string
	//How to clear tables before installing dump
	ClearMethod int
	//Check connection when creating installer instance
	DisableConnCheck bool
}

InstallerConfig - config fo DB

type Modifier

type Modifier func(table string, key string, value string) string

Modifier - changing attrs values

type ModifiersList

type ModifiersList map[string]Modifier

ModifiersList - list of functions

type Row

type Row struct {
	Table string
	Data  map[string]string
}

Row - one row in table

Jump to

Keyboard shortcuts

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