Skip to content

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

jarrodhroberson/retag

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retag TravisCI GoDoc Go Report Card codecov

This is a fork of github.com/sevlyar/retag.

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).

Installation

go get github.com/jarrodhroberson/retag

You can use gopkg.in:

go get gopkg.in/jarrodhroberson/retag.v0

Documentation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%