Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sevlyar/retag
Change tags of structures' fields in runtime without copying of data in Go. Conditional marshalling and unmarshalling.
https://github.com/sevlyar/retag
go golang library struct tags
Last synced: 8 days ago
JSON representation
Change tags of structures' fields in runtime without copying of data in Go. Conditional marshalling and unmarshalling.
- Host: GitHub
- URL: https://github.com/sevlyar/retag
- Owner: sevlyar
- License: mit
- Created: 2016-11-22T13:29:32.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-19T20:17:31.000Z (8 months ago)
- Last Synced: 2024-10-15T20:08:48.201Z (24 days ago)
- Topics: go, golang, library, struct, tags
- Language: Go
- Homepage:
- Size: 21.5 KB
- Stars: 61
- Watchers: 3
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Retag [![TravisCI](https://api.travis-ci.org/sevlyar/retag.svg)](https://travis-ci.org/sevlyar/retag) [![GoDoc](https://godoc.org/github.com/sevlyar/retag?status.svg)](https://godoc.org/github.com/sevlyar/retag) [![Go Report Card](https://goreportcard.com/badge/github.com/sevlyar/retag)](https://goreportcard.com/report/github.com/sevlyar/retag) [![codecov](https://codecov.io/gh/sevlyar/retag/branch/master/graph/badge.svg)](https://codecov.io/gh/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](https://godoc.org/github.com/sevlyar/retag#example-package--Snaker) 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](http://labix.org/gopkg.in):
go get gopkg.in/sevlyar/retag.v0
## Documentation
Please see [godoc.org/github.com/sevlyar/retag](https://godoc.org/github.com/sevlyar/retag)