store

package
v0.2.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 Wire provider set that initializes new datastore instances and binds the IStore interface to the actual datastore type.

View Source
var (
	S *datastore
)

Singleton instance variables.

View Source
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.

func NewStore

func NewStore(db *gorm.DB) *datastore

NewStore initializes a new datastore instance using the provided DB gorm instance. It also creates a singleton instance for the datastore.

Types

type IStore

type IStore interface {
	DB(ctx context.Context) *gorm.DB
	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.

func (*MockIStore) Secrets

func (m *MockIStore) Secrets() SecretStore

Secrets mocks base method.

func (*MockIStore) TX

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

TX mocks base method.

func (*MockIStore) Users

func (m *MockIStore) Users() UserStore

Users mocks base method.

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

func (m *MockSecretStore) Create(arg0 context.Context, arg1 *model.SecretM) error

Create mocks base method.

func (*MockSecretStore) Delete

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

Delete mocks base method.

func (*MockSecretStore) EXPECT

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

func (*MockSecretStore) Get

func (m *MockSecretStore) Get(arg0 context.Context, arg1, arg2 string) (*model.SecretM, error)

Get mocks base method.

func (*MockSecretStore) List

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

List mocks base method.

func (*MockSecretStore) Update

func (m *MockSecretStore) Update(arg0 context.Context, arg1 *model.SecretM) error

Update mocks base method.

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.

func (*MockSecretStoreMockRecorder) List

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

List indicates an expected call of List.

func (*MockSecretStoreMockRecorder) Update

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

Update indicates an expected call of Update.

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

func (m *MockUserStore) Create(arg0 context.Context, arg1 *model.UserM) error

Create mocks base method.

func (*MockUserStore) Delete

func (m *MockUserStore) Delete(arg0 context.Context, arg1 map[string]any) error

Delete mocks base method.

func (*MockUserStore) EXPECT

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

func (*MockUserStore) Fetch

func (m *MockUserStore) Fetch(arg0 context.Context, arg1 map[string]any) (*model.UserM, error)

Fetch mocks base method.

func (*MockUserStore) Get

func (m *MockUserStore) Get(arg0 context.Context, arg1, arg2 string) (*model.UserM, error)

Get mocks base method.

func (*MockUserStore) GetByUsername

func (m *MockUserStore) GetByUsername(arg0 context.Context, arg1 string) (*model.UserM, error)

GetByUsername mocks base method.

func (*MockUserStore) List

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

List mocks base method.

func (*MockUserStore) Update

func (m *MockUserStore) Update(arg0 context.Context, arg1 *model.UserM) error

Update 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.

func (*MockUserStoreMockRecorder) List

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

List indicates an expected call of List.

func (*MockUserStoreMockRecorder) Update

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

Update indicates an expected call of Update.

type SecretExpansion

type SecretExpansion interface{}

SecretExpansion defines additional methods for secret operations.

type SecretStore

type SecretStore interface {
	// Create inserts a new secret into the database.
	Create(ctx context.Context, secret *model.SecretM) error

	// Update modifies an existing secret in the database.
	Update(ctx context.Context, secret *model.SecretM) error

	// Delete removes secrets with the specified options.
	Delete(ctx context.Context, opts *where.Options) error

	// Get retrieves a secret with the specified options.
	Get(ctx context.Context, opts *where.Options) (*model.SecretM, error)

	// List returns a list of secrets with the specified options.
	List(ctx context.Context, opts *where.Options) (int64, []*model.SecretM, error)

	SecretExpansion
}

SecretStore defines the interface for managing secrets in the database.

type UserExpansion

type UserExpansion interface{}

UserExpansion defines additional methods for user operations.

type UserStore

type UserStore interface {
	// Create inserts a new user into the database.
	Create(ctx context.Context, user *model.UserM) error

	// Update modifies an existing user in the database.
	Update(ctx context.Context, user *model.UserM) error

	// Delete removes users with the specified options.
	Delete(ctx context.Context, opts *where.Options) error

	// Get retrieves a user with the specified options.
	Get(ctx context.Context, opts *where.Options) (*model.UserM, error)

	// List returns a list of users with the specified options.
	List(ctx context.Context, opts *where.Options) (int64, []*model.UserM, error)

	UserExpansion
}

UserStore defines the interface for managing users in the database.

Jump to

Keyboard shortcuts

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