fixture

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fixture

type Fixture struct {
	Model string `yaml:"model"`
	Rows  []row  `yaml:"rows"`
}

type Loader

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

func NewLoader

func NewLoader(db *bun.DB, opts ...LoaderOption) *Loader

func (*Loader) Load

func (l *Loader) Load(ctx context.Context, fsys fs.FS, names ...string) error

func (*Loader) MustRow added in v0.1.3

func (l *Loader) MustRow(id string) interface{}

func (*Loader) Row added in v0.1.3

func (l *Loader) Row(id string) (interface{}, error)

type LoaderOption

type LoaderOption func(l *Loader)

func WithRecreateTables

func WithRecreateTables() LoaderOption

func WithTemplateFuncs added in v0.1.3

func WithTemplateFuncs(funcMap template.FuncMap) LoaderOption

func WithTruncateTables

func WithTruncateTables() LoaderOption

Jump to

Keyboard shortcuts

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