store

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package store defines the storage interface for fakeserver.

Package store is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetStore

func SetStore(store IStore)

SetStore set the onex-fakeserver store instance in a global variable `S`. Direct use the global `S` is not recommended as this may make dependencies and calls unclear.

Types

type IStore

type IStore interface {
	Orders() OrderStore
}

IStore 定义了 Store 层需要实现的方法.

var (

	// 全局变量,方便其它包直接调用已初始化好的 S 实例.
	S IStore
)

type MockIStore

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

MockIStore is a mock of IStore interface.

func NewMockIStore

func NewMockIStore(ctrl *gomock.Controller) *MockIStore

NewMockIStore creates a new mock instance.

func (*MockIStore) EXPECT

func (m *MockIStore) EXPECT() *MockIStoreMockRecorder

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

func (*MockIStore) Orders

func (m *MockIStore) Orders() OrderStore

Orders mocks base method.

type MockIStoreMockRecorder

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

MockIStoreMockRecorder is the mock recorder for MockIStore.

func (*MockIStoreMockRecorder) Orders

func (mr *MockIStoreMockRecorder) Orders() *gomock.Call

Orders indicates an expected call of Orders.

type MockOrderStore

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

MockOrderStore is a mock of OrderStore interface.

func NewMockOrderStore

func NewMockOrderStore(ctrl *gomock.Controller) *MockOrderStore

NewMockOrderStore creates a new mock instance.

func (*MockOrderStore) Create

func (m *MockOrderStore) Create(arg0 context.Context, arg1 *model.OrderM) error

Create mocks base method.

func (*MockOrderStore) Delete

func (m *MockOrderStore) Delete(arg0 context.Context, arg1 string) error

Delete mocks base method.

func (*MockOrderStore) EXPECT

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

func (*MockOrderStore) Get

func (m *MockOrderStore) Get(arg0 context.Context, arg1 string) (*model.OrderM, error)

Get mocks base method.

func (*MockOrderStore) List

func (m *MockOrderStore) List(arg0 context.Context, arg1 ...meta.ListOption) (int64, []*model.OrderM, error)

List mocks base method.

func (*MockOrderStore) Update

func (m *MockOrderStore) Update(arg0 context.Context, arg1 *model.OrderM) error

Update mocks base method.

type MockOrderStoreMockRecorder

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

MockOrderStoreMockRecorder is the mock recorder for MockOrderStore.

func (*MockOrderStoreMockRecorder) Create

func (mr *MockOrderStoreMockRecorder) Create(arg0, arg1 any) *gomock.Call

Create indicates an expected call of Create.

func (*MockOrderStoreMockRecorder) Delete

func (mr *MockOrderStoreMockRecorder) Delete(arg0, arg1 any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockOrderStoreMockRecorder) Get

func (mr *MockOrderStoreMockRecorder) Get(arg0, arg1 any) *gomock.Call

Get indicates an expected call of Get.

func (*MockOrderStoreMockRecorder) List

func (mr *MockOrderStoreMockRecorder) List(arg0 any, arg1 ...any) *gomock.Call

List indicates an expected call of List.

func (*MockOrderStoreMockRecorder) Update

func (mr *MockOrderStoreMockRecorder) Update(arg0, arg1 any) *gomock.Call

Update indicates an expected call of Update.

type OrderStore

type OrderStore interface {
	Create(ctx context.Context, order *model.OrderM) error
	Get(ctx context.Context, orderID string) (*model.OrderM, error)
	Update(ctx context.Context, order *model.OrderM) error
	List(ctx context.Context, opts ...meta.ListOption) (int64, []*model.OrderM, error)
	Delete(ctx context.Context, orderID string) error
}

OrderStore 定义了 order 模块在 store 层所实现的方法.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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