service

package
v0.0.0-...-e4dcd89 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBEngine

type DBEngine string

DBEngine is the type of DB engine

const (
	// DBEnginePostgres is PostgreSQL DB engine
	DBEnginePostgres DBEngine = "postgres"
	// DBEngineMySQL is MySQL DB engine
	DBEngineMySQL DBEngine = "mysql"
)

type MySQLSeeder

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

MySQLSeeder is seeder for MySQL DB engine

func (MySQLSeeder) Seed

func (s MySQLSeeder) Seed(data SeedData) error

Seed is method for seeding the database

type PostgresSeeder

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

PostgresSeeder is seeder for PostgreSQL DB engine

func (PostgresSeeder) Seed

func (s PostgresSeeder) Seed(data SeedData) error

Seed is method for seeding the database

type SeedData

type SeedData struct {
	Schema *string       `yaml:"schema"`
	Table  string        `yaml:"table"`
	Data   []interface{} `yaml:"data"`
}

SeedData represent data to be seed in YAML files

type Seeder

type Seeder interface {
	Seed(SeedData) error
}

Seeder is the interface for Database seeder

func NewSeeder

func NewSeeder(connectionString string) Seeder

NewSeeder will construct Database seeder service using selected DB engine

Jump to

Keyboard shortcuts

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