Documentation
¶
Index ¶
- type Module
- func (m *Module) FieldResolvers() map[string]any
- func (m *Module) ID() string
- func (m *Module) Init(ctx context.Context, rt mdk.Runtime) error
- func (m *Module) Models() []any
- func (m *Module) Mutations() map[string]any
- func (m *Module) Queries() map[string]any
- func (m *Module) Routes() []mdk.Route
- func (m *Module) SearchProducts(ctx context.Context, input any) (any, error)
- func (m *Module) SearchProductsResolver(ctx context.Context, query string, limit *int) ([]*product.Product, error)
- func (m *Module) SearchProductsStep(sCtx mdk.StepContext) mdk.StepResult
- func (m *Module) SetProductModule(pm *product.Module)
- func (m *Module) Shutdown(ctx context.Context) error
- type SearchHistory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements the mdk.Module interface for Search.
func (*Module) FieldResolvers ¶
func (*Module) SearchProducts ¶
SearchProducts simulates a semantic/vector search across the product catalog.
func (*Module) SearchProductsResolver ¶
func (*Module) SearchProductsStep ¶
func (m *Module) SearchProductsStep(sCtx mdk.StepContext) mdk.StepResult
SearchProductsStep wraps SearchProducts to mdk.StepHandler.
func (*Module) SetProductModule ¶
type SearchHistory ¶
type SearchHistory struct {
ID string `gorm:"primaryKey" json:"id"`
Query string `gorm:"not null" json:"query"`
ActorID string `gorm:"index" json:"actor_id"`
ResultCount int `json:"result_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
SearchHistory tracks product searches for analytics and discovery.
Click to show internal directories.
Click to hide internal directories.