Giter Site home page Giter Site logo

dcode's Introduction

dcode

Note: this library is a work in progress. I'd love for you to try it! If you do find issues, please file an issue. Happy hacking!

This repository lets you decode JSON objects using a functional API. It aims to help you solve these two cases in your everyday programming life:

  1. When you don't know the "shape" of the JSON ahead of time
  2. When you know there's a huge JSON object coming in, but you only need to get a few values out of it

To accomplish the first case without dcode, you'd usually decode the JSON into a map[string]interface{}, and then deal with the untyped interface{} values as you traverse your way down into the map to get the value you want.

To accomplish the second case without dcode, you'd usually write a struct so that you can decode the values you want, and that's boilerplate code. If the value you want is deeply nested inside the object, this leads to a lot of boilerplate as you build nested structs out.

Interesting? Cool! Check out USAGE.md for details on using this library.

Notes

This library follows patterns from the Elm language JSON decoding library.

dcode's People

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.