Documentation ¶
Overview ¶
Package store is a generated GoMock package.
Index ¶
- Variables
- func NewSecretSetter(ds *datastore) *secretSetter
- func NewStore(db *gorm.DB) *datastore
- type IStore
- type MockIStore
- type MockIStoreMockRecorder
- type MockSecretStore
- func (m *MockSecretStore) Create(arg0 context.Context, arg1 *model.SecretM) error
- func (m *MockSecretStore) Delete(arg0 context.Context, arg1, arg2 string) error
- func (m *MockSecretStore) EXPECT() *MockSecretStoreMockRecorder
- func (m *MockSecretStore) Get(arg0 context.Context, arg1, arg2 string) (*model.SecretM, error)
- func (m *MockSecretStore) List(arg0 context.Context, arg1 string, arg2 ...meta.ListOption) (int64, []*model.SecretM, error)
- func (m *MockSecretStore) Update(arg0 context.Context, arg1 *model.SecretM) error
- type MockSecretStoreMockRecorder
- func (mr *MockSecretStoreMockRecorder) Create(arg0, arg1 any) *gomock.Call
- func (mr *MockSecretStoreMockRecorder) Delete(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockSecretStoreMockRecorder) Get(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockSecretStoreMockRecorder) List(arg0, arg1 any, arg2 ...any) *gomock.Call
- func (mr *MockSecretStoreMockRecorder) Update(arg0, arg1 any) *gomock.Call
- type MockUserStore
- func (m *MockUserStore) Create(arg0 context.Context, arg1 *model.UserM) error
- func (m *MockUserStore) Delete(arg0 context.Context, arg1 map[string]any) error
- func (m *MockUserStore) EXPECT() *MockUserStoreMockRecorder
- func (m *MockUserStore) Fetch(arg0 context.Context, arg1 map[string]any) (*model.UserM, error)
- func (m *MockUserStore) Get(arg0 context.Context, arg1, arg2 string) (*model.UserM, error)
- func (m *MockUserStore) GetByUsername(arg0 context.Context, arg1 string) (*model.UserM, error)
- func (m *MockUserStore) List(arg0 context.Context, arg1 ...meta.ListOption) (int64, []*model.UserM, error)
- func (m *MockUserStore) Update(arg0 context.Context, arg1 *model.UserM) error
- type MockUserStoreMockRecorder
- func (mr *MockUserStoreMockRecorder) Create(arg0, arg1 any) *gomock.Call
- func (mr *MockUserStoreMockRecorder) Delete(arg0, arg1 any) *gomock.Call
- func (mr *MockUserStoreMockRecorder) Fetch(arg0, arg1 any) *gomock.Call
- func (mr *MockUserStoreMockRecorder) Get(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockUserStoreMockRecorder) GetByUsername(arg0, arg1 any) *gomock.Call
- func (mr *MockUserStoreMockRecorder) List(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockUserStoreMockRecorder) Update(arg0, arg1 any) *gomock.Call
- type SecretStore
- type UserStore
Constants ¶
This section is empty.
Variables ¶
ProviderSet is a Wire provider set that initializes new datastore instances and binds the IStore interface to the actual datastore type.
var (
S *datastore
)
Singleton instance variables.
var (
SetterProviderSet = wire.NewSet(NewSecretSetter, wire.Bind(new(auth.TemporarySecretSetter), new(*secretSetter)))
)
Functions ¶
func NewSecretSetter ¶
func NewSecretSetter(ds *datastore) *secretSetter
NewSecretSetter initializes a new secretSetter instance using the provided datastore.
Types ¶
type IStore ¶
type IStore interface { TX(context.Context, func(ctx context.Context) error) error Users() UserStore Secrets() SecretStore }
IStore is an interface that represents methods required to be implemented by a Store implementation.
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.
type MockIStoreMockRecorder ¶
type MockIStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockIStoreMockRecorder is the mock recorder for MockIStore.
func (*MockIStoreMockRecorder) Secrets ¶
func (mr *MockIStoreMockRecorder) Secrets() *gomock.Call
Secrets indicates an expected call of Secrets.
func (*MockIStoreMockRecorder) TX ¶
func (mr *MockIStoreMockRecorder) TX(arg0, arg1 any) *gomock.Call
TX indicates an expected call of TX.
func (*MockIStoreMockRecorder) Users ¶
func (mr *MockIStoreMockRecorder) Users() *gomock.Call
Users indicates an expected call of Users.
type MockSecretStore ¶
type MockSecretStore struct {
// contains filtered or unexported fields
}
MockSecretStore is a mock of SecretStore interface.
func NewMockSecretStore ¶
func NewMockSecretStore(ctrl *gomock.Controller) *MockSecretStore
NewMockSecretStore creates a new mock instance.
func (*MockSecretStore) Delete ¶
func (m *MockSecretStore) Delete(arg0 context.Context, arg1, arg2 string) error
Delete mocks base method.
func (*MockSecretStore) EXPECT ¶
func (m *MockSecretStore) EXPECT() *MockSecretStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockSecretStoreMockRecorder ¶
type MockSecretStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockSecretStoreMockRecorder is the mock recorder for MockSecretStore.
func (*MockSecretStoreMockRecorder) Create ¶
func (mr *MockSecretStoreMockRecorder) Create(arg0, arg1 any) *gomock.Call
Create indicates an expected call of Create.
func (*MockSecretStoreMockRecorder) Delete ¶
func (mr *MockSecretStoreMockRecorder) Delete(arg0, arg1, arg2 any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockSecretStoreMockRecorder) Get ¶
func (mr *MockSecretStoreMockRecorder) Get(arg0, arg1, arg2 any) *gomock.Call
Get indicates an expected call of Get.
type MockUserStore ¶
type MockUserStore struct {
// contains filtered or unexported fields
}
MockUserStore is a mock of UserStore interface.
func NewMockUserStore ¶
func NewMockUserStore(ctrl *gomock.Controller) *MockUserStore
NewMockUserStore creates a new mock instance.
func (*MockUserStore) EXPECT ¶
func (m *MockUserStore) EXPECT() *MockUserStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockUserStore) GetByUsername ¶
GetByUsername mocks base method.
type MockUserStoreMockRecorder ¶
type MockUserStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockUserStoreMockRecorder is the mock recorder for MockUserStore.
func (*MockUserStoreMockRecorder) Create ¶
func (mr *MockUserStoreMockRecorder) Create(arg0, arg1 any) *gomock.Call
Create indicates an expected call of Create.
func (*MockUserStoreMockRecorder) Delete ¶
func (mr *MockUserStoreMockRecorder) Delete(arg0, arg1 any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockUserStoreMockRecorder) Fetch ¶
func (mr *MockUserStoreMockRecorder) Fetch(arg0, arg1 any) *gomock.Call
Fetch indicates an expected call of Fetch.
func (*MockUserStoreMockRecorder) Get ¶
func (mr *MockUserStoreMockRecorder) Get(arg0, arg1, arg2 any) *gomock.Call
Get indicates an expected call of Get.
func (*MockUserStoreMockRecorder) GetByUsername ¶
func (mr *MockUserStoreMockRecorder) GetByUsername(arg0, arg1 any) *gomock.Call
GetByUsername indicates an expected call of GetByUsername.
type SecretStore ¶
type SecretStore interface { Create(ctx context.Context, secret *model.SecretM) error Delete(ctx context.Context, userID string, name string) error Update(ctx context.Context, secret *model.SecretM) error Get(ctx context.Context, userID string, name string) (*model.SecretM, error) List(ctx context.Context, userID string, opts ...meta.ListOption) (int64, []*model.SecretM, error) }
SecretStore defines the secret storage interface, containing methods for managing secret records in a datastore.
type UserStore ¶
type UserStore interface { // Create adds a new user record to the database. Create(ctx context.Context, user *model.UserM) error // List returns a slice of user records based on the specified query conditions. List(ctx context.Context, opts ...meta.ListOption) (int64, []*model.UserM, error) // Get retrieves a user record by userID and username. Get(ctx context.Context, userID string, username string) (*model.UserM, error) // Update modifies an existing user record. Update(ctx context.Context, user *model.UserM) error // Delete removes a user record using the provided filters. Delete(ctx context.Context, filters map[string]any) error // Extensions // Fetch retrieves a user record using provided filters. Fetch(ctx context.Context, filters map[string]any) (*model.UserM, error) // GetByUsername retrieves a user record using username as the query condition. GetByUsername(ctx context.Context, username string) (*model.UserM, error) }
UserStore defines the interface for managing user data storage.