storetest

package
v0.2.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package storetest provides shared mock implementations of stores.Store for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStore

type MockStore struct {
	Items   []any
	ListErr error
	GetErr  error
}

MockStore is a configurable mock implementation of stores.Store for testing. Configure behavior by setting fields before use:

store := &storetest.MockStore{Items: []any{item1, item2}}
store := &storetest.MockStore{ListErr: errors.New("fail")}
store := &storetest.MockStore{} // no-op store

func (*MockStore) Add

func (m *MockStore) Add(resource any, _ []string) error

func (*MockStore) Clear

func (m *MockStore) Clear() error

func (*MockStore) Delete

func (m *MockStore) Delete(_ ...string) error

func (*MockStore) Get

func (m *MockStore) Get(_ ...string) ([]any, error)

func (*MockStore) List

func (m *MockStore) List() ([]any, error)

func (*MockStore) Update

func (m *MockStore) Update(_ any, _ []string) error

Jump to

Keyboard shortcuts

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