forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
188 lines (164 loc) · 5.09 KB
/
types.go
File metadata and controls
188 lines (164 loc) · 5.09 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package types
import (
"time"
"github.com/sourcegraph/sourcegraph/internal/api"
)
// RevSpecSet is a utility type for a set of RevSpecs.
type RevSpecSet map[api.RevSpec]struct{}
// Dump is a subset of the lsif_uploads table (queried via the lsif_dumps_with_repository_name view)
// and stores only processed records.
type Dump struct {
ID int `json:"id"`
Commit string `json:"commit"`
Root string `json:"root"`
VisibleAtTip bool `json:"visibleAtTip"`
UploadedAt time.Time `json:"uploadedAt"`
State string `json:"state"`
FailureMessage *string `json:"failureMessage"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
ProcessAfter *time.Time `json:"processAfter"`
NumResets int `json:"numResets"`
NumFailures int `json:"numFailures"`
RepositoryID int `json:"repositoryId"`
RepositoryName string `json:"repositoryName"`
Indexer string `json:"indexer"`
IndexerVersion string `json:"indexerVersion"`
AssociatedIndexID *int `json:"associatedIndex"`
}
// UploadLocation is a path and range pair from within a particular upload. The target commit
// denotes the target commit for which the location was set (the originally requested commit).
type UploadLocation struct {
Dump Dump
Path string
TargetCommit string
TargetRange Range
}
type Range struct {
Start Position
End Position
}
// Position is a unique position within a file.
type Position struct {
Line int
Character int
}
type UploadLog struct {
LogTimestamp time.Time
RecordDeletedAt *time.Time
UploadID int
Commit string
Root string
RepositoryID int
UploadedAt time.Time
Indexer string
IndexerVersion *string
UploadSize *int
AssociatedIndexID *int
TransitionColumns []map[string]*string
Reason *string
Operation string
}
type Upload struct {
ID int
Commit string
Root string
VisibleAtTip bool
UploadedAt time.Time
State string
FailureMessage *string
StartedAt *time.Time
FinishedAt *time.Time
ProcessAfter *time.Time
NumResets int
NumFailures int
RepositoryID int
RepositoryName string
Indexer string
IndexerVersion string
NumParts int
UploadedParts []int
UploadSize *int64
UncompressedSize *int64
Rank *int
AssociatedIndexID *int
}
func (u Upload) RecordID() int {
return u.ID
}
type GetUploadsOptions struct {
RepositoryID int
State string
Term string
VisibleAtTip bool
DependencyOf int
DependentOf int
UploadedBefore *time.Time
UploadedAfter *time.Time
LastRetentionScanBefore *time.Time
AllowExpired bool
AllowDeletedRepo bool
AllowDeletedUpload bool
OldestFirst bool
Limit int
Offset int
// InCommitGraph ensures that the repository commit graph was updated strictly
// after this upload was processed. This condition helps us filter out new uploads
// that we might later mistake for unreachable.
InCommitGraph bool
}
type DeleteUploadsOptions struct {
State string
Term string
VisibleAtTip bool
RepositoryID int
}
type DeleteIndexesOptions struct {
State string
Term string
RepositoryID int
}
type GetConfigurationPoliciesOptions struct {
// RepositoryID indicates that only configuration policies that apply to the
// specified repository (directly or via pattern) should be returned. This value
// has no effect when equal to zero.
RepositoryID int
// Term is a string to search within the configuration title.
Term string
// ForIndexing indicates that only configuration policies with data retention enabled
// should be returned.
ForDataRetention bool
// ForIndexing indicates that only configuration policies with indexing enabled should
// be returned.
ForIndexing bool
// Limit indicates the number of results to take from the result set.
Limit int
// Offset indicates the number of results to skip in the result set.
Offset int
}
type ConfigurationPolicy struct {
ID int
RepositoryID *int
RepositoryPatterns *[]string
Name string
Type GitObjectType
Pattern string
Protected bool
RetentionEnabled bool
RetentionDuration *time.Duration
RetainIntermediateCommits bool
IndexingEnabled bool
IndexCommitMaxAge *time.Duration
IndexIntermediateCommits bool
}
type RetentionPolicyMatchCandidate struct {
*ConfigurationPolicy
Matched bool
ProtectingCommits []string
}
type GitObjectType string
const (
GitObjectTypeCommit GitObjectType = "GIT_COMMIT"
GitObjectTypeTag GitObjectType = "GIT_TAG"
GitObjectTypeTree GitObjectType = "GIT_TREE"
)