Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rinetd/transfer
Converts from one encoding to another. Supported formats HCL ⇄ JSON ⇄ YAML⇄TOML⇄XML⇄plist⇄pickle⇄properties ...
https://github.com/rinetd/transfer
bson config hcl json plist properties toml transfer yaml
Last synced: 3 months ago
JSON representation
Converts from one encoding to another. Supported formats HCL ⇄ JSON ⇄ YAML⇄TOML⇄XML⇄plist⇄pickle⇄properties ...
- Host: GitHub
- URL: https://github.com/rinetd/transfer
- Owner: rinetd
- License: apache-2.0
- Created: 2018-08-25T01:10:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-02T10:21:52.000Z (over 6 years ago)
- Last Synced: 2024-08-02T18:39:43.254Z (6 months ago)
- Topics: bson, config, hcl, json, plist, properties, toml, transfer, yaml
- Language: Go
- Homepage:
- Size: 592 KB
- Stars: 78
- Watchers: 3
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# transfer [![GoDoc](https://godoc.org/github.com/rinetd/transfer?status.png)](https://godoc.org/github.com/rinetd/transfer)[![Build Status](https://travis-ci.org/rinetd/transfer.svg?branch=master)](https://travis-ci.org/rinetd/transfer)
[中文文档](README.zh.md)
Converts from one encoding to another.
Supported formats HCL ⇄ JSON ⇄ YAML⇄TOML⇄XML⇄plist⇄pickle⇄properties ...
### install```
$ go get github.com/rinetd/transfer
```
### Download```
https://github.com/rinetd/transfer/releases
```### usage
```
usage:transfer [-f] [-s input.yaml] [-o 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 -o rientd/transfer .
```### examples
Convert data/input.yml TO data/input.json
$ transfer -f data/input.yaml (output "./data/input.json")```
$ transfer -f data/input.yaml out.json (output "./out.json")
$ transfer -f -s data/input.yaml -o /root/out.toml (output "/root/out.toml")
$ transfer -f -s data/input.yaml -o hcl (output "./data/input.hcl")
$ transfer -f -o yaml data/input.json (output "data/input.yaml")
```
```yaml
Author:
email: [email protected]
github: rinetd
menu:
main:
- Identifier: categories
Name: categories
Pre:
URL: /categories/
Weight: -102
- Identifier: tags
Name: tags
Pre:
URL: /tags/
Weight: -101
theme: hueman```
```json
{
"Author": {
"email": "[email protected]",
"github": "rinetd"
},
"menu": {
"main": [
{
"Identifier": "categories",
"Name": "categories",
"Pre": "",
"URL": "/categories/",
"Weight": -102
},
{
"Identifier": "tags",
"Name": "tags",
"Pre": "",
"URL": "/tags/",
"Weight": -101
}
]
},
"theme": "hueman"
}
``````hcl
$ transfer main.json main.hcl
```