Documentation
¶
Overview ¶
nolint: dupl
nolint: dupl
Index ¶
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 )
var (
SetterProviderSet = wire.NewSet(NewSecretSetter, wire.Bind(new(auth.TemporarySecretSetter), new(*secretSetter)))
)
Functions ¶
func NewSecretSetter ¶
func NewSecretSetter(store *datastore) *secretSetter
NewSecretSetter initializes a new secretSetter instance using the provided datastore.
Types ¶
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
// User returns an implementation of the UserStore.
User() UserStore
// Secret returns an implementation of the SecretStore.
Secret() SecretStore
}
IStore defines the methods that the Store layer needs to implement.
type SecretExpansion ¶
type SecretExpansion interface{}
SecretExpansion is an empty interface provided for extending the SecretStore interface. Developers can define secret-specific additional methods in this interface for future expansion.
type SecretStore ¶
type SecretStore interface {
// Create inserts a new Secret record into the store.
Create(ctx context.Context, obj *model.SecretM) error
// Update modifies an existing Secret record in the store based on the given model.
Update(ctx context.Context, obj *model.SecretM) error
// Delete removes Secret records that satisfy the given query options.
Delete(ctx context.Context, opts *where.Options) error
// Get retrieves a single Secret record that satisfies the given query options.
Get(ctx context.Context, opts *where.Options) (*model.SecretM, error)
// List retrieves a list of Secret records and their total count based on the given query options.
List(ctx context.Context, opts *where.Options) (int64, []*model.SecretM, error)
// SecretExpansion is a placeholder for extension methods for secrets,
// to be implemented by additional interfaces if needed.
SecretExpansion
}
SecretStore defines the interface for managing secret-related data operations.
type UserExpansion ¶
type UserExpansion interface{}
UserExpansion is an empty interface provided for extending the UserStore interface. Developers can define user-specific additional methods in this interface for future expansion.
type UserStore ¶
type UserStore interface {
// Create inserts a new User record into the store.
Create(ctx context.Context, obj *model.UserM) error
// Update modifies an existing User record in the store based on the given model.
Update(ctx context.Context, obj *model.UserM) error
// Delete removes User records that satisfy the given query options.
Delete(ctx context.Context, opts *where.Options) error
// Get retrieves a single User record that satisfies the given query options.
Get(ctx context.Context, opts *where.Options) (*model.UserM, error)
// List retrieves a list of User records and their total count based on the given query options.
List(ctx context.Context, opts *where.Options) (int64, []*model.UserM, error)
// UserExpansion is a placeholder for extension methods for users,
// to be implemented by additional interfaces if needed.
UserExpansion
}
UserStore defines the interface for managing user-related data operations.