Generic templating tool with support of JSON, YAML and TOML data

gotempl

Small binary used to generate files from Go Templates and data files.

The following formats are supported:

  • JSON
  • YAML
  • TOML

Usage

usage: gotempl [-h|--help] -t|--template "<value>" -d|--data "<value>"
               [-f|--format "<value>"] [-o|--output "<value>"]

               Generic templating tool

Arguments:

  -h  --help      Print help information
  -t  --template  Path to Go Template file
  -d  --data      Path to data file to use for templating
  -f  --format    Format of data file (json, yaml or toml, defaults to json).
                  Default: json
  -o  --output    Path to output file (leave empty for stdout). Default:

License

This project is released under the terms of the MIT License.

Similar Resources

TOML parser for Golang with reflection.

THIS PROJECT IS UNMAINTAINED The last commit to this repo before writing this message occurred over two years ago. While it was never my intention to

Jan 6, 2023

Go library for the TOML language

go-toml Go library for the TOML format. This library supports TOML version v1.0.0-rc.3 Features Go-toml provides the following features for using data

Dec 27, 2022

A better way to marshal and unmarshal YAML in Golang

YAML marshaling and unmarshaling support for Go Introduction A wrapper around go-yaml designed to enable a better way of handling YAML when marshaling

Jan 4, 2023

Go-config - Config parser for go that supports environment vars and multiple yaml files

go-multiconfig This package is able to parse yaml config files. It supports gett

Jun 23, 2022

create a bootable disk image from Docker image or a yaml config

docker2boot docker2boot creates a bootable disk from either a Docker image or a config yaml file Features status dns Y cloud-init Y network Y ssh TODO

Oct 30, 2022

It syncronizes the configuration described in a YAML file against your GitHub Organization

It syncronizes the configuration described in a YAML file against your GitHub Organization. Combined with a CI system, it can be used to implement GitOps for GitHub.

Jul 19, 2021

Golang config.yaml loader

Description goconfig is a configuration library designed using the following pri

May 31, 2022

SmartYAML - Go package to handle YAML

SmartYAML - Go package to handle YAML The smartyaml is a go package to handle parsed YAML files more confortable. This package is not a parser, it use

Feb 25, 2022

VINYL Inscribes Nettlesome YAML Legibly

VINYL Inscribes Nettlesome YAML Legibly VINYL formats yaml files into a canonical format retaining comments and setting the indentation by default to

Jan 18, 2022
Comments
  • :sparkles: :boom: Add flag to switch from TEXT to HTML template

    :sparkles: :boom: Add flag to switch from TEXT to HTML template

    This PR provides the following changes:

    • [x] :sparkles: Add new internal package template, abstracting the builtin packages html/template and text/template
    • [x] :recycle: Refactor io package to use this new internal package
    • [x] :sparkles: Add -H / --html flag to switch implementation
    • [x] :boom: Make the text implementation the default

    Examples

    With the text implementation, the following template:

    $ cat <<EOF | gotempl
    {{ dict "foo" "bar" | toJson }}
    EOF
    

    Will produce:

    {"foo":"bar"}
    

    But with the HTML implementation, the same template:

    $ cat <<EOF | gotempl -H
    {{ dict "foo" "bar" | toJson }}
    EOF
    

    Will produce:

    {&#34;foo&#34;:&#34;bar&#34;}
    

    This was the default behavior until now, but this is obviously unexpected. Adding a function noescape would only clutter the template sources.

  • 🐛 Set stdin/stdout as default file for template/output

    🐛 Set stdin/stdout as default file for template/output

    This PR aims to setup stdin/stdout to template/output argument when avoided.

    Actual Behavior

    STDIN/STDOUT ignored by default

    Desired Behavior

    STDIN/STDOUT used for template/output by default

    Changes

    • [x] set stdin as default template
    • [x] set stdout as default output
  • ✨ Add optional data files

    ✨ Add optional data files

    This PR aims to add optional data files arguments in the form --data-<format>

    • [x] : ✨ optional data file arguments
    • [x] : ✨ optional template argument (stdin by default)
    • [x] : 👕 apply best-practices
    • [x] : ✅ test coverage
Golang Configuration tool that support YAML, JSON, TOML, Shell Environment

Configor Golang Configuration tool that support YAML, JSON, TOML, Shell Environment (Supports Go 1.10+) Usage package main import ( "fmt" "github.c

Dec 29, 2022
Light weight, extensible configuration management library for Go. Built in support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.
Light weight, extensible configuration management library for Go. Built in support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.

koanf (pronounced conf; a play on the Japanese Koan) is a library for reading configuration from different sources in different formats in Go applicat

Jan 8, 2023
Tmpl - A tool to apply variables from cli, env, JSON/TOML/YAML files to templates

tmpl allows to apply variables from JSON/TOML/YAML files, environment variables or CLI arguments to template files using Golang text/template and functions from the Sprig project.

Nov 14, 2022
Library providing routines to merge and validate JSON, YAML and/or TOML files
Library providing routines to merge and validate JSON, YAML and/or TOML files

CONFLATE Library providing routines to merge and validate JSON, YAML, TOML files and/or structs (godoc) Typical use case: Make your application config

Sep 26, 2022
Go-yaml - Yaml parsing Toolkit For Golang

go-yaml 介绍 gopkg.in/yaml.v3 已经是个非常好用的包,但是在实际开发中总有类型转换带来的麻烦,go-yaml只是在它的基础上,简单的一层

Jan 13, 2022
YAML support for the Go language.

YAML support for the Go language Introduction The yaml package enables Go programs to comfortably encode and decode YAML values. It was developed with

Jan 8, 2023
YAML support for the Go language
YAML support for the Go language

YAML support for the Go language

Dec 31, 2022
Golang library for reading properties from configuration files in JSON and YAML format or from environment variables.

go-config Golang library for reading properties from configuration files in JSON and YAML format or from environment variables. Usage Create config in

Aug 22, 2022
TOML parser and encoder library for Golang

TOML parser and encoder library for Golang TOML parser and encoder library for Golang. This library is compatible with TOML version v0.4.0. Installati

Oct 11, 2022
JSON or YAML configuration wrapper with convenient access methods.

Config Package config provides convenient access methods to configuration stored as JSON or YAML. This is a fork of the original version. This version

Dec 16, 2022