Documentation ¶
Index ¶
- Constants
- func BackupMySqlDb(req *DbTaskRequest, dumpDir, dumpFilenameFormat string) (error, string)
- func BackupMySqlDb2(req *pb.DbTaskRequest, dumpDir, dumpFilenameFormat string) (error, string)
- func CreateDirIfNotExists(path ...string)
- func EXECadodbsql(req *DbTaskRequest, sql string) (err error)
- func EXECadodbsql2(req *pb.DbTaskRequest, sql string) (err error)
- func EscapeJson(s string) string
- func ExecShell(ctx context.Context, command string) (string, error)
- func FileExist(file string) bool
- func GBK2UTF8(s string) (string, bool)
- func GetDB() (*sql.DB, error)
- func InStringSlice(slice []string, element string) bool
- func JsonResponseByErr(err error) string
- func Md5(str string) string
- func RandAuthToken() string
- func RandNumber(max int) int
- func RandString(length int64) string
- func ReplaceStrings(s string, old []string, replace []string) string
- type DbTaskRequest
- type DbTaskResponse
- type DbtaskrequestFtp
- type JsonResponse
- type Jsonstrt
- type Mssql
- type Result
- type SA
Constants ¶
View Source
const ( SqlsT = 1 MysqlT = 2 )
View Source
const AppNotInstall = 801
View Source
const AuthError = 401
View Source
const FailureContent = "操作失败"
View Source
const NotFound = 404
View Source
const ResponseFailure = 1
View Source
const ResponseSuccess = 0
View Source
const ServerError = 500
View Source
const SuccessContent = "操作成功"
Variables ¶
This section is empty.
Functions ¶
func BackupMySqlDb ¶
func BackupMySqlDb(req *DbTaskRequest, dumpDir, dumpFilenameFormat string) (error, string)
func BackupMySqlDb2 ¶
func BackupMySqlDb2(req *pb.DbTaskRequest, dumpDir, dumpFilenameFormat string) (error, string)
func EXECadodbsql ¶
func EXECadodbsql(req *DbTaskRequest, sql string) (err error)
func EXECadodbsql2 ¶
func EXECadodbsql2(req *pb.DbTaskRequest, sql string) (err error)
func InStringSlice ¶
func JsonResponseByErr ¶
func RandAuthToken ¶
func RandAuthToken() string
Types ¶
type DbTaskRequest ¶
type DbTaskResponse ¶
type DbtaskrequestFtp ¶
type JsonResponse ¶
type JsonResponse struct{}
func (*JsonResponse) CommonFailure ¶
func (j *JsonResponse) CommonFailure(message string, err ...error) string
func (*JsonResponse) Success ¶
func (j *JsonResponse) Success(message string, data interface{}) string
Click to show internal directories.
Click to hide internal directories.