A utility to pack and unpack the files and folders that could be transported easily with less overhead.
This utility is no different to other tools that are available to zip and unzip assets. But this has major highlights such as its support for adding metadata, versioning and support of remote backend(cloud storage) for the zipped file or folder with programmatic access.
Only unpacker can understand the binary generated by unpackker. Example on how to use client library can be found here. Doc on unpackker client library would give more insights on unpackker.
It is built with support of various other packages that are written in golang, predominantly bindata.
- Since there are no prebuilt libraries of Unpackker available, it expected that go to be pre installed on the machine to build one. Installing go can be found here.
go get -u github.com/nikhilsbhat/unpackker
go build
Use the executable just like any other go-cli application.
Found some of the codes useful? then start using it by importing the package in your line of codes.
import (
"github.com/nikhilsbhat/unpackker"
)
unpackker [command] [flags]
Make sure appropriate command is used for the actions, to check the available commands and flags use unpackker --help
Unpackker helps user to pack or unpack the asset and store at the designated backend.
Usage:
unpackker [command] [flags]
Available Commands:
generate Command to generate package of the specified asset
help Help about any command
version Command to fetch the version of unpackker installed
Flags:
-a, --asset string path to asset which needs to be packed
-c, --config string path where the config file exists (default ".")
-e, --environment string name of environment in which the asset is packed
-h, --help help for unpackker
-n, --name string name of the asset that has to be created
-p, --path string path where the asset has to be created
-v, --version string version the asset that needs to be packed
Use "unpackker [command] --help" for more information about a command."
There are multiple ways to pass parameters to unpackker-cli. This includes passing arguments to the flags while the cli is being invoked.
Even it supports config file, a file with all required parameters can be passed while invoking cli. It is a yaml file just like nay other tools seeks for.
The config file could be passed to -c
flag of cli. By default unpackker seeks for file .unpackker-config.yaml
in the directory where the cli was invoked.
unpackker generate -c path/to/config.yaml
Sample config can be found under example in the repo.
Note unpackker cli flags always takes higher precedence over the configs specified under .unpackker-config.yaml
.
Only unpackker's client library can understand the binary generated.
An example on how to use the unpackker's client library can be found here.
The command generate
helps in generating the binary of specified files or folders.
unpackker generate
Pass the required falgs or use the config file as specified earlier to generate the binaries of the required assets.
# Before executing the below command, the assumption is that/
# Config file is used for other parameters and we are just overriding path in the below example.
unpackker generate -p /path/to/asset
Currently it just supports few cloud storages as a remote backend. GCP and AWS are supported at the moment.
- Writing Tests
- API Reference Doc