store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package store is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewStore, wire.Bind(new(IStore), new(*datastore)))

ProviderSet is a set that initializes the Store and binds it to the IStore interface.

View Source
var (
	S *datastore
)

Functions

func NewStore

func NewStore(db *gorm.DB) *datastore

NewStore initializes a new datastore by using the given gorm.DB and returns it.

Types

type ChainStore

type ChainStore interface {
	Create(ctx context.Context, ch *model.ChainM) error
	Delete(ctx context.Context, filters map[string]interface{}) error
	Update(ctx context.Context, ch *model.ChainM) error
	Get(ctx context.Context, filters map[string]interface{}) (*model.ChainM, error)
	List(ctx context.Context, namespace string, opts ...meta.ListOption) (int64, []*model.ChainM, error)
}

ChainStore defines the chain storage interface.

type IStore

type IStore interface {
	TX(context.Context, func(ctx context.Context) error) error
	Chains() ChainStore
	Miners() MinerStore
	MinerSets() MinerSetStore
}

IStore is an interface defining the required methods for a Store.

type MinerSetStore

type MinerSetStore interface {
	Create(ctx context.Context, ms *model.MinerSetM) error
	Delete(ctx context.Context, filters map[string]interface{}) error
	Update(ctx context.Context, ms *model.MinerSetM) error
	Get(ctx context.Context, filters map[string]interface{}) (*model.MinerSetM, error)
	List(ctx context.Context, namespace string, opts ...meta.ListOption) (int64, []*model.MinerSetM, error)
}

MinerSetStore defines the minerset storage interface.

type MinerStore

type MinerStore interface {
	Create(ctx context.Context, miner *model.MinerM) error
	Delete(ctx context.Context, filters map[string]interface{}) error
	Update(ctx context.Context, miner *model.MinerM) error
	Get(ctx context.Context, filters map[string]interface{}) (*model.MinerM, error)
	List(ctx context.Context, namespace string, opts ...meta.ListOption) (int64, []*model.MinerM, error)
}

MinerStore defines the miner storage interface.

type MockChainStore

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

MockChainStore is a mock of ChainStore interface.

func NewMockChainStore

func NewMockChainStore(ctrl *gomock.Controller) *MockChainStore

NewMockChainStore creates a new mock instance.

func (*MockChainStore) Create

func (m *MockChainStore) Create(arg0 context.Context, arg1 *model.ChainM) error

Create mocks base method.

func (*MockChainStore) Delete

func (m *MockChainStore) Delete(arg0 context.Context, arg1 map[string]interface{}) error

Delete mocks base method.

func (*MockChainStore) EXPECT

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

func (*MockChainStore) Get

func (m *MockChainStore) Get(arg0 context.Context, arg1 map[string]interface{}) (*model.ChainM, error)

Get mocks base method.

func (*MockChainStore) List

func (m *MockChainStore) List(arg0 context.Context, arg1 string, arg2 ...meta.ListOption) (int64, []*model.ChainM, error)

List mocks base method.

func (*MockChainStore) Update

func (m *MockChainStore) Update(arg0 context.Context, arg1 *model.ChainM) error

Update mocks base method.

type MockChainStoreMockRecorder

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

MockChainStoreMockRecorder is the mock recorder for MockChainStore.

func (*MockChainStoreMockRecorder) Create

func (mr *MockChainStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockChainStoreMockRecorder) Delete

func (mr *MockChainStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockChainStoreMockRecorder) Get

func (mr *MockChainStoreMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockChainStoreMockRecorder) List

func (mr *MockChainStoreMockRecorder) List(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockChainStoreMockRecorder) Update

func (mr *MockChainStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call

Update indicates an expected call of Update.

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) Chains

func (m *MockIStore) Chains() ChainStore

Chains mocks base method.

func (*MockIStore) EXPECT

func (m *MockIStore) EXPECT() *MockIStoreMockRecorder

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

func (*MockIStore) MinerSets

func (m *MockIStore) MinerSets() MinerSetStore

MinerSets mocks base method.

func (*MockIStore) Miners

func (m *MockIStore) Miners() MinerStore

Miners mocks base method.

func (*MockIStore) TX

func (m *MockIStore) TX(arg0 context.Context, arg1 func(context.Context) error) error

TX mocks base method.

type MockIStoreMockRecorder

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

MockIStoreMockRecorder is the mock recorder for MockIStore.

func (*MockIStoreMockRecorder) Chains

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

Chains indicates an expected call of Chains.

func (*MockIStoreMockRecorder) MinerSets

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

MinerSets indicates an expected call of MinerSets.

func (*MockIStoreMockRecorder) Miners

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

Miners indicates an expected call of Miners.

func (*MockIStoreMockRecorder) TX

func (mr *MockIStoreMockRecorder) TX(arg0, arg1 interface{}) *gomock.Call

TX indicates an expected call of TX.

type MockMinerSetStore

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

MockMinerSetStore is a mock of MinerSetStore interface.

func NewMockMinerSetStore

func NewMockMinerSetStore(ctrl *gomock.Controller) *MockMinerSetStore

NewMockMinerSetStore creates a new mock instance.

func (*MockMinerSetStore) Create

func (m *MockMinerSetStore) Create(arg0 context.Context, arg1 *model.MinerSetM) error

Create mocks base method.

func (*MockMinerSetStore) Delete

func (m *MockMinerSetStore) Delete(arg0 context.Context, arg1 map[string]interface{}) error

Delete mocks base method.

func (*MockMinerSetStore) EXPECT

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

func (*MockMinerSetStore) Get

func (m *MockMinerSetStore) Get(arg0 context.Context, arg1 map[string]interface{}) (*model.MinerSetM, error)

Get mocks base method.

func (*MockMinerSetStore) List

func (m *MockMinerSetStore) List(arg0 context.Context, arg1 string, arg2 ...meta.ListOption) (int64, []*model.MinerSetM, error)

List mocks base method.

func (*MockMinerSetStore) Update

func (m *MockMinerSetStore) Update(arg0 context.Context, arg1 *model.MinerSetM) error

Update mocks base method.

type MockMinerSetStoreMockRecorder

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

MockMinerSetStoreMockRecorder is the mock recorder for MockMinerSetStore.

func (*MockMinerSetStoreMockRecorder) Create

func (mr *MockMinerSetStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockMinerSetStoreMockRecorder) Delete

func (mr *MockMinerSetStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockMinerSetStoreMockRecorder) Get

func (mr *MockMinerSetStoreMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockMinerSetStoreMockRecorder) List

func (mr *MockMinerSetStoreMockRecorder) List(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockMinerSetStoreMockRecorder) Update

func (mr *MockMinerSetStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call

Update indicates an expected call of Update.

type MockMinerStore

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

MockMinerStore is a mock of MinerStore interface.

func NewMockMinerStore

func NewMockMinerStore(ctrl *gomock.Controller) *MockMinerStore

NewMockMinerStore creates a new mock instance.

func (*MockMinerStore) Create

func (m *MockMinerStore) Create(arg0 context.Context, arg1 *model.MinerM) error

Create mocks base method.

func (*MockMinerStore) Delete

func (m *MockMinerStore) Delete(arg0 context.Context, arg1 map[string]interface{}) error

Delete mocks base method.

func (*MockMinerStore) EXPECT

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

func (*MockMinerStore) Get

func (m *MockMinerStore) Get(arg0 context.Context, arg1 map[string]interface{}) (*model.MinerM, error)

Get mocks base method.

func (*MockMinerStore) List

func (m *MockMinerStore) List(arg0 context.Context, arg1 string, arg2 ...meta.ListOption) (int64, []*model.MinerM, error)

List mocks base method.

func (*MockMinerStore) Update

func (m *MockMinerStore) Update(arg0 context.Context, arg1 *model.MinerM) error

Update mocks base method.

type MockMinerStoreMockRecorder

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

MockMinerStoreMockRecorder is the mock recorder for MockMinerStore.

func (*MockMinerStoreMockRecorder) Create

func (mr *MockMinerStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockMinerStoreMockRecorder) Delete

func (mr *MockMinerStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockMinerStoreMockRecorder) Get

func (mr *MockMinerStoreMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockMinerStoreMockRecorder) List

func (mr *MockMinerStoreMockRecorder) List(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockMinerStoreMockRecorder) Update

func (mr *MockMinerStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call

Update indicates an expected call of Update.

Jump to

Keyboard shortcuts

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