0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-12-08 15:45:27 +01:00
gitea/modules/structs/repo_search.go
2025-08-20 10:14:04 -07:00

35 lines
959 B
Go

// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
// CodeSearchResultLanguage result of top languages count in search results
type CodeSearchResultLanguage struct {
Language string
Color string
Count int
}
type CodeSearchResultLine struct {
LineNumber int `json:"line_number"`
RawContent string `json:"raw_content"`
}
type CodeSearchResult struct {
Name string `json:"name"`
Path string `json:"path"`
Language string `json:"language"`
Color string
Lines []CodeSearchResultLine
Sha string `json:"sha"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
Repository *Repository `json:"repository"`
}
type CodeSearchResults struct {
TotalCount int64 `json:"total_count"`
Items []CodeSearchResult `json:"items"`
Languages []CodeSearchResultLanguage `json:"languages,omitempty"`
}