factory

package
v0.6.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Overview

Package factory provides a cache factory for the sql-based cache.

Package factory is a generated GoMock package.

Index

Constants

View Source
const EncryptAllEnvVar = "CATTLE_ENCRYPT_CACHE_ALL"

EncryptAllEnvVar is set to "true" if users want all types' data blobs to be encrypted in SQLite otherwise only variables in defaultEncryptedResourceTypes will have their blobs encrypted

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	informer.ByOptionsLister
}

type CacheFactory

type CacheFactory struct {
	// contains filtered or unexported fields
}

CacheFactory builds Informer instances and keeps a cache of instances it created

func NewCacheFactory

func NewCacheFactory(opts CacheFactoryOptions) (*CacheFactory, error)

NewCacheFactory returns an informer factory instance This is currently called from steve via initial calls to `s.cacheFactory.CacheFor(...)`

func (*CacheFactory) CacheFor

func (f *CacheFactory) CacheFor(ctx context.Context, fields [][]string, externalUpdateInfo *sqltypes.ExternalGVKUpdates, transform cache.TransformFunc, client dynamic.ResourceInterface, gvk schema.GroupVersionKind, namespaced bool, watchable bool) (Cache, error)

CacheFor returns an informer for given GVK, using sql store indexed with fields, using the specified client. For virtual fields, they must be added by the transform function and specified by fields to be used for later fields.

func (*CacheFactory) Reset

func (f *CacheFactory) Reset() error

Reset closes the stopCh which stops any running informers, assigns a new stopCh, resets the GVK-informer cache, and resets the database connection which wipes any current sqlite database at the default location.

type CacheFactoryOptions added in v0.6.9

type CacheFactoryOptions struct {
	// DefaultMaximumEventsCount is the maximum number of events to keep in
	// the events table by default.
	//
	// Use PerGVKMaximumEventsCount if you want to set a different value for
	// a specific GVK.
	//
	// A value of 0 means no limits.
	DefaultMaximumEventsCount int
	// PerGVKMaximumEventsCount is the maximum number of events to keep in
	// the events table for specific GVKs.
	//
	// A value of 0 means no limits.
	PerGVKMaximumEventsCount map[schema.GroupVersionKind]int
}

type MockTXClient added in v0.5.7

type MockTXClient struct {
	// contains filtered or unexported fields
}

MockTXClient is a mock of Client interface.

func NewMockTXClient added in v0.5.7

func NewMockTXClient(ctrl *gomock.Controller) *MockTXClient

NewMockTXClient creates a new mock instance.

func (*MockTXClient) EXPECT added in v0.5.7

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTXClient) Exec added in v0.5.7

func (m *MockTXClient) Exec(query string, args ...any) (sql.Result, error)

Exec mocks base method.

func (*MockTXClient) Stmt added in v0.5.7

func (m *MockTXClient) Stmt(stmt *sql.Stmt) transaction.Stmt

Stmt mocks base method.

type MockTXClientMockRecorder added in v0.5.7

type MockTXClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockTXClientMockRecorder is the mock recorder for MockTXClient.

func (*MockTXClientMockRecorder) Exec added in v0.5.7

func (mr *MockTXClientMockRecorder) Exec(query any, args ...any) *gomock.Call

Exec indicates an expected call of Exec.

func (*MockTXClientMockRecorder) Stmt added in v0.5.7

func (mr *MockTXClientMockRecorder) Stmt(stmt any) *gomock.Call

Stmt indicates an expected call of Stmt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL