1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-22 20:09:34 +00:00

Vai encoding benchmark (#742)

Also includes some misc changes.
This commit is contained in:
Alejandro Ruiz
2025-09-17 09:33:33 +02:00
committed by GitHub
parent bb31fd8626
commit 8e294f7a0b
4 changed files with 338 additions and 2 deletions

View File

@@ -79,13 +79,17 @@ var _ cache.Store = (*Store)(nil)
// NewStore creates a SQLite-backed cache.Store for objects of the given example type
func NewStore(ctx context.Context, example any, keyFunc cache.KeyFunc, c db.Client, shouldEncrypt bool, gvk schema.GroupVersionKind, name string, externalUpdateInfo *sqltypes.ExternalGVKUpdates, selfUpdateInfo *sqltypes.ExternalGVKUpdates) (*Store, error) {
exampleType := reflect.TypeOf(example)
if exampleType.Kind() != reflect.Ptr {
exampleType = reflect.PointerTo(exampleType).Elem()
}
s := &Store{
ctx: ctx,
name: name,
gvk: gvk,
externalUpdateInfo: externalUpdateInfo,
selfUpdateInfo: selfUpdateInfo,
typ: reflect.TypeOf(example),
typ: exampleType,
Client: c,
keyFunc: keyFunc,
shouldEncrypt: shouldEncrypt,