qnctl

command module
v0.0.0-...-930c3b4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2016 License: MIT Imports: 14 Imported by: 0

README

qnctl build status

Built on the official library qiniupkg.com/api.v7/kodo, lightweight and friendly.

Supported operations:

  • add
  • rm
  • ls
  • stat
  • sync
Installation
make
cp qnctl /usr/bin/      # optional
Usage
Set Up Qiniu Keys

There are two ways to do that. Export QINIU_AK, QINIU_SK and QINIU_BUCKET

export QINIU_AK=abcd...
export QINIU_SK=dcba...
export QINIU_BUCKET=test

Or create a JSON file like

$ cat config.json
{
    "access_key": "abcd...",
    "secret_key": "dcba..."
}

$ qnctl -c config.json -b test ls images
add

If the first argument after add does not end with /, it would be the exact key. Otherwise, the key to save would be the concatenation of the first argument and the basename of the second argument.

$ qnctl add images/001.png path/to/001.png
$ qnctl add images/ path/to/001.png         # same as previous

# Save to another key
$ qnctl add images/002.png path/to/001.png

# Add multiple
$ qnctl add images/ path/to/*.png

# DON'T DO
$ qnctl add images path/to/001.png
$ qnctl add images path/to/*.png
rm

Delete one objects.

$ qnctl rm images/001.png
ls

List objects that match the prefix. Wildcard is not supported.

$ qnctl ls images/
    326842  2016-01-27 03:06:16  images/001.png
    140797  2016-01-27 03:06:16  images/002.png
       983  2016-01-27 03:06:16  images/003.png
stat

Return status of one object.

$ qnctl stat images/001.png
      Key: images/001.png
     Hash: FiBrvrIq6fUvc4p0BR9ZfNmILym1
     Size: 326842
Mime Type: image/png
 Put Time: 2016-01-27 03:06:16 +0800 CST
 End User: 
sync

Refresh CDN cache.

$ qnctl sync http://your-domain.qiniudns.com/key1 http://your-domain.qiniudns.com/key2

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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