jschoedt / go-firestorm Goto Github PK
View Code? Open in Web Editor NEWSimple Go ORM for Google/Firebase Cloud Firestore
License: MIT License
Simple Go ORM for Google/Firebase Cloud Firestore
License: MIT License
The link for go-firestorm User Group does not work, or rather I do not have access to it. Is it meant to be non-public or is something wrong?
Thanks again for an awesome project, @jschoedt!
The docs should mention that the library does not support Firestore in Datastore mode.
Hello,
thanks you for this simple and straightforward package!
I'm successfully using in one of my current projects. The DB interface works perfectly fine, however I have difficulties getting the caching layer to work.
I have written a little middleware that injects the CacheHandler
.
func CacheMiddleware(next http.Handler) http.Handler {
return firestorm.CacheHandler(next.ServeHTTP)
}
and adding it to my router (go-chi):
r.Use(db.CacheMiddleware)
r.Get("/", indexHandler)
From each of my HTTP handlers, I'm then passing the context onto the db functions:
func countryHandler(w http.ResponseWriter, r *http.Request) {
...
countryData, err := LoadCountryData(r.Context())
if err != nil {
log.Printf("Failed to load data: %s", err)
http.Error(w, "Internal Server Error", 500)
return
}
...
}
// var Client *firestorm.FSClient was initialized somewhere else
func LoadCountryData(ctx context.Context) (*types.Country, error) {
var c = &types.Country{ID: slug}
_, err := Client.NewRequest().SetLoadPaths(firestorm.AllEntities).GetEntities(ctx, c)()
if IsNotFoundError(err) {
return nil, nil
} else if err != nil {
return nil, err
}
return c, nil
}
Nevertheless, I still get the message "Warning. Consider adding the CacheHandler middleware for the session cache to work" and subsequent database calls don't seem to be faster.
Am I using the cache (in)correctly? Is there a way I can verify its behavior?
Hello ๐
Thank you for an excellent library! I've had some issues with panic: reflect: call of reflect.Value.NumField on zero Value
.
Guessing it's caused by passing empty/nilled fields? Any tips to how I can fix it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.