Documentation ¶
Index ¶
- Constants
- Variables
- func Account(cmd *cobra.Command, params []string)
- func AliListBucket(cmd *cobra.Command, params []string)
- func Base64Decode(cmd *cobra.Command, params []string)
- func Base64Encode(cmd *cobra.Command, params []string)
- func BatchChgm(cmd *cobra.Command, params []string)
- func BatchChtype(cmd *cobra.Command, params []string)
- func BatchCopy(cmd *cobra.Command, params []string)
- func BatchDelete(cmd *cobra.Command, params []string)
- func BatchDeleteAfterDays(cmd *cobra.Command, params []string)
- func BatchFetch(cmd *cobra.Command, params []string)
- func BatchMove(cmd *cobra.Command, params []string)
- func BatchRename(cmd *cobra.Command, params []string)
- func BatchSign(cmd *cobra.Command, params []string)
- func BatchStat(cmd *cobra.Command, params []string)
- func CdnPrefetch(cmd *cobra.Command, params []string)
- func CdnRefresh(cmd *cobra.Command, params []string)
- func ChStatus(cmd *cobra.Command, params []string)
- func ChUser(cmd *cobra.Command, params []string)
- func Chgm(cmd *cobra.Command, params []string)
- func Chtype(cmd *cobra.Command, params []string)
- func CleanUser(cmd *cobra.Command, params []string)
- func Copy(cmd *cobra.Command, params []string)
- func CreateRandString(num int) (rcode string)
- func Date2Timestamp(cmd *cobra.Command, params []string)
- func Delete(cmd *cobra.Command, params []string)
- func DeleteAfterDays(cmd *cobra.Command, params []string)
- func DirCache(cmd *cobra.Command, params []string)
- func Fetch(cmd *cobra.Command, params []string)
- func Fop(cmd *cobra.Command, params []string)
- func FormPut(cmd *cobra.Command, params []string)
- func FormatFsize(fsize int64) (result string)
- func Get(cmd *cobra.Command, params []string)
- func GetBuckets(cmd *cobra.Command, params []string)
- func GetDomainsOfBucket(cmd *cobra.Command, params []string)
- func IpQuery(cmd *cobra.Command, params []string)
- func ListBucket(cmd *cobra.Command, params []string)
- func ListBucket2(cmd *cobra.Command, params []string)
- func ListUser(cmd *cobra.Command, params []string)
- func LookUp(cmd *cobra.Command, params []string)
- func M3u8Delete(cmd *cobra.Command, params []string)
- func M3u8Replace(cmd *cobra.Command, params []string)
- func Move(cmd *cobra.Command, params []string)
- func NewCmdAsyncCheck() *cobra.Command
- func NewCmdAsyncFetch() *cobra.Command
- func NewCmdAwsFetch() *cobra.Command
- func NewCmdAwsList() *cobra.Command
- func OnInitialize(f ...func())
- func ParseLine(line, sep string) []string
- func Prefetch(cmd *cobra.Command, params []string)
- func Prefop(cmd *cobra.Command, params []string)
- func PrivateUrl(cmd *cobra.Command, params []string)
- func QBoxToken(cmd *cobra.Command, args []string)
- func Qetag(cmd *cobra.Command, params []string)
- func QiniuDownload(cmd *cobra.Command, params []string)
- func QiniuToken(cmd *cobra.Command, args []string)
- func QiniuUpload(cmd *cobra.Command, params []string)
- func QiniuUpload2(cmd *cobra.Command, params []string)
- func ReqId(cmd *cobra.Command, params []string)
- func ResumablePut(cmd *cobra.Command, params []string)
- func RmUser(cmd *cobra.Command, params []string)
- func RpcDecode(cmd *cobra.Command, params []string)
- func RpcEncode(cmd *cobra.Command, params []string)
- func Saveas(cmd *cobra.Command, params []string)
- func Stat(cmd *cobra.Command, params []string)
- func Sync(cmd *cobra.Command, params []string)
- func Timestamp2Date(cmd *cobra.Command, params []string)
- func TimestampMilli2Date(cmd *cobra.Command, params []string)
- func TimestampNano2Date(cmd *cobra.Command, params []string)
- func Unzip(cmd *cobra.Command, params []string)
- func UploadToken(cmd *cobra.Command, args []string)
- func Urldecode(cmd *cobra.Command, params []string)
- func Urlencode(cmd *cobra.Command, params []string)
- func UserAgent() string
- type IpData
- type IpInfo
- type PutRet
Constants ¶
const ( // CDN刷新一次性最大的刷新文件列表 BATCH_CDN_REFRESH_URLS_ALLOW_MAX = 50 // CDN目录刷新一次性最大的刷新目录数 BATCH_CDN_REFRESH_DIRS_ALLOW_MAX = 10 // 预取一次最大的预取数目 BATCH_CDN_PREFETCH_ALLOW_MAX = 50 )
const ( KB = 1024 MB = 1024 * KB GB = 1024 * MB TB = 1024 * GB )
const (
// ASCII英文字母
ALPHA_LIST = "abcdefghijklmnopqrstuvwxyz"
)
const (
BATCH_ALLOW_MAX = 1000
)
const (
// IP信息查询接口地址
TAOBAO_IP_QUERY = "http://ip.taobao.com/service/getIpInfo.php"
)
Variables ¶
var ( // 开启命令行的调试模式 DebugFlag bool DeepDebugInfo bool // qshell 版本信息, qshell -v VersionFlag bool )
var RePutCmd = &cobra.Command{ Use: "rput <Bucket> <Key> <LocalFile>", Short: "Resumable upload a local file", Args: cobra.ExactArgs(3), Run: ResumablePut, }
var RootCmd = &cobra.Command{
Use: "qshell",
Short: "Qiniu commandline tool for managing your bucket and CDN",
Version: version,
BashCompletionFunction: bash_completion_func,
}
cobra root cmd, all other commands is children or subchildren of this root cmd
Functions ¶
func AliListBucket ¶
【alilistbucket】列举阿里空间中的文件列表
func BatchChtype ¶
批量修改存储在七牛存储空间中文件的存储类型信息(标准存储-》低频存储,低频-》标准存储)
func BatchDeleteAfterDays ¶
批量设置七牛存储空间中的删除标志(多少天后删除)
func DeleteAfterDays ¶
【expire】给存储在七牛空间中的文件设置删除属性,设置以后,到指定时间会自动删除该文件
func GetDomainsOfBucket ¶
【domains】获取一个空间绑定的CDN域名
func ListBucket2 ¶
【listbucket2】 使用v2接口列举存储空间中的文件
func M3u8Delete ¶
【m3u8delete】删除m3u8文件,包括m3u8文件本身和分片文件
func M3u8Replace ¶
【m3u8replace】替换m3u8文件中的域名信息
func NewCmdAsyncFetch ¶
NewCmdAsyncFetch 返回一个cobra.Command指针 该命令使用七牛异步抓取的接口
func NewCmdAwsList ¶
NewCmdAwsList 返回一个cobra.Command指针 该命令列举亚马逊存储空间中的文件, 会忽略目录
func OnInitialize ¶
func OnInitialize(f ...func())
func PrivateUrl ¶
【privateurl】打印七牛私有空间的文件的下载链接(私有空间的文件下载去要鉴权验证)
func QiniuDownload ¶
【qdownload】下载七牛存储空间中的文件 可以根据文件前缀下载符合要求的所有文件,也可以用户给到要下载的文件名字列表下载文件 根据文件列表下载文件功能在文档中还没有公开,遇到有这个需求的客户比较少
func QiniuToken ¶
签名七牛token, 一般三鉴接口需要http头文件 Authorization, 这个头的值就是qiniuToken
func QiniuUpload ¶
[qupload]命令, 上传本地文件到七牛存储中 该命令会读取配置文件, 上传本地文件系统的文件到七牛存储中; 可以设置多线程上传,默认的线程区间在[iqshell.MIN_UPLOAD_THREAD_COUNT, iqshell.MAX_UPLOAD_THREAD_COUNT]
func QiniuUpload2 ¶
【qupload2】和命令【qupload】的功能一样,只是使用的是命令选项的方式提供配置信息
func ResumablePut ¶
使用分片上传本地文件到七牛存储空间, 一般用于较大文件的上传 文件会被分割成4M大小的块, 一块一块地上传文件
func TimestampMilli2Date ¶
转化毫秒时间戳到人工可读的字符串
func TimestampNano2Date ¶
转化纳秒时间戳到人工可读的字符串
Types ¶
type IpData ¶
type IpData struct { Country string `json:"country"` CountryId string `json:"country_id"` Area string `json:"area"` AreaId string `json:"area_id"` Region string `json:"region"` RegionId string `json:"region_id"` City string `json:"city"` CityId string `json:"city_id"` County string `json:"county"` CountyId string `json:"county_id"` Isp string `json:"isp"` IspId string `json:"isp_id"` Ip string `json:"ip"` }
ip 具体的信息