Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block interface {
component.Component
Reload(c *Config) error
Start() time.Time
End() time.Time
State() State
TransformToCold() error
ClearOnDisk() error
Append(ctx context.Context, feeds ...*model.Feed) error
Query(ctx context.Context, query QueryOptions) ([]*FeedVO, error)
Exists(ctx context.Context, id uint64) (bool, error)
}
--- Interface code block ---
type Config ¶
type Config struct {
Dir string
FlushInterval time.Duration
ForCreate *ForCreateConfig
// contains filtered or unexported fields
}
type Dependencies ¶
type Factory ¶
type Factory component.Factory[Block, Config, Dependencies]
--- Factory code block ---
func NewFactory ¶
func NewFactory(mockOn ...component.MockOption) Factory
type FeedVO ¶
type FeedVO struct {
*model.Feed `json:",inline"`
Vectors [][]float32 `json:"-"`
Score float32 `json:"score,omitempty"` // Only exists when SemanticFilter is set.
}
FeedVO is the feed view for query result.
type ForCreateConfig ¶
type QueryOptions ¶
type QueryOptions struct {
Query string
Threshold float32
LabelFilters []string
Limit int
Start, End time.Time
// contains filtered or unexported fields
}
func (*QueryOptions) HitTimeRangeCondition ¶
func (q *QueryOptions) HitTimeRangeCondition(b Block) bool
func (*QueryOptions) Validate ¶
func (q *QueryOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.