Client application
Summary
Client application provides an interface to a client/server style data storage service. This application has four commands:
- get: download a file from a server,
- put: upload a file to the server,
- delete: delete a file from the server,
- list: show names of files stored in the server,
and all commands connect a set of data storage servers.
To specify address information of those servers, all commands receives a configuration file in YAML. The configuration file has one root element servers
and it takes a list of server information, which is an object consisting of two element address
and port
. The following example defines one server in a same network:
servers:
- address: 192.168.0.1
port: 13009
The default name of the configuration file is kvs.yml
but you can set another name via --config
flag.
Get command
$ kvs remote get --config kvs.yml --output result.dat <file name>
Get command download the given file name from the server defined in the configuration file, and stores it as the given file name via --output
flag.
If --config
flag is omitted, kvs.yml
is used, and if --output
flag is omitted, <file name>
is used.
To find available file names, use list command.
Put command
$ kvs remote put --config kvs.yml <file>
Put command reads the given file and uploads it to the server defined in the configuration file.
If --config
flag is omitted, kvs.yml
is used.
Delete command
$ kvs remote delete --config kvs.yml <file name>
Delete command deletes all shares associated with the given file name from all servers defined in the configuration file.
If --config
flag is omitted, kvs.yml
is used.
List command
$ sss remote list --config kvs.yml
List command shows all file names stored in the servers. If --config
flag is omitted, kvs.yml
is used.
Installation
If you’re a Homebrew user, you can install the client application by
$ brew tap itslab-kyushu/simple-kvs
$ brew install simple-kvs
Compiled binaries for some platforms are available on Github. To use these binaries, after downloading a binary to your environment, decompress and put it in a directory included in your $PATH.
You can also compile the client application by yourself. To compile it, you first download the code base:
$ git clone https://github.com/itslab-kyushu/simple-kvs $GOPATH/src/itslab-kyushu/simple-kvs
Then, build the client application kvs
:
$ cd $GOPATH/src/itslab-kyushu/simple-kvs/client
$ go get -d -t -v .
$ go build -o kvs
To build the command, Go > 1.7.4 is required.