Documentation ¶
Index ¶
- Constants
- func CountIssues(ctx context.Context, opts *SearchOptions) (int64, error)
- func DeleteRepoIssueIndexer(ctx context.Context, repoID int64)
- func InitIssueIndexer(syncReindex bool)
- func IsAvailable(ctx context.Context) bool
- func PopulateIssueIndexer(ctx context.Context) error
- func SearchIssues(ctx context.Context, opts *SearchOptions) ([]int64, int64, error)
- func UpdateIssueIndexer(ctx context.Context, issueID int64)
- func UpdateRepoIndexer(ctx context.Context, repoID int64)
- type IndexerMetadata
- type SearchOptions
Constants ¶
const ( SortByCreatedDesc = internal.SortByCreatedDesc SortByUpdatedDesc = internal.SortByUpdatedDesc SortByCommentsDesc = internal.SortByCommentsDesc SortByDeadlineDesc = internal.SortByDeadlineDesc SortByCreatedAsc = internal.SortByCreatedAsc SortByUpdatedAsc = internal.SortByUpdatedAsc SortByCommentsAsc = internal.SortByCommentsAsc SortByDeadlineAsc = internal.SortByDeadlineAsc )
Variables ¶
This section is empty.
Functions ¶
func CountIssues ¶ added in v1.21.0
func CountIssues(ctx context.Context, opts *SearchOptions) (int64, error)
CountIssues counts issues by options. It is a shortcut of SearchIssues(ctx, opts) but only returns the total count.
func DeleteRepoIssueIndexer ¶
DeleteRepoIssueIndexer deletes repo's all issues indexes
func InitIssueIndexer ¶
func InitIssueIndexer(syncReindex bool)
InitIssueIndexer initialize issue indexer, syncReindex is true then reindex until all issue index done.
func IsAvailable ¶ added in v1.17.0
IsAvailable checks if issue indexer is available
func PopulateIssueIndexer ¶ added in v1.21.0
func SearchIssues ¶ added in v1.21.0
SearchIssues search issues by options.
func UpdateIssueIndexer ¶
UpdateIssueIndexer add/update an issue to the issue indexer
func UpdateRepoIndexer ¶ added in v1.10.2
UpdateRepoIndexer add/update all issues of the repositories
Types ¶
type IndexerMetadata ¶ added in v1.21.0
type IndexerMetadata struct { ID int64 `json:"id"` IsDelete bool `json:"is_delete"` IDs []int64 `json:"ids"` }
IndexerMetadata is used to send data to the queue, so it contains only the ids. It may look weired, because it has to be compatible with the old queue data format. If the IsDelete flag is true, the IDs specify the issues to delete from the index without querying the database. If the IsDelete flag is false, the ID specify the issue to index, so Indexer will query the database to get the issue data. It should be noted that if the id is not existing in the database, it's index will be deleted too even if IsDelete is false. Valid values:
- IsDelete = true, IDs = [1, 2, 3], and ID will be ignored
- IsDelete = false, ID = 1, and IDs will be ignored
type SearchOptions ¶ added in v1.21.0
type SearchOptions = internal.SearchOptions
SearchOptions indicates the options for searching issues
func ToSearchOptions ¶ added in v1.21.0
func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOptions