issues

package
v0.0.0-...-c7a0b58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
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

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

func DeleteRepoIssueIndexer(ctx context.Context, repoID int64)

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

func IsAvailable(ctx context.Context) bool

IsAvailable checks if issue indexer is available

func PopulateIssueIndexer

func PopulateIssueIndexer(ctx context.Context) error

func SearchIssues

func SearchIssues(ctx context.Context, opts *SearchOptions) ([]int64, int64, error)

SearchIssues search issues by options.

func UpdateIssueIndexer

func UpdateIssueIndexer(ctx context.Context, issueID int64)

UpdateIssueIndexer add/update an issue to the issue indexer

func UpdateRepoIndexer

func UpdateRepoIndexer(ctx context.Context, repoID int64)

UpdateRepoIndexer add/update all issues of the repositories

Types

type IndexerMetadata

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

type SearchOptions = internal.SearchOptions

SearchOptions indicates the options for searching issues

func ToSearchOptions

func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL