nedscode / memdb Goto Github PK
View Code? Open in Web Editor NEWThe memdb library is an in-memory indexable store for go structs. Like a database, but in memory.
License: GNU Lesser General Public License v3.0
The memdb library is an in-memory indexable store for go structs. Like a database, but in memory.
License: GNU Lesser General Public License v3.0
Items that have not been accessed yet after creation are instantly expiring at the next tick of the expiration function when the InUseExpirer has been initialised with an access expiry interval.
This is because the item has the last accessed time of zero time, which is a long-long time ago.
In the case where there's not a last accessed time, it should use modified or created time, whichever is more recent. In the case where there's no modified time, it should use created time.
Simply run example/main.go and panic at indexer := mdb.Get(&car{Make: "Kia", Model: "Rio"}).(*car)
panic: interface conversion: interface {} is nil, not *main.car
mdb := memdb.NewStore().
CreateIndex("id").
CreateIndex("project")
mdb.CreateIndex("id").Unique()
...
ds := mdb.In("project").Lookup(p)
for d := range ds {
log.Info(ds[d])
}
...
I hope to export the result sort by "id" field, how to do ?
what is the preferred way to get a slice of all the structs that was put into mdb?
thanks.
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.