Documentation ¶
Index ¶
- Constants
- func DownloadFile(filePath string, rw http.ResponseWriter) error
- func EscapeJson(s string) string
- func ExecShell(ctx context.Context, command string) (string, error)
- func FileExist(file string) bool
- func FormatAppVersion(appVersion, GitCommit, BuildDate string) (string, error)
- func GBK2UTF8(s string) (string, bool)
- func InStringSlice(slice []string, element string) bool
- func JsonResponseByErr(err error) string
- func Md5(str string) string
- func PanicToError(f func()) (err error)
- func PanicTrace(err interface{}) string
- func PrintAppVersion(appVersion, GitCommit, BuildDate string)
- func RandAuthToken() string
- func RandNumber(max int) int
- func RandString(length int64) string
- func ReplaceStrings(s string, old []string, replace []string) string
- func WorkDir() (string, error)
- type JsonResponse
- type Result
- type WaitGroupWrapper
Constants ¶
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 DownloadFile ¶
func DownloadFile(filePath string, rw http.ResponseWriter) error
DownloadFile 文件下载
func FormatAppVersion ¶
FormatAppVersion 格式化应用版本信息
func InStringSlice ¶
func JsonResponseByErr ¶
func PrintAppVersion ¶
func PrintAppVersion(appVersion, GitCommit, BuildDate string)
PrintAppVersion 打印应用版本
func RandAuthToken ¶
func RandAuthToken() string
func ReplaceStrings ¶
ReplaceStrings 批量替换字符串
Types ¶
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
type WaitGroupWrapper ¶
WaitGroupWrapper waitGroup包装
Click to show internal directories.
Click to hide internal directories.