helper

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OrmMulti   int
	OrmMaxIdle int
	OrmMaxConn int
	OrmSource  string
	DebugMode  bool
)
View Source
var Errors map[string]map[string]string

Functions

func ConvertSourceToDSN

func ConvertSourceToDSN() string

Convert ORMSource to DSN (dburl)

func CreateTables

func CreateTables() error

func GetError

func GetError(orm, method string) string

func SetError

func SetError(b *testing.B, orm, method, err string)

func SplitSource

func SplitSource() map[string]string

Types

type BenchmarkReport

type BenchmarkReport []*Result

func (BenchmarkReport) Len

func (s BenchmarkReport) Len() int

func (BenchmarkReport) Less

func (s BenchmarkReport) Less(i, j int) bool

func (BenchmarkReport) Swap

func (s BenchmarkReport) Swap(i, j int)

type BenchmarkResult

type BenchmarkResult struct {
	ORM     string
	Results []Result
}

func RunBenchmarks

func RunBenchmarks(orm ORMInterface, reports map[string]BenchmarkReport) (BenchmarkResult, error)

type ORMInterface

type ORMInterface interface {
	Name() string
	Init() error
	Close() error
	Insert(b *testing.B)
	InsertMulti(b *testing.B)
	Update(b *testing.B)
	Read(b *testing.B)
	ReadSlice(b *testing.B)
}

type Result

type Result struct {
	Name     string
	Method   string
	ErrorMsg string

	N         int
	NsPerOp   int64
	MemAllocs int64
	MemBytes  int64
}

Jump to

Keyboard shortcuts

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