cmdutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 14 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.

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.

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 ChWorkDir

func ChWorkDir()

ChWorkDir 切换回工作目录

func ContainsString

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

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

func ConvertToUnixPathSeparator

func ConvertToUnixPathSeparator(p string) string

ConvertToUnixPathSeparator 将 windows 目录分隔符转换为 Unix 的

func DecompressGZIP

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

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

func Executable

func Executable() string

Executable 获取程序所在的真实目录或真实相对路径

func ExecutablePath

func ExecutablePath() string

ExecutablePath 获取程序所在目录

func ExecutablePathJoin

func ExecutablePathJoin(subPath string) string

ExecutablePathJoin 返回程序所在目录的子目录

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 IsIPhoneOS

func IsIPhoneOS() bool

IsIPhoneOS 是否为苹果移动设备

func IsPipeInput

func IsPipeInput() bool

func ListAddresses added in v0.1.0

func ListAddresses() (addresses []string)

ListAddresses 列出本地可用的 IP 地址

func ParseHost added in v0.1.0

func ParseHost(address string) string

ParseHost 解析地址中的host

func Trigger

func Trigger(f func())

Trigger 用于触发事件

func TriggerOnSync

func TriggerOnSync(f func())

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

func TrimPathPrefix

func TrimPathPrefix(path, prefixPath string) string

TrimPathPrefix 去除目录的前缀

func WalkDir

func WalkDir(dirPth, suffix string) (files []string, err error)

WalkDir 获取指定目录及所有子目录下的所有文件,可以匹配后缀过滤。 支持 Linux/macOS 软链接

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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