Skip to content
/ retag Public

Change tags of structures' fields in runtime without copying of data in Go. Conditional marshalling and unmarshalling.

License

Notifications You must be signed in to change notification settings

sevlyar/retag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retag TravisCI GoDoc Go Report Card codecov

Package retag provides an ability to change tags of structures' fields in runtime without copying of the data. It may be helpful in next cases:

  • Automatic tags generation;
  • Different views of the one data;
  • Fixing of leaky abstractions with minimal boilerplate code when application has layers of abstractions and model is separated from storages and presentation layers.

Please see examples in documentation for details.

Features:

  • No memory allocations (for cached types);
  • Fast converting (lookup in table and pointer creation for cached types);
  • Works with complex and nested types (e.g. map[struct]*struct).

The package requires go1.7+.

Installation

go get github.com/sevlyar/retag

You can use gopkg.in:

go get gopkg.in/sevlyar/retag.v0

Documentation

Please see godoc.org/github.com/sevlyar/retag

About

Change tags of structures' fields in runtime without copying of data in Go. Conditional marshalling and unmarshalling.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages