util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultSchemaOutputRootPath = "dao/mysql"

Variables

View Source
var (
	Green   = string([]byte{27, 91, 57, 55, 59, 52, 50, 109})
	White   = string([]byte{27, 91, 57, 48, 59, 52, 55, 109})
	Yellow  = string([]byte{27, 91, 57, 48, 59, 52, 51, 109})
	Red     = string([]byte{27, 91, 57, 55, 59, 52, 49, 109})
	Blue    = string([]byte{27, 91, 57, 55, 59, 52, 52, 109})
	Magenta = string([]byte{27, 91, 57, 55, 59, 52, 53, 109})
	Cyan    = string([]byte{27, 91, 57, 55, 59, 52, 54, 109})
	Reset   = string([]byte{27, 91, 48, 109})
)

设置颜色输出

Functions

func GetDBInstance

func GetDBInstance(conf *DBConfig) (*sql.DB, error)

func OutputError

func OutputError(msg string) error

func OutputFail

func OutputFail(msg string) error

func OutputFile

func OutputFile(tableName, cmdName string) (io.Writer, error)

输出

func OutputInfo

func OutputInfo(title, msg string)

func OutputOk

func OutputOk(msg string)

func OutputStep

func OutputStep(msg string)

func OutputWarn

func OutputWarn(msg string)

Types

type DBConfig

type DBConfig struct {
	Host     string `json:"host"`
	User     string `json:"user"`
	Password string `json:"password"`
	Port     int    `json:"port"`
	DBName   string `json:"database"`
}

DBConfig holds the basic configuration of database

type SchemaArgs

type SchemaArgs struct {
	Database string
	Table    string
	User     string
	Password string
	Host     string
	Port     int
}

Jump to

Keyboard shortcuts

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