utils

package
v1.5.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallCommand

func CallCommand(cmd string) error

CallCommand

func CopyDirectory

func CopyDirectory(from string, to string) error

CopyDirectory

func CopyFile

func CopyFile(from string, to string) error

CopyFile

func CreateDir

func CreateDir(dir string)

CreateDir

func GenColumn

func GenColumn(c *sqlparser.ColumnDefinition) string

GenColumn

func GetPWD

func GetPWD() string

GetPWD, like pwd in linux

func GoFmt

func GoFmt(file string)

go fmt

func IsDirExists

func IsDirExists(dir string) bool

IsDirExists IsDirExists

func IsDirectory

func IsDirectory(p string) (bool, error)

IsDirectory

func IsFileExists

func IsFileExists(path string) bool

IsFileExists IsFileExists

func ParseSQLs

func ParseSQLs(content string) ([]*sqlparser.DDL, error)

ParseSQLs

func ReadFile

func ReadFile(file string) (dataBytes []byte, err error)

func ReadFile(file string) (dataBytes []byte, err error) {

func RemoveDirectory

func RemoveDirectory(dir string) error

RemoveDirectory

func ToCamelFirstLower

func ToCamelFirstLower(str string) string

ToCamelFirstLower 首字母变小写的驼峰

func ToCamelFirstUpper

func ToCamelFirstUpper(str string) string

ToCamelFirstUpper

func ToJSON

func ToJSON(v interface{}, indents ...bool) string

ToJSON

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase 蛇形, 下划线分割

func WriteToFile

func WriteToFile(filename string, data []byte) (err error)

WriteToFile

Types

type Column

type Column struct {
	Name    string
	Type    string
	Comment string
}

func (Column) String

func (c Column) String() string

Jump to

Keyboard shortcuts

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