summaryrefslogtreecommitdiffstats
path: root/modules/indexer/code/internal/model.go
blob: f75263c83cfe01fda177da20297922fa2f2724b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package internal

import "code.gitea.io/gitea/modules/timeutil"

type FileUpdate struct {
	Filename string
	BlobSha  string
	Size     int64
	Sized    bool
}

// RepoChanges changes (file additions/updates/removals) to a repo
type RepoChanges struct {
	Updates          []FileUpdate
	RemovedFilenames []string
}

// IndexerData represents data stored in the code indexer
type IndexerData struct {
	RepoID int64
}

// SearchResult result of performing a search in a repo
type SearchResult struct {
	RepoID      int64
	StartIndex  int
	EndIndex    int
	Filename    string
	Content     string
	CommitID    string
	UpdatedUnix timeutil.TimeStamp
	Language    string
	Color       string
}

// SearchResultLanguages result of top languages count in search results
type SearchResultLanguages struct {
	Language string
	Color    string
	Count    int
}