We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a flexible cache for event queries.
package example import ( "github.com/modernice/goes/event" "github.com/modernice/goes/event/query" ) func example(store event.Store, q event.Query) { cache := query.NewCache(store) result, err := cache.Result(context.TODO(), q) // handle err if result.Cached { log.Println("cache returned cached result") } else { log.Println("cache executed query") } events, err := streams.Drain(context.TODO(), result.Events, result.Errs) // handle err // alternatively str, errs, err := cache.Run(context.TODO(), q) // handle err events, err := streams.Drain(context.TODO(), str, errs) }
The text was updated successfully, but these errors were encountered:
This would allow for an aggregate cache:
package example func example(repo aggregate.Repository) { cached := repository.Cached(repo) var foo aggregate.Aggregate err := cached.Fetch(context.TODO(), foo) }
Sorry, something went wrong.
No branches or pull requests
Implement a flexible cache for event queries.
Features
Examples
Basic usage
The text was updated successfully, but these errors were encountered: