transfer

command module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

README

transfer GoDocBuild Status

Converts from one encoding to another. Supported formats HCL ⇄ JSON ⇄ YAML⇄TOML⇄XML⇄plist⇄pickle⇄properties ...

install
$ go get github.com/rinetd/transfer
usage
usage:

	transfer [-f] [-s input.yaml] [-t output.json] /path/to/input.yaml [/path/to/output.json]

Converts from one encoding to another. Supported formats (and their file extensions):

	- JSON (.json)
	- TOML (.toml)
	- YAML (.yaml or .yml)
	- HCL (.hcl or .tf)
	- XML (.xml)
	- MSGPACK (.msgpack)
	- PLIST (.plist)
	- BSON (.bson)
	- PICKLE (.pickle)
	- PROPERTIES (.prop or .props or .properties)

docker usage
# build the transfer image
docker build -t rientd/transfer .
examples

Convert data/main.yml TO data/main.json

$ transfer -f data/main.yaml        (default output `json` format)
$ transfer -f data/main.yaml data/main.json
$ transfer -f -t json data/main.yaml
$ transfer -f -s data/main.yaml     (default output `json` format)
$ transfer -f -s data/main.yaml -t json 
$ transfer -f -s data/main.yaml -t data/main.json 
Author:
  email: rinetd@163.com
  github: rinetd
menu:
  main:
  - Identifier: categories
    Name: categories
    Pre: <i class='fa fa-category'></i>
    URL: /categories/
    Weight: -102
  - Identifier: tags
    Name: tags
    Pre: <i class='fa fa-tags'></i>
    URL: /tags/
    Weight: -101
theme: hueman

{
	"Author": {
		"email": "rinetd@163.com",
		"github": "rinetd"
	},
	"menu": {
		"main": [
			{
				"Identifier": "categories",
				"Name": "categories",
				"Pre": "<i class='fa fa-category'></i>",
				"URL": "/categories/",
				"Weight": -102
			},
			{
				"Identifier": "tags",
				"Name": "tags",
				"Pre": "<i class='fa fa-tags'></i>",
				"URL": "/tags/",
				"Weight": -101
			}
		]
	},
	"theme": "hueman"
}
$ transfer main.json main.hcl

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package object was forked from: https://github.com/koding/koding/blob/4e0b75243e60685f3271838d2eb08bd3801fae48/go/src/koding/kites/kloud/utils/object/fix.go
Package object was forked from: https://github.com/koding/koding/blob/4e0b75243e60685f3271838d2eb08bd3801fae48/go/src/koding/kites/kloud/utils/object/fix.go

Jump to

Keyboard shortcuts

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