@@ -72,13 +72,40 @@ type RepoStore interface {
72
72
Count (context.Context , ReposListOptions ) (int , error )
73
73
Create (context.Context , ... * types.Repo ) error
74
74
Delete (context.Context , ... api.RepoID ) error
75
+ // Get gets information about a single repo.
76
+ //
77
+ // Prefer using GetByIDs or GetReposSetByIDs for bulk retrieval.
78
+ //
79
+ // Returns database.RepoNotFoundErr if the repo was not found.
80
+ // Returns types.BlockedRepoError if the repo was blocked.
75
81
Get (context.Context , api.RepoID ) (* types.Repo , error )
82
+ // GetByIDs returns a slice containing information about repos present on the instance.
83
+ //
84
+ // The slice may have fewer entries than the number of input RepoIDs,
85
+ // due to repos not being found or having been deleted/blocked etc.
86
+ //
87
+ // Even if the number of elements matches, the caller may not assume anything
88
+ // about ordering. Use the ID field on each types.Repo value instead.
76
89
GetByIDs (context.Context , ... api.RepoID ) ([]* types.Repo , error )
90
+ // GetByName is analogous to Get but using an api.RepoName.
91
+ //
92
+ // Prefer using Get over GetByName for trusted input.
93
+ //
94
+ // Returns database.RepoNotFoundErr if the repo was not found.
95
+ // Returns types.BlockedRepoError if the repo was blocked.
77
96
GetByName (context.Context , api.RepoName ) (* types.Repo , error )
78
97
GetByHashedName (context.Context , api.RepoHashedName ) (* types.Repo , error )
79
98
GetFirstRepoNameByCloneURL (context.Context , string ) (api.RepoName , error )
80
99
GetFirstRepoByCloneURL (context.Context , string ) (* types.Repo , error )
100
+ // GetReposSetByIDs returns a map containing information about repos present on the instance.
101
+ //
102
+ // The map may have fewer key-value pairs than the number of input RepoIDs,
103
+ // due to repos not being found or having been deleted/blocked etc.
81
104
GetReposSetByIDs (context.Context , ... api.RepoID ) (map [api.RepoID ]* types.Repo , error )
105
+ // GetRepoDescriptionsByIDs returns descriptions about repos present on the instance.
106
+ //
107
+ // The map may have fewer key-value pairs than the number of input RepoIDs,
108
+ // due to repos not being found or having been deleted/blocked etc.
82
109
GetRepoDescriptionsByIDs (context.Context , ... api.RepoID ) (map [api.RepoID ]string , error )
83
110
List (context.Context , ReposListOptions ) ([]* types.Repo , error )
84
111
ListMinimalRepos (context.Context , ReposListOptions ) ([]types.MinimalRepo , error )
0 commit comments