mysql

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DriverName = "mysql"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MySQLMigrationsEnabled bool   `envconfig:"MYSQL_MIGRATIONS_ENABLED" default:"false"`
	MySQLHost              string `envconfig:"MYSQL_HOST"`
	MySQLPort              string `envconfig:"MYSQL_PORT"`
	MySQLUsername          string `envconfig:"MYSQL_LOGIN"`
	MySQLPassword          string `envconfig:"MYSQL_PASSWORD"`
	MySQLDatabase          string `envconfig:"MYSQL_DATABASE"`
	MySQLMigrationsTable   string `envconfig:"MYSQL_MIGRATIONS_TABLE" default:"migration_versions"`
}

func Load

func Load() (*Config, error)

func (*Config) GetMySQLDatabase

func (c *Config) GetMySQLDatabase() string

func (*Config) GetMySQLHost

func (c *Config) GetMySQLHost() string

func (*Config) GetMySQLMigrationsTable

func (c *Config) GetMySQLMigrationsTable() string

func (*Config) GetMySQLPassword

func (c *Config) GetMySQLPassword() string

func (*Config) GetMySQLPort

func (c *Config) GetMySQLPort() string

func (*Config) GetMySQLUsername

func (c *Config) GetMySQLUsername() string

func (*Config) IsMySQLMigrationsEnabled

func (c *Config) IsMySQLMigrationsEnabled() bool

type Configurator

type Configurator interface {
	IsMySQLMigrationsEnabled() bool
	GetMySQLUsername() string
	GetMySQLPassword() string
	GetMySQLDatabase() string
	GetMySQLHost() string
	GetMySQLPort() string
	GetMySQLMigrationsTable() string
}

type MySQL

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

func New

func New(ctx context.Context, cfg Configurator, fs embed.FS) (*MySQL, error)

func (*MySQL) Down

func (m *MySQL) Down() error

func (*MySQL) Name

func (m *MySQL) Name() string

func (*MySQL) Up

func (m *MySQL) Up() error

Jump to

Keyboard shortcuts

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