Skip to content

miratronix/lingo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lingo

A basic collection of encoding/decoding packages and tools.

Usage

Lingo ships with three encodings, all of which use the standard json struct tag:

  • JSON:
import "github.com/miratronix/lingo"
e := lingo.JSON

// Encode a structure as bytes, using the 'json' struct tag
bytes, err := e.Encode(someStructure)

// Decode bytes into a structure, using the 'json' struct tag
err := e.Decode(bytes, &someStructure)
  • Message Pack:
import "github.com/miratronix/lingo"
e := lingo.MessagePack

// Encode a structure as bytes, using the 'json' struct tag
bytes, err := e.Encode(someStructure)

// Decode bytes into a structure, using the 'json' struct tag
err := e.Decode(bytes, &someStructure)
  • Map:
import "github.com/miratronix/lingo"
e := lingo.Map

// Encode a structure into a map, using the 'json' struct tag
mapped := e.Encode(&someStructure)

// Decode a map into a structure, using the 'json' struct tag
err := e.Decode(someMap, &someStructure)

About

A basic collection of encoding/decoding tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages