Documentation ¶
Overview ¶
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func ContainsString(ss []string, s string) bool
- func ConvertTime(t time.Duration) string
- func ConvertTimeSecond(seconds int64) string
- func DecompressGZIP(r io.Reader) ([]byte, error)
- func FlagProvided(names ...string) bool
- func GetURLCookieString(urlString string, jar *cookiejar.Jar) string
- func GetUniqueKeyStr() string
- func HasPrefix(s, prefix string) bool
- func HasSuffix(s, suffix string) bool
- func IsExcludeFile(filePath string, excludeNames *[]string) bool
- func IsLocalAbsPath(filePath string) bool
- func IsPanAbsPath(filePath string) bool
- func Md5Str(text string) string
- func NowTimeStr() string
- func ObjectToJsonStr(v interface{}, useIndent bool) string
- func ParseTimeStr(value string) time.Time
- func ParseVersionNum(versionStr string) int
- func PathExists(path string) (bool, error)
- func ResizeUploadBlockSize(fileSize, defaultBlockSize int64) int64
- func Trigger(f func())
- func TriggerOnSync(f func())
- func TrimPathPrefix(path, prefixPath string) string
- func UuidStr() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertTime ¶
func ConvertTimeSecond ¶ added in v0.1.3
func DecompressGZIP ¶
DecompressGZIP 对 io.Reader 数据, 进行 gzip 解压
func FlagProvided ¶
FlagProvided 检测命令行是否提供名为 name 的 flag, 支持多个name(names)
func GetURLCookieString ¶
GetURLCookieString 返回cookie字串
func IsExcludeFile ¶ added in v0.2.4
IsExcludeFile 是否是指定排除的文件
func IsLocalAbsPath ¶ added in v0.2.2
IsLocalAbsPath 是否是本地绝对路径
func NowTimeStr ¶ added in v0.1.6
func NowTimeStr() string
NowTimeStr 当前时间字符串,格式为:2006-01-02 15:04:05
func ObjectToJsonStr ¶ added in v0.1.6
ObjectToJsonStr 转换成json字符串
func ParseVersionNum ¶
func ResizeUploadBlockSize ¶ added in v0.2.5
ResizeUploadBlockSize 自动调整分片大小,方便支持极大单文件上传。返回新的分片大小
Types ¶
This section is empty.