Documentation
¶
Index ¶
- Constants
- type Indexer
- func (s *Indexer) CancelJob() (JobStatus, error)
- func (s *Indexer) DeletePost(ctx context.Context, postID string) error
- func (s *Indexer) GetJobStatus() (JobStatus, error)
- func (s *Indexer) IndexPost(ctx context.Context, post *model.Post, channel *model.Channel) error
- func (s *Indexer) StartReindexJob() (JobStatus, error)
- type JobStatus
- type PostRecord
Constants ¶
View Source
const ( JobStatusRunning = "running" JobStatusCompleted = "completed" JobStatusFailed = "failed" JobStatusCanceled = "canceled" // KV store keys ReindexJobKey = "reindex_job_status" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
func New ¶
func New( search embeddings.EmbeddingSearch, pluginAPI mmapi.Client, bots *bots.MMBots, db *sqlx.DB, ) *Indexer
func (*Indexer) DeletePost ¶
DeletePost deletes a post from the index
func (*Indexer) GetJobStatus ¶
GetJobStatus gets the status of the reindex job
func (*Indexer) StartReindexJob ¶
StartReindexJob starts a post reindexing job
type JobStatus ¶
type JobStatus struct {
Status string `json:"status"`
Error string `json:"error,omitempty"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at,omitempty"`
ProcessedRows int64 `json:"processed_rows"`
TotalRows int64 `json:"total_rows"`
}
JobStatus represents the status of a reindex job
type PostRecord ¶
type PostRecord struct {
ID string `db:"id"`
Message string `db:"message"`
UserID string `db:"userid"`
CreateAt int64 `db:"createat"`
TeamID string `db:"teamid"`
ChannelID string `db:"channelid"`
ChannelName string `db:"channelname"`
ChannelType string `db:"channeltype"`
}
PostRecord represents a post record from the database
Click to show internal directories.
Click to hide internal directories.