scylladb / Go Reflectx
Licence: apache-2.0
Go reflection library to find struct field by its tag
Programming Languages
go 31211 projects - #10 most used programming language
Projects that are alternatives of or similar to Go Reflectx
Redis Tag CacheCache and invalidate records in Redis with tags
Stars: ✭ 48 (+152.63%)
Mutual labels: cache, tags
OnceA magic memoization function
Stars: ✭ 821 (+4221.05%)
Mutual labels: cache
OffixGraphQL Offline Client and Server
Stars: ✭ 694 (+3552.63%)
Mutual labels: cache
SmartsqlSmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Stars: ✭ 775 (+3978.95%)
Mutual labels: cache
XmemcachedHigh performance, easy to use multithreaded memcached client in java.
Stars: ✭ 715 (+3663.16%)
Mutual labels: cache
YacA fast, lock-free, shared memory user data cache for PHP
Stars: ✭ 782 (+4015.79%)
Mutual labels: cache
React Router Cache RouteRoute with cache for React-Router like <keep-alive/> in Vue
Stars: ✭ 677 (+3463.16%)
Mutual labels: cache
EdinoteNote taking web application for self-hosting. Offers tagging & Markdown support; can be used as a simple alternative to Evernote.
Stars: ✭ 17 (-10.53%)
Mutual labels: tags
Cleanmywechat自动删除 PC 端微信缓存数据,包括从所有聊天中自动下载的大量文件、视频、图片等数据内容,解放你的空间。
Stars: ✭ 816 (+4194.74%)
Mutual labels: cache
Gocache☔️ A complete Go cache library that brings you multiple ways of managing your caches
Stars: ✭ 775 (+3978.95%)
Mutual labels: cache
Vue Tags InputA tags input component for VueJS
Stars: ✭ 761 (+3905.26%)
Mutual labels: tags
DataloaderImplementation of Facebook's DataLoader in Golang
Stars: ✭ 703 (+3600%)
Mutual labels: cache
NgcNewGoCommand - An opinionated and lightweight project starter. (WORK IN PROGRESS)
Stars: ✭ 16 (-15.79%)
Mutual labels: tags
GhostdbGhostDB is a distributed, in-memory, general purpose key-value data store that delivers microsecond performance at any scale.
Stars: ✭ 690 (+3531.58%)
Mutual labels: cache
VimediacacheCache media file while play media using AVPlayer
Stars: ✭ 758 (+3889.47%)
Mutual labels: cache
SupA curses threads-with-tags style email client (mailing list: [email protected])
Stars: ✭ 780 (+4005.26%)
Mutual labels: tags
Django SitecatsDjango reusable application for content categorization.
Stars: ✭ 18 (-5.26%)
Mutual labels: tags
Reflectx
Package reflectx implements extensions to the standard reflect lib suitable for implementing marshalling and unmarshalling packages.
The main Mapper type allows for Go-compatible named attribute access, including accessing embedded struct attributes and the ability to use functions and struct tags to customize field names.
This is a standalone version of reflectx
package that originates from an SQL row to struct mapper sqlx.
We are using it at Scylla gocqlx for scanning of CQL results to structs and slices.
Example
This example demonstrates usage of the reflectx package to automatically bind URL parameters to a request model.
type RequestContext struct {
SessionID string `http:"sid"`
}
type SearchRequest struct {
RequestContext
Labels []string `http:"l"`
MaxResults int `http:"max"`
Exact bool `http:"x"`
}
func Search(w http.ResponseWriter, r *http.Request) {
// URL /search?sid=id&l=foo&l=bar&max=100&x=true
if err := r.ParseForm(); err != nil {
w.WriteHeader(http.StatusBadRequest)
return
}
var data SearchRequest
if err := bindParams(r, &data); err != nil {
w.WriteHeader(http.StatusBadRequest)
return
}
log.Printf("%+v", data) // "RequestContext:{SessionID:id} Labels:[foo bar] MaxResults:100 Exact:true}"
}
See the full example in example_test.go.
License
Copyright (C) 2019 ScyllaDB
This project is distributed under the Apache 2.0 license. See the LICENSE file for details.
It contains software from:
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at
[email protected].