mysql

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(id int, options GeneratorOptions, ctx context.Context, requestrate int, s *stats.Stats) *Generator

func (*Generator) Finish

func (g *Generator) Finish() error

func (*Generator) Init

func (g *Generator) Init() error

func (*Generator) InitDone

func (g *Generator) InitDone() error

func (*Generator) Open

func (g *Generator) Open(dsn string) (*sql.DB, error)

func (*Generator) Tick

func (g *Generator) Tick() error

type GeneratorOptions

type GeneratorOptions struct {
	Target string
	Query  string
}

func NewOptions

func NewOptions() *GeneratorOptions

type Hooks

type Hooks struct{}

func (*Hooks) After

func (h *Hooks) After(ctx context.Context, query string, args ...interface{}) (context.Context, error)

After hook will get the timestamp registered on the Before hook and print the elapsed time

func (*Hooks) Before

func (h *Hooks) Before(ctx context.Context, query string, args ...interface{}) (context.Context, error)

Before hook will print the query with it's args and return the context with the timestamp

func (*Hooks) OnError

func (h *Hooks) OnError(ctx context.Context, err error, query string, args ...interface{}) error

Jump to

Keyboard shortcuts

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