Git Product home page Git Product logo

go-human's Introduction

go-human

license GoDoc Build Status codecov Go Report Card

go-human is a Go library for struct to human-readable text encoding. This library is maintained by the Anexia R&D team.

Motivation

The primary motivation behind creating go-human as the need for a human-readable text encoder for arbitrary Go objects which can be used as a drop-in replacement for Go's encoding/json encoder.

The story behind how go-human came to be

The idea arose during development of an internal project, which provides a CLI binary for management purposes of a larger overall system. Initially the CLI binary was intended as a tool for human interaction with said system, but it soon became clear that some operations would need to be automated. Due to this need the tool would need to be able to output JSON, as well as a human-readable representation of the information retrieved via the API it communicated with.

In order to minimize the code required to fulfill both of these requirements we created go-human and are now using a commandline flag which configures the output mode. Behind the scenes both the JSON and go-human encoders implement the same interface, which in turn allowed us to have a single switch in the application which affects all output generated by it.

Format

The text format go-human generates is loosely based on YAML, but with the distinction that this format was never intended to be parsed by a machine.

Please note that the exact format is intentionally not defined formally and parsing of text generated by this library is strongly discouraged.

Examples

Examples can be found in the package documentation at godoc.org.

The corresponding code can be found in go-human's GitHub repository inside the example_test.go file.

Install

With a correctly configured Go toolchain:

go get -u github.com/anexia-it/go-human

Issue tracker

Issues in go-human are tracked using the corresponding GitHub project's issue tracker.

Status

The current release is v1.0.0.

Changes to go-human are subject to semantic versioning.

The ChangeLog provides information on releases and changes.

License

go-human is licensed under the terms of the MIT license.

go-human's People

Contributors

speijnik avatar x4mp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.