-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented query marshalling to help with remote caching (#7)
* Implemented query marshalling to help with remote caching * Improved query marshalling, and prepared version 3 as API has changed
- Loading branch information
Showing
8 changed files
with
342 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
package caches | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
type Cacher interface { | ||
Get(key string) *Query | ||
Store(key string, val *Query) error | ||
// Get impl should check if a specific key exists in the cache and return its value | ||
// look at Query.Marshal | ||
Get(ctx context.Context, key string, q *Query[any]) (*Query[any], error) | ||
// Store is supposed to store a cached representation of the val param | ||
// look at Query.Unmarshal | ||
Store(ctx context.Context, key string, val *Query[any]) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.