Documentation
¶
Overview ¶
Package store defines the storage interface for fakeserver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IStore ¶
type IStore interface {
DB(ctx context.Context) *gorm.DB
TX(ctx context.Context, fn func(ctx context.Context) error) error
Orders() OrderStore
}
IStore defines the interface for the store layer, specifying the methods that need to be implemented.
var ( // Global variable to hold the store instance S IStore )
Singleton instance variables for the store.
type OrderExpansion ¶
type OrderExpansion interface{}
OrderExpansion defines additional methods for order operations.
type OrderStore ¶
type OrderStore interface {
// Create adds a new order to the store.
Create(ctx context.Context, order *model.OrderM) error
// Update modifies an existing order in the store.
Update(ctx context.Context, order *model.OrderM) error
// Delete removes orders from the store based on the provided conditions.
Delete(ctx context.Context, opts *where.Options) error
// Get retrieves a single order from the store based on the provided conditions.
Get(ctx context.Context, opts *where.Options) (*model.OrderM, error)
// List retrieves a list of orders from the store based on the provided conditions.
List(ctx context.Context, opts *where.Options) (int64, []*model.OrderM, error)
OrderExpansion
}
OrderStore defines the interface for order-related operations.
Click to show internal directories.
Click to hide internal directories.