issues

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 22 Imported by: 13

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

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 added in v1.17.0

func IsAvailable(ctx context.Context) bool

IsAvailable checks if issue indexer is available

func PopulateIssueIndexer added in v1.21.0

func PopulateIssueIndexer(ctx context.Context) error

func SearchIssues added in v1.21.0

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 added in v1.10.2

func UpdateRepoIndexer(ctx context.Context, repoID int64)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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