Skip to content
/ retag Public
forked from sevlyar/retag

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

admpub/retag

 
 

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%