typtool

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDBEnvKeys = &DBEnvKeys{
		DBName: "DBNAME",
		DBUser: "DBUSER",
		DBPass: "DBPASS",
		Host:   "HOST",
		Port:   "PORT",
	}
)
View Source
var DefaultRedisEnvKeys = &RedisEnvKeys{
	Host: "HOST",
	Port: "PORT",
	Pass: "PASS",
}

Functions

func ComposeFiles

func ComposeFiles(dir string) []string

func CreateMigrationFile

func CreateMigrationFile(migrationSrc, name string)

CreateMigrationFile createa migration file

Types

type DBConfig

type DBConfig struct {
	DBName string
	DBUser string
	DBPass string
	Host   string
	Port   string
}

type DBEnvKeys

type DBEnvKeys DBConfig

func DBEnvKeysWithPrefix

func DBEnvKeysWithPrefix(prefix string) *DBEnvKeys

func (*DBEnvKeys) GetConfig

func (e *DBEnvKeys) GetConfig() *DBConfig

type Docker

type Docker struct {
	ComposeFiles []string
	EnvFile      string
}

Docker is wrapper for docker-compose command support with predefined multiple compose file and environment

func (*Docker) DockerCompose

func (m *Docker) DockerCompose(c *typgo.Context) (err error)

DockerUp docker up

func (*Docker) DockerWipe

func (m *Docker) DockerWipe(c *typgo.Context) error

DockerWipe clean all docker process

func (*Docker) Task

func (m *Docker) Task() *typgo.Task

Task for docker

type MySQL

type MySQL struct {
	Name         string
	EnvKeys      *DBEnvKeys
	MigrationSrc string
	SeedSrc      string
	DockerName   string
}

MySQL for postgres

func (*MySQL) Console

func (t *MySQL) Console(c *typgo.Context) error

Console interactice for postgres

func (*MySQL) CreateDB

func (t *MySQL) CreateDB(c *typgo.Context) error

CreateDB create database

func (*MySQL) DropDB

func (t *MySQL) DropDB(c *typgo.Context) error

DropDB delete database

func (*MySQL) MigrateDB

func (t *MySQL) MigrateDB(c *typgo.Context) error

MigrateDB migrate database

func (*MySQL) MigrationFile

func (t *MySQL) MigrationFile(c *typgo.Context) error

MigrationFile seed database

func (*MySQL) RollbackDB

func (t *MySQL) RollbackDB(c *typgo.Context) error

RollbackDB rollback database

func (*MySQL) SeedDB

func (t *MySQL) SeedDB(c *typgo.Context) error

SeedDB seed database

func (*MySQL) Task

func (t *MySQL) Task() *typgo.Task

Task for postgress

type Postgres

type Postgres struct {
	Name         string
	EnvKeys      *DBEnvKeys
	MigrationSrc string
	SeedSrc      string
	DockerName   string
}

func (*Postgres) Console

func (t *Postgres) Console(c *typgo.Context) error

Console interactice for postgres

func (*Postgres) CreateDB

func (t *Postgres) CreateDB(c *typgo.Context) error

CreateDB create database

func (*Postgres) DropDB

func (t *Postgres) DropDB(c *typgo.Context) error

DropDB delete database

func (*Postgres) MigrateDB

func (t *Postgres) MigrateDB(c *typgo.Context) error

MigrateDB migrate database

func (*Postgres) MigrationFile

func (t *Postgres) MigrationFile(c *typgo.Context) error

MigrationFile seed database

func (*Postgres) RollbackDB

func (t *Postgres) RollbackDB(c *typgo.Context) error

RollbackDB rollback database

func (*Postgres) SeedDB

func (t *Postgres) SeedDB(c *typgo.Context) error

SeedDB seed database

func (*Postgres) Task

func (t *Postgres) Task() *typgo.Task

Task for postgres

type Redis

type Redis struct {
	Name       string
	EnvKeys    *RedisEnvKeys
	DockerName string
}

func (*Redis) Console

func (t *Redis) Console(c *typgo.Context) error

func (*Redis) Task

func (t *Redis) Task() *typgo.Task

type RedisConfig

type RedisConfig struct {
	Host string
	Port string
	Pass string
}

type RedisEnvKeys

type RedisEnvKeys RedisConfig

func RedisEnvKeysWithPrefix

func RedisEnvKeysWithPrefix(prefix string) *RedisEnvKeys

func (*RedisEnvKeys) Config

func (r *RedisEnvKeys) Config() *RedisConfig

Jump to

Keyboard shortcuts

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