utils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(ss []string, s string) bool

ContainsString 检测字符串是否在字符串数组里

func DecompressGZIP

func DecompressGZIP(r io.Reader) ([]byte, error)

DecompressGZIP 对 io.Reader 数据, 进行 gzip 解压

func FlagProvided

func FlagProvided(names ...string) bool

FlagProvided 检测命令行是否提供名为 name 的 flag, 支持多个name(names)

func GetURLCookieString

func GetURLCookieString(urlString string, jar *cookiejar.Jar) string

GetURLCookieString 返回cookie字串

func IsExcludeFile added in v0.1.3

func IsExcludeFile(filePath string, excludeNames *[]string) bool

IsExcludeFile 是否是指定排除的文件

func ParseVersionNum added in v0.0.9

func ParseVersionNum(versionStr string) int

func Trigger

func Trigger(f func())

Trigger 用于触发事件

func TriggerOnSync

func TriggerOnSync(f func())

TriggerOnSync 用于触发事件, 同步触发

func TrimPathPrefix

func TrimPathPrefix(path, prefixPath string) string

TrimPathPrefix 去除目录的前缀

Types

This section is empty.

Jump to

Keyboard shortcuts

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