Documentation
¶
Overview ¶
nolint: dupl
Package store defines the storage interface for miniblog.
nolint: dupl
nolint: dupl
Package store is a generated GoMock package.
Index ¶
- Variables
- func NewStore(db *gorm.DB) *datastore
- type ChainExpansion
- type ChainStore
- type IStore
- type MinerExpansion
- type MinerSetExpansion
- type MinerSetStore
- type MinerStore
- type MockChainStore
- func (m *MockChainStore) Create(arg0 context.Context, arg1 *model.ChainM) error
- func (m *MockChainStore) Delete(arg0 context.Context, arg1 *where.Options) error
- func (m *MockChainStore) EXPECT() *MockChainStoreMockRecorder
- func (m *MockChainStore) Get(arg0 context.Context, arg1 *where.Options) (*model.ChainM, error)
- func (m *MockChainStore) List(arg0 context.Context, arg1 *where.Options) (int64, []*model.ChainM, error)
- func (m *MockChainStore) Update(arg0 context.Context, arg1 *model.ChainM) error
- type MockChainStoreMockRecorder
- func (mr *MockChainStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockChainStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockChainStoreMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockChainStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockChainStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
- type MockIStore
- func (m *MockIStore) Chain() ChainStore
- func (m *MockIStore) DB(arg0 context.Context, arg1 ...where.Where) *gorm.DB
- func (m *MockIStore) EXPECT() *MockIStoreMockRecorder
- func (m *MockIStore) Miner() MinerStore
- func (m *MockIStore) MinerSet() MinerSetStore
- func (m *MockIStore) TX(arg0 context.Context, arg1 func(context.Context) error) error
- type MockIStoreMockRecorder
- func (mr *MockIStoreMockRecorder) Chain() *gomock.Call
- func (mr *MockIStoreMockRecorder) DB(arg0 interface{}, arg1 ...interface{}) *gomock.Call
- func (mr *MockIStoreMockRecorder) Miner() *gomock.Call
- func (mr *MockIStoreMockRecorder) MinerSet() *gomock.Call
- func (mr *MockIStoreMockRecorder) TX(arg0, arg1 interface{}) *gomock.Call
- type MockMinerSetStore
- func (m *MockMinerSetStore) Create(arg0 context.Context, arg1 *model.MinerSetM) error
- func (m *MockMinerSetStore) Delete(arg0 context.Context, arg1 *where.Options) error
- func (m *MockMinerSetStore) EXPECT() *MockMinerSetStoreMockRecorder
- func (m *MockMinerSetStore) Get(arg0 context.Context, arg1 *where.Options) (*model.MinerSetM, error)
- func (m *MockMinerSetStore) List(arg0 context.Context, arg1 *where.Options) (int64, []*model.MinerSetM, error)
- func (m *MockMinerSetStore) Update(arg0 context.Context, arg1 *model.MinerSetM) error
- type MockMinerSetStoreMockRecorder
- func (mr *MockMinerSetStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMinerSetStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMinerSetStoreMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMinerSetStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMinerSetStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
- type MockMinerStore
- func (m *MockMinerStore) Create(arg0 context.Context, arg1 *model.MinerM) error
- func (m *MockMinerStore) Delete(arg0 context.Context, arg1 *where.Options) error
- func (m *MockMinerStore) EXPECT() *MockMinerStoreMockRecorder
- func (m *MockMinerStore) Get(arg0 context.Context, arg1 *where.Options) (*model.MinerM, error)
- func (m *MockMinerStore) List(arg0 context.Context, arg1 *where.Options) (int64, []*model.MinerM, error)
- func (m *MockMinerStore) Update(arg0 context.Context, arg1 *model.MinerM) error
- type MockMinerStoreMockRecorder
- func (mr *MockMinerStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMinerStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMinerStoreMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMinerStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMinerStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
ProviderSet is a Wire provider set that declares dependency injection rules. It includes the NewStore constructor function to generate datastore instances. wire.Bind is used to bind the IStore interface to the concrete implementation *datastore, allowing automatic injection of *datastore instances wherever IStore is required.
var ( // S is a global variable for convenient access to the initialized datastore // instance from other packages. S *datastore )
Functions ¶
Types ¶
type ChainExpansion ¶
type ChainExpansion interface{}
ChainExpansion is an empty interface provided for extending the ChainStore interface. Developers can define chain-specific additional methods in this interface for future expansion.
type ChainStore ¶
type ChainStore interface {
// Create inserts a new Chain record into the store.
Create(ctx context.Context, obj *model.ChainM) error
// Update modifies an existing Chain record in the store based on the given model.
Update(ctx context.Context, obj *model.ChainM) error
// Delete removes Chain records that satisfy the given query options.
Delete(ctx context.Context, opts *where.Options) error
// Get retrieves a single Chain record that satisfies the given query options.
Get(ctx context.Context, opts *where.Options) (*model.ChainM, error)
// List retrieves a list of Chain records and their total count based on the given query options.
List(ctx context.Context, opts *where.Options) (int64, []*model.ChainM, error)
// ChainExpansion is a placeholder for extension methods for chains,
// to be implemented by additional interfaces if needed.
ChainExpansion
}
ChainStore defines the interface for managing chain-related data operations.
type IStore ¶
type IStore interface {
// DB returns the *gorm.DB instance of the Store layer, which might be used in rare cases.
DB(ctx context.Context, wheres ...where.Where) *gorm.DB
// TX is used to implement transactions in the Biz layer.
TX(ctx context.Context, fn func(ctx context.Context) error) error
// Chain returns an implementation of the ChainStore.
Chain() ChainStore
// MinerSet returns an implementation of the MinerSetStore.
MinerSet() MinerSetStore
// Miner returns an implementation of the MinerStore.
Miner() MinerStore
}
IStore defines the methods that the Store layer needs to implement.
type MinerExpansion ¶
type MinerExpansion interface{}
MinerExpansion is an empty interface provided for extending the MinerStore interface. Developers can define miner-specific additional methods in this interface for future expansion.
type MinerSetExpansion ¶
type MinerSetExpansion interface{}
MinerSetExpansion is an empty interface provided for extending the MinerSetStore interface. Developers can define minerset-specific additional methods in this interface for future expansion.
type MinerSetStore ¶
type MinerSetStore interface {
// Create inserts a new MinerSet record into the store.
Create(ctx context.Context, obj *model.MinerSetM) error
// Update modifies an existing MinerSet record in the store based on the given model.
Update(ctx context.Context, obj *model.MinerSetM) error
// Delete removes MinerSet records that satisfy the given query options.
Delete(ctx context.Context, opts *where.Options) error
// Get retrieves a single MinerSet record that satisfies the given query options.
Get(ctx context.Context, opts *where.Options) (*model.MinerSetM, error)
// List retrieves a list of MinerSet records and their total count based on the given query options.
List(ctx context.Context, opts *where.Options) (int64, []*model.MinerSetM, error)
// MinerSetExpansion is a placeholder for extension methods for minersets,
// to be implemented by additional interfaces if needed.
MinerSetExpansion
}
MinerSetStore defines the interface for managing minerset-related data operations.
type MinerStore ¶
type MinerStore interface {
// Create inserts a new Miner record into the store.
Create(ctx context.Context, obj *model.MinerM) error
// Update modifies an existing Miner record in the store based on the given model.
Update(ctx context.Context, obj *model.MinerM) error
// Delete removes Miner records that satisfy the given query options.
Delete(ctx context.Context, opts *where.Options) error
// Get retrieves a single Miner record that satisfies the given query options.
Get(ctx context.Context, opts *where.Options) (*model.MinerM, error)
// List retrieves a list of Miner records and their total count based on the given query options.
List(ctx context.Context, opts *where.Options) (int64, []*model.MinerM, error)
// MinerExpansion is a placeholder for extension methods for miners,
// to be implemented by additional interfaces if needed.
MinerExpansion
}
MinerStore defines the interface for managing miner-related data operations.
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) EXPECT ¶
func (m *MockChainStore) EXPECT() *MockChainStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
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{}) *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) EXPECT ¶
func (m *MockIStore) EXPECT() *MockIStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIStore) MinerSet ¶
func (m *MockIStore) MinerSet() MinerSetStore
MinerSet mocks base method.
type MockIStoreMockRecorder ¶
type MockIStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockIStoreMockRecorder is the mock recorder for MockIStore.
func (*MockIStoreMockRecorder) Chain ¶
func (mr *MockIStoreMockRecorder) Chain() *gomock.Call
Chain indicates an expected call of Chain.
func (*MockIStoreMockRecorder) DB ¶
func (mr *MockIStoreMockRecorder) DB(arg0 interface{}, arg1 ...interface{}) *gomock.Call
DB indicates an expected call of DB.
func (*MockIStoreMockRecorder) Miner ¶
func (mr *MockIStoreMockRecorder) Miner() *gomock.Call
Miner indicates an expected call of Miner.
func (*MockIStoreMockRecorder) MinerSet ¶
func (mr *MockIStoreMockRecorder) MinerSet() *gomock.Call
MinerSet indicates an expected call of MinerSet.
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) EXPECT ¶
func (m *MockMinerSetStore) EXPECT() *MockMinerSetStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMinerSetStore) Get ¶
func (m *MockMinerSetStore) Get(arg0 context.Context, arg1 *where.Options) (*model.MinerSetM, error)
Get 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{}) *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) EXPECT ¶
func (m *MockMinerStore) EXPECT() *MockMinerStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
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{}) *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.