Documentation
¶
Index ¶
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.
View Source
var (
S *datastore
)
Singleton instance variables.
Functions ¶
Types ¶
type ByOrder ¶
type ByOrder []*model.ConfigurationM
type ConfigurationStore ¶
type ConfigurationStore interface { // Create adds a new user record to the database. Create(ctx context.Context, cfg *model.ConfigurationM) error // CreateBatch adds new users record to the database. CreateBatch(ctx context.Context, cfgs []*model.ConfigurationM) error // List returns a slice of user records based on the specified query conditions. List(ctx context.Context, templateCode string, opts ...meta.ListOption) (int64, []*model.ConfigurationM, error) // Get retrieves a user record by userID and username. Get(ctx context.Context, userID string, username string) (*model.ConfigurationM, error) // Update modifies an existing user record. Update(ctx context.Context, cfg *model.ConfigurationM) 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.ConfigurationM, error) // GetByUsername retrieves a user record using username as the query condition. GetByUsername(ctx context.Context, username string) (*model.ConfigurationM, error) }
ConfigurationStore defines the interface for managing user data storage.
type HistoryStore ¶
type HistoryStore interface { // Create adds a new user record to the database. Create(ctx context.Context, history *model.HistoryM) error // List returns a slice of user records based on the specified query conditions. List(ctx context.Context, opts ...meta.ListOption) (int64, []*model.HistoryM, error) // Get retrieves a user record by userID and username. Get(ctx context.Context, userID string, username string) (*model.HistoryM, error) // Update modifies an existing user record. Update(ctx context.Context, history *model.HistoryM) 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.HistoryM, error) // GetByUsername retrieves a user record using username as the query condition. GetByUsername(ctx context.Context, username string) (*model.HistoryM, error) }
HistoryStore defines the interface for managing user data storage.
type IStore ¶
type IStore interface { TX(context.Context, func(ctx context.Context) error) error Templates() TemplateStore Configurations() ConfigurationStore Histories() HistoryStore Interactions() InteractionStore }
IStore is an interface that represents methods required to be implemented by a Store implementation.
type InteractionStore ¶
type InteractionStore interface { // Create adds a new user record to the database. Create(ctx context.Context, user *model.InteractionM) error // List returns a slice of user records based on the specified query conditions. List(ctx context.Context, opts ...meta.ListOption) (int64, []*model.InteractionM, error) // Get retrieves a user record by userID and username. Get(ctx context.Context, userID string, username string) (*model.InteractionM, error) // Update modifies an existing user record. Update(ctx context.Context, user *model.InteractionM) 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.InteractionM, error) // GetByUsername retrieves a user record using username as the query condition. GetByUsername(ctx context.Context, username string) (*model.InteractionM, error) }
InteractionStore defines the interface for managing user data storage.
type TemplateStore ¶
type TemplateStore interface { // Create adds a new user record to the database. Create(ctx context.Context, user *model.TemplateM) error // List returns a slice of user records based on the specified query conditions. List(ctx context.Context, templateCode string, opts ...meta.ListOption) (int64, []*model.TemplateM, error) // Get retrieves a user record by userID and username. Get(ctx context.Context, userID string, username string) (*model.TemplateM, error) // Update modifies an existing user record. Update(ctx context.Context, user *model.TemplateM) 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.TemplateM, error) // GetByUsername retrieves a user record using username as the query condition. GetByUsername(ctx context.Context, username string) (*model.TemplateM, error) }
TemplateStore defines the interface for managing user data storage.
Click to show internal directories.
Click to hide internal directories.