apiserverk8s.io/apiserver/pkg/storage/cacher/testing Index | Files

package testing

import "k8s.io/apiserver/pkg/storage/cacher/testing"

Index

Functions

func NewMockWatch

func NewMockWatch() watch.Interface

Types

type MockCacher

type MockCacher struct {
	MockStorage
	IsReady    bool
	Consistent bool
}

func (*MockCacher) MarkConsistent

func (d *MockCacher) MarkConsistent(consistent bool)

func (*MockCacher) Ready

func (d *MockCacher) Ready() bool

type MockStorage

type MockStorage struct {
	sync.RWMutex
	GetListErr error
	WatchErr   error
	GetListFn  func(_ context.Context, _ string, _ storage.ListOptions, listObj runtime.Object) error
	GetRVFn    func(_ context.Context) (uint64, error)
	WatchFn    func(_ context.Context, _ string, _ storage.ListOptions) (watch.Interface, error)

	// use GetRequestWatchProgressCounter when reading
	// the value of the counter
	RequestWatchProgressCounter int
}

func (*MockStorage) CompactRevision

func (d *MockStorage) CompactRevision() int64

func (*MockStorage) Create

func (d *MockStorage) Create(_ context.Context, _ string, _, _ runtime.Object, _ uint64) error

func (*MockStorage) Delete

func (*MockStorage) EnableResourceSizeEstimation

func (d *MockStorage) EnableResourceSizeEstimation(storage.KeysFunc) error

func (*MockStorage) Get

func (*MockStorage) GetCurrentResourceVersion

func (d *MockStorage) GetCurrentResourceVersion(ctx context.Context) (uint64, error)

func (*MockStorage) GetList

func (d *MockStorage) GetList(ctx context.Context, resPrefix string, opts storage.ListOptions, listObj runtime.Object) error

func (*MockStorage) GetRequestWatchProgressCounter

func (d *MockStorage) GetRequestWatchProgressCounter() int

func (*MockStorage) GuaranteedUpdate

func (*MockStorage) InjectGetListError

func (d *MockStorage) InjectGetListError(err error)

func (*MockStorage) IsWatchListSemanticsUnSupported

func (d *MockStorage) IsWatchListSemanticsUnSupported() bool

func (*MockStorage) ReadinessCheck

func (d *MockStorage) ReadinessCheck() error

func (*MockStorage) RequestWatchProgress

func (d *MockStorage) RequestWatchProgress(ctx context.Context) error

func (*MockStorage) Stats

func (d *MockStorage) Stats(_ context.Context) (storage.Stats, error)

func (*MockStorage) Versioner

func (d *MockStorage) Versioner() storage.Versioner

func (*MockStorage) Watch

type MockWatch

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

func (*MockWatch) ResultChan

func (w *MockWatch) ResultChan() <-chan watch.Event

func (*MockWatch) Stop

func (w *MockWatch) Stop()

Source Files

mock.go

Version
v0.36.0 (latest)
Published
Apr 22, 2026
Platform
linux/amd64
Imports
9 packages
Last checked
4 days ago

Tools for package owners.