Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/likebike/jsonface

Package jsonface enables JSON Unmarshalling into Go Interfaces. This enables you to isolate your data type design from your deserialization logic. When writing Go programs, I often want to create types that contain interface members like this: ...But if I want to serialize/deserialize a BandMember using JSON, I'm going to have a bit of a problem because Go's json package can't unmarshal into an interface. Therefore, I need to define some custom unmarshalling logic at the BandMember level. This is not ideal, since the logic should really belong to Instrument, not BandMember. It becomes especially problematic if I have other data types that also contain Instrument members because then the unmarshalling complexity spreads there too! This jsonface package enables me to define the unmarshalling logic at the Instrument level, avoiding the leaky-complexity described above. Also note, the example above just shows a very simple interface struct field, but jsonface is very general; It can handle any data structure, no matter how deep or complex. See the included examples for more usage information.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/likebike/jsonface
Keywords: go, golang, json, serialization
License: MIT
Latest release: over 4 years ago
First release: over 4 years ago
Namespace: github.com/likebike
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 26 days ago

    Loading...
    Readme
    Loading...