v0.8.0 11411cf

merge_request.connect.go RawHistoryFolder

1// SPDX-License-Identifier: MIT
2
3// Code generated by protoc-gen-connect-go. DO NOT EDIT.
4//
5// Source: ermite/merge_request.proto
6
7package ermiteconnect
8
9import (
10	ermite "bnema.dev/ermite-api/gen/ermite"
11	connect "connectrpc.com/connect"
12	context "context"
13	errors "errors"
14	http "net/http"
15	strings "strings"
16)
17
18// This is a compile-time assertion to ensure that this generated file and the connect package are
19// compatible. If you get a compiler error that this constant is not defined, this code was
20// generated with a version of connect newer than the one compiled into your binary. You can fix the
21// problem by either regenerating this code with an older version of connect or updating the connect
22// version compiled into your binary.
23const _ = connect.IsAtLeastVersion1_13_0
24
25const (
26	// MergeRequestServiceName is the fully-qualified name of the MergeRequestService service.
27	MergeRequestServiceName = "ermite.MergeRequestService"
28)
29
30// These constants are the fully-qualified names of the RPCs defined in this package. They're
31// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
32//
33// Note that these are different from the fully-qualified method names used by
34// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
35// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
36// period.
37const (
38	// MergeRequestServiceCreateMergeRequestProcedure is the fully-qualified name of the
39	// MergeRequestService's CreateMergeRequest RPC.
40	MergeRequestServiceCreateMergeRequestProcedure = "/ermite.MergeRequestService/CreateMergeRequest"
41	// MergeRequestServiceListMergeRequestsProcedure is the fully-qualified name of the
42	// MergeRequestService's ListMergeRequests RPC.
43	MergeRequestServiceListMergeRequestsProcedure = "/ermite.MergeRequestService/ListMergeRequests"
44	// MergeRequestServiceGetMergeRequestProcedure is the fully-qualified name of the
45	// MergeRequestService's GetMergeRequest RPC.
46	MergeRequestServiceGetMergeRequestProcedure = "/ermite.MergeRequestService/GetMergeRequest"
47	// MergeRequestServiceAddCommentProcedure is the fully-qualified name of the MergeRequestService's
48	// AddComment RPC.
49	MergeRequestServiceAddCommentProcedure = "/ermite.MergeRequestService/AddComment"
50	// MergeRequestServiceEditCommentProcedure is the fully-qualified name of the MergeRequestService's
51	// EditComment RPC.
52	MergeRequestServiceEditCommentProcedure = "/ermite.MergeRequestService/EditComment"
53	// MergeRequestServiceDeleteCommentProcedure is the fully-qualified name of the
54	// MergeRequestService's DeleteComment RPC.
55	MergeRequestServiceDeleteCommentProcedure = "/ermite.MergeRequestService/DeleteComment"
56	// MergeRequestServiceResolveCommentProcedure is the fully-qualified name of the
57	// MergeRequestService's ResolveComment RPC.
58	MergeRequestServiceResolveCommentProcedure = "/ermite.MergeRequestService/ResolveComment"
59	// MergeRequestServiceCloseMergeRequestProcedure is the fully-qualified name of the
60	// MergeRequestService's CloseMergeRequest RPC.
61	MergeRequestServiceCloseMergeRequestProcedure = "/ermite.MergeRequestService/CloseMergeRequest"
62	// MergeRequestServiceMergeMergeRequestProcedure is the fully-qualified name of the
63	// MergeRequestService's MergeMergeRequest RPC.
64	MergeRequestServiceMergeMergeRequestProcedure = "/ermite.MergeRequestService/MergeMergeRequest"
65	// MergeRequestServiceMarkReadProcedure is the fully-qualified name of the MergeRequestService's
66	// MarkRead RPC.
67	MergeRequestServiceMarkReadProcedure = "/ermite.MergeRequestService/MarkRead"
68)
69
70// MergeRequestServiceClient is a client for the ermite.MergeRequestService service.
71type MergeRequestServiceClient interface {
72	// CreateMergeRequest opens a merge request. Needs the mr:write scope. Fails
73	// with invalid_argument if a text rule is broken, if a branch does not exist
74	// or if source and target are the same branch, and with already_exists if an
75	// open merge request already has the same source and target.
76	CreateMergeRequest(context.Context, *connect.Request[ermite.CreateMergeRequestRequest]) (*connect.Response[ermite.CreateMergeRequestResponse], error)
77	// ListMergeRequests lists the merge requests of a repository, highest
78	// number (newest) first, optionally restricted to one state. The listed
79	// merge requests carry no diff or comments; head_id is set. Fails with
80	// not_found if the repository does not exist or is not readable.
81	ListMergeRequests(context.Context, *connect.Request[ermite.ListMergeRequestsRequest]) (*connect.Response[ermite.ListMergeRequestsResponse], error)
82	// GetMergeRequest returns one merge request with its commits, its diff and
83	// its comments. The diff compares the target with the head (what the merge
84	// would bring: "target...head"), or, with since_last_read, the head the
85	// caller last marked read with the current head. Fails with not_found if
86	// the repository or the number is unknown.
87	GetMergeRequest(context.Context, *connect.Request[ermite.GetMergeRequestRequest]) (*connect.Response[ermite.GetMergeRequestResponse], error)
88	// AddComment adds a general comment, a comment on a line or a range of
89	// lines of the diff, or a reply to a root comment. Needs the mr:write
90	// scope; setting a verdict also needs the mr:review scope (permission_denied
91	// without it). Fails with invalid_argument if the text breaks a rule (it may
92	// be empty only with a verdict), if path, line, start_line and side do not
93	// designate lines of the current diff of the merge request, if reply_to is
94	// not the id of a root comment that is not deleted, if a reply sets path,
95	// line, start_line, side or verdict, or if a verdict is set on a reply; and
96	// with failed_precondition if the merge request is not open. A comment with
97	// VERDICT_APPROVE is created resolved.
98	AddComment(context.Context, *connect.Request[ermite.AddCommentRequest]) (*connect.Response[ermite.AddCommentResponse], error)
99	// EditComment replaces the text of a comment. Needs the mr:write scope, and
100	// only the author of the comment can edit it (permission_denied
101	// otherwise). Fails with invalid_argument if the text breaks a rule (it may
102	// be empty only for a comment with a verdict), with not_found if the comment
103	// is unknown, and with failed_precondition if the merge request is not open
104	// or the comment was deleted. Sending the current text succeeds and changes
105	// nothing.
106	EditComment(context.Context, *connect.Request[ermite.EditCommentRequest]) (*connect.Response[ermite.EditCommentResponse], error)
107	// DeleteComment deletes a comment: its text is emptied and deleted is set,
108	// while its id, anchor, replies and verdict remain. Needs the mr:write
109	// scope, and only the author of the comment can delete it
110	// (permission_denied otherwise). Fails with not_found if the comment is
111	// unknown and with failed_precondition if the merge request is not open.
112	// Deleting a comment already deleted succeeds and changes nothing.
113	DeleteComment(context.Context, *connect.Request[ermite.DeleteCommentRequest]) (*connect.Response[ermite.DeleteCommentResponse], error)
114	// ResolveComment marks a thread resolved or unresolved. Needs the mr:write
115	// scope. Resolution belongs to the root comment: on a reply it fails with
116	// invalid_argument. Fails with not_found if the comment is unknown and with
117	// failed_precondition if the merge request is not open. Setting the state
118	// the comment already has succeeds and changes nothing.
119	ResolveComment(context.Context, *connect.Request[ermite.ResolveCommentRequest]) (*connect.Response[ermite.ResolveCommentResponse], error)
120	// CloseMergeRequest closes an open merge request without merging it. Needs
121	// the mr:write scope. Fails with failed_precondition if the merge request
122	// is not open. A closed merge request cannot be reopened: open a new one.
123	CloseMergeRequest(context.Context, *connect.Request[ermite.CloseMergeRequestRequest]) (*connect.Response[ermite.CloseMergeRequestResponse], error)
124	// MergeMergeRequest merges an open merge request. Needs the mr:merge scope.
125	// The caller passes the head it reviewed: the server merges only if the
126	// source branch still points to it, so a push between review and merge is
127	// never merged unseen. Fails with invalid_argument if head_id is empty or
128	// not a commit id, and with failed_precondition if the merge request is not
129	// open, if the source branch no longer points to head_id ("branch moved,
130	// read again"), if the target is not an ancestor of the head (rebase and
131	// push again), if the mode is not allowed by RepoSettings, or if a check
132	// fails and RepoSettings.failing_checks_block is set. Merges of one
133	// repository run one at a time. Repeating a call that succeeded fails with
134	// failed_precondition (not open). On success the server publishes
135	// MergeRequestMerged then Pushed for the target branch.
136	MergeMergeRequest(context.Context, *connect.Request[ermite.MergeMergeRequestRequest]) (*connect.Response[ermite.MergeMergeRequestResponse], error)
137	// MarkRead records the head the caller has reviewed, for the since_last_read
138	// option of GetMergeRequest. There is one read position per merge request,
139	// the reviewer's. Needs the mr:write scope. Marking a commit that does not
140	// exist in the repository is invalid_argument.
141	MarkRead(context.Context, *connect.Request[ermite.MarkReadRequest]) (*connect.Response[ermite.MarkReadResponse], error)
142}
143
144// NewMergeRequestServiceClient constructs a client for the ermite.MergeRequestService service. By
145// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
146// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
147// connect.WithGRPC() or connect.WithGRPCWeb() options.
148//
149// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
150// http://api.acme.com or https://acme.com/grpc).
151func NewMergeRequestServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MergeRequestServiceClient {
152	baseURL = strings.TrimRight(baseURL, "/")
153	mergeRequestServiceMethods := ermite.File_ermite_merge_request_proto.Services().ByName("MergeRequestService").Methods()
154	return &mergeRequestServiceClient{
155		createMergeRequest: connect.NewClient[ermite.CreateMergeRequestRequest, ermite.CreateMergeRequestResponse](
156			httpClient,
157			baseURL+MergeRequestServiceCreateMergeRequestProcedure,
158			connect.WithSchema(mergeRequestServiceMethods.ByName("CreateMergeRequest")),
159			connect.WithClientOptions(opts...),
160		),
161		listMergeRequests: connect.NewClient[ermite.ListMergeRequestsRequest, ermite.ListMergeRequestsResponse](
162			httpClient,
163			baseURL+MergeRequestServiceListMergeRequestsProcedure,
164			connect.WithSchema(mergeRequestServiceMethods.ByName("ListMergeRequests")),
165			connect.WithClientOptions(opts...),
166		),
167		getMergeRequest: connect.NewClient[ermite.GetMergeRequestRequest, ermite.GetMergeRequestResponse](
168			httpClient,
169			baseURL+MergeRequestServiceGetMergeRequestProcedure,
170			connect.WithSchema(mergeRequestServiceMethods.ByName("GetMergeRequest")),
171			connect.WithClientOptions(opts...),
172		),
173		addComment: connect.NewClient[ermite.AddCommentRequest, ermite.AddCommentResponse](
174			httpClient,
175			baseURL+MergeRequestServiceAddCommentProcedure,
176			connect.WithSchema(mergeRequestServiceMethods.ByName("AddComment")),
177			connect.WithClientOptions(opts...),
178		),
179		editComment: connect.NewClient[ermite.EditCommentRequest, ermite.EditCommentResponse](
180			httpClient,
181			baseURL+MergeRequestServiceEditCommentProcedure,
182			connect.WithSchema(mergeRequestServiceMethods.ByName("EditComment")),
183			connect.WithClientOptions(opts...),
184		),
185		deleteComment: connect.NewClient[ermite.DeleteCommentRequest, ermite.DeleteCommentResponse](
186			httpClient,
187			baseURL+MergeRequestServiceDeleteCommentProcedure,
188			connect.WithSchema(mergeRequestServiceMethods.ByName("DeleteComment")),
189			connect.WithClientOptions(opts...),
190		),
191		resolveComment: connect.NewClient[ermite.ResolveCommentRequest, ermite.ResolveCommentResponse](
192			httpClient,
193			baseURL+MergeRequestServiceResolveCommentProcedure,
194			connect.WithSchema(mergeRequestServiceMethods.ByName("ResolveComment")),
195			connect.WithClientOptions(opts...),
196		),
197		closeMergeRequest: connect.NewClient[ermite.CloseMergeRequestRequest, ermite.CloseMergeRequestResponse](
198			httpClient,
199			baseURL+MergeRequestServiceCloseMergeRequestProcedure,
200			connect.WithSchema(mergeRequestServiceMethods.ByName("CloseMergeRequest")),
201			connect.WithClientOptions(opts...),
202		),
203		mergeMergeRequest: connect.NewClient[ermite.MergeMergeRequestRequest, ermite.MergeMergeRequestResponse](
204			httpClient,
205			baseURL+MergeRequestServiceMergeMergeRequestProcedure,
206			connect.WithSchema(mergeRequestServiceMethods.ByName("MergeMergeRequest")),
207			connect.WithClientOptions(opts...),
208		),
209		markRead: connect.NewClient[ermite.MarkReadRequest, ermite.MarkReadResponse](
210			httpClient,
211			baseURL+MergeRequestServiceMarkReadProcedure,
212			connect.WithSchema(mergeRequestServiceMethods.ByName("MarkRead")),
213			connect.WithClientOptions(opts...),
214		),
215	}
216}
217
218// mergeRequestServiceClient implements MergeRequestServiceClient.
219type mergeRequestServiceClient struct {
220	createMergeRequest *connect.Client[ermite.CreateMergeRequestRequest, ermite.CreateMergeRequestResponse]
221	listMergeRequests  *connect.Client[ermite.ListMergeRequestsRequest, ermite.ListMergeRequestsResponse]
222	getMergeRequest    *connect.Client[ermite.GetMergeRequestRequest, ermite.GetMergeRequestResponse]
223	addComment         *connect.Client[ermite.AddCommentRequest, ermite.AddCommentResponse]
224	editComment        *connect.Client[ermite.EditCommentRequest, ermite.EditCommentResponse]
225	deleteComment      *connect.Client[ermite.DeleteCommentRequest, ermite.DeleteCommentResponse]
226	resolveComment     *connect.Client[ermite.ResolveCommentRequest, ermite.ResolveCommentResponse]
227	closeMergeRequest  *connect.Client[ermite.CloseMergeRequestRequest, ermite.CloseMergeRequestResponse]
228	mergeMergeRequest  *connect.Client[ermite.MergeMergeRequestRequest, ermite.MergeMergeRequestResponse]
229	markRead           *connect.Client[ermite.MarkReadRequest, ermite.MarkReadResponse]
230}
231
232// CreateMergeRequest calls ermite.MergeRequestService.CreateMergeRequest.
233func (c *mergeRequestServiceClient) CreateMergeRequest(ctx context.Context, req *connect.Request[ermite.CreateMergeRequestRequest]) (*connect.Response[ermite.CreateMergeRequestResponse], error) {
234	return c.createMergeRequest.CallUnary(ctx, req)
235}
236
237// ListMergeRequests calls ermite.MergeRequestService.ListMergeRequests.
238func (c *mergeRequestServiceClient) ListMergeRequests(ctx context.Context, req *connect.Request[ermite.ListMergeRequestsRequest]) (*connect.Response[ermite.ListMergeRequestsResponse], error) {
239	return c.listMergeRequests.CallUnary(ctx, req)
240}
241
242// GetMergeRequest calls ermite.MergeRequestService.GetMergeRequest.
243func (c *mergeRequestServiceClient) GetMergeRequest(ctx context.Context, req *connect.Request[ermite.GetMergeRequestRequest]) (*connect.Response[ermite.GetMergeRequestResponse], error) {
244	return c.getMergeRequest.CallUnary(ctx, req)
245}
246
247// AddComment calls ermite.MergeRequestService.AddComment.
248func (c *mergeRequestServiceClient) AddComment(ctx context.Context, req *connect.Request[ermite.AddCommentRequest]) (*connect.Response[ermite.AddCommentResponse], error) {
249	return c.addComment.CallUnary(ctx, req)
250}
251
252// EditComment calls ermite.MergeRequestService.EditComment.
253func (c *mergeRequestServiceClient) EditComment(ctx context.Context, req *connect.Request[ermite.EditCommentRequest]) (*connect.Response[ermite.EditCommentResponse], error) {
254	return c.editComment.CallUnary(ctx, req)
255}
256
257// DeleteComment calls ermite.MergeRequestService.DeleteComment.
258func (c *mergeRequestServiceClient) DeleteComment(ctx context.Context, req *connect.Request[ermite.DeleteCommentRequest]) (*connect.Response[ermite.DeleteCommentResponse], error) {
259	return c.deleteComment.CallUnary(ctx, req)
260}
261
262// ResolveComment calls ermite.MergeRequestService.ResolveComment.
263func (c *mergeRequestServiceClient) ResolveComment(ctx context.Context, req *connect.Request[ermite.ResolveCommentRequest]) (*connect.Response[ermite.ResolveCommentResponse], error) {
264	return c.resolveComment.CallUnary(ctx, req)
265}
266
267// CloseMergeRequest calls ermite.MergeRequestService.CloseMergeRequest.
268func (c *mergeRequestServiceClient) CloseMergeRequest(ctx context.Context, req *connect.Request[ermite.CloseMergeRequestRequest]) (*connect.Response[ermite.CloseMergeRequestResponse], error) {
269	return c.closeMergeRequest.CallUnary(ctx, req)
270}
271
272// MergeMergeRequest calls ermite.MergeRequestService.MergeMergeRequest.
273func (c *mergeRequestServiceClient) MergeMergeRequest(ctx context.Context, req *connect.Request[ermite.MergeMergeRequestRequest]) (*connect.Response[ermite.MergeMergeRequestResponse], error) {
274	return c.mergeMergeRequest.CallUnary(ctx, req)
275}
276
277// MarkRead calls ermite.MergeRequestService.MarkRead.
278func (c *mergeRequestServiceClient) MarkRead(ctx context.Context, req *connect.Request[ermite.MarkReadRequest]) (*connect.Response[ermite.MarkReadResponse], error) {
279	return c.markRead.CallUnary(ctx, req)
280}
281
282// MergeRequestServiceHandler is an implementation of the ermite.MergeRequestService service.
283type MergeRequestServiceHandler interface {
284	// CreateMergeRequest opens a merge request. Needs the mr:write scope. Fails
285	// with invalid_argument if a text rule is broken, if a branch does not exist
286	// or if source and target are the same branch, and with already_exists if an
287	// open merge request already has the same source and target.
288	CreateMergeRequest(context.Context, *connect.Request[ermite.CreateMergeRequestRequest]) (*connect.Response[ermite.CreateMergeRequestResponse], error)
289	// ListMergeRequests lists the merge requests of a repository, highest
290	// number (newest) first, optionally restricted to one state. The listed
291	// merge requests carry no diff or comments; head_id is set. Fails with
292	// not_found if the repository does not exist or is not readable.
293	ListMergeRequests(context.Context, *connect.Request[ermite.ListMergeRequestsRequest]) (*connect.Response[ermite.ListMergeRequestsResponse], error)
294	// GetMergeRequest returns one merge request with its commits, its diff and
295	// its comments. The diff compares the target with the head (what the merge
296	// would bring: "target...head"), or, with since_last_read, the head the
297	// caller last marked read with the current head. Fails with not_found if
298	// the repository or the number is unknown.
299	GetMergeRequest(context.Context, *connect.Request[ermite.GetMergeRequestRequest]) (*connect.Response[ermite.GetMergeRequestResponse], error)
300	// AddComment adds a general comment, a comment on a line or a range of
301	// lines of the diff, or a reply to a root comment. Needs the mr:write
302	// scope; setting a verdict also needs the mr:review scope (permission_denied
303	// without it). Fails with invalid_argument if the text breaks a rule (it may
304	// be empty only with a verdict), if path, line, start_line and side do not
305	// designate lines of the current diff of the merge request, if reply_to is
306	// not the id of a root comment that is not deleted, if a reply sets path,
307	// line, start_line, side or verdict, or if a verdict is set on a reply; and
308	// with failed_precondition if the merge request is not open. A comment with
309	// VERDICT_APPROVE is created resolved.
310	AddComment(context.Context, *connect.Request[ermite.AddCommentRequest]) (*connect.Response[ermite.AddCommentResponse], error)
311	// EditComment replaces the text of a comment. Needs the mr:write scope, and
312	// only the author of the comment can edit it (permission_denied
313	// otherwise). Fails with invalid_argument if the text breaks a rule (it may
314	// be empty only for a comment with a verdict), with not_found if the comment
315	// is unknown, and with failed_precondition if the merge request is not open
316	// or the comment was deleted. Sending the current text succeeds and changes
317	// nothing.
318	EditComment(context.Context, *connect.Request[ermite.EditCommentRequest]) (*connect.Response[ermite.EditCommentResponse], error)
319	// DeleteComment deletes a comment: its text is emptied and deleted is set,
320	// while its id, anchor, replies and verdict remain. Needs the mr:write
321	// scope, and only the author of the comment can delete it
322	// (permission_denied otherwise). Fails with not_found if the comment is
323	// unknown and with failed_precondition if the merge request is not open.
324	// Deleting a comment already deleted succeeds and changes nothing.
325	DeleteComment(context.Context, *connect.Request[ermite.DeleteCommentRequest]) (*connect.Response[ermite.DeleteCommentResponse], error)
326	// ResolveComment marks a thread resolved or unresolved. Needs the mr:write
327	// scope. Resolution belongs to the root comment: on a reply it fails with
328	// invalid_argument. Fails with not_found if the comment is unknown and with
329	// failed_precondition if the merge request is not open. Setting the state
330	// the comment already has succeeds and changes nothing.
331	ResolveComment(context.Context, *connect.Request[ermite.ResolveCommentRequest]) (*connect.Response[ermite.ResolveCommentResponse], error)
332	// CloseMergeRequest closes an open merge request without merging it. Needs
333	// the mr:write scope. Fails with failed_precondition if the merge request
334	// is not open. A closed merge request cannot be reopened: open a new one.
335	CloseMergeRequest(context.Context, *connect.Request[ermite.CloseMergeRequestRequest]) (*connect.Response[ermite.CloseMergeRequestResponse], error)
336	// MergeMergeRequest merges an open merge request. Needs the mr:merge scope.
337	// The caller passes the head it reviewed: the server merges only if the
338	// source branch still points to it, so a push between review and merge is
339	// never merged unseen. Fails with invalid_argument if head_id is empty or
340	// not a commit id, and with failed_precondition if the merge request is not
341	// open, if the source branch no longer points to head_id ("branch moved,
342	// read again"), if the target is not an ancestor of the head (rebase and
343	// push again), if the mode is not allowed by RepoSettings, or if a check
344	// fails and RepoSettings.failing_checks_block is set. Merges of one
345	// repository run one at a time. Repeating a call that succeeded fails with
346	// failed_precondition (not open). On success the server publishes
347	// MergeRequestMerged then Pushed for the target branch.
348	MergeMergeRequest(context.Context, *connect.Request[ermite.MergeMergeRequestRequest]) (*connect.Response[ermite.MergeMergeRequestResponse], error)
349	// MarkRead records the head the caller has reviewed, for the since_last_read
350	// option of GetMergeRequest. There is one read position per merge request,
351	// the reviewer's. Needs the mr:write scope. Marking a commit that does not
352	// exist in the repository is invalid_argument.
353	MarkRead(context.Context, *connect.Request[ermite.MarkReadRequest]) (*connect.Response[ermite.MarkReadResponse], error)
354}
355
356// NewMergeRequestServiceHandler builds an HTTP handler from the service implementation. It returns
357// the path on which to mount the handler and the handler itself.
358//
359// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
360// and JSON codecs. They also support gzip compression.
361func NewMergeRequestServiceHandler(svc MergeRequestServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
362	mergeRequestServiceMethods := ermite.File_ermite_merge_request_proto.Services().ByName("MergeRequestService").Methods()
363	mergeRequestServiceCreateMergeRequestHandler := connect.NewUnaryHandler(
364		MergeRequestServiceCreateMergeRequestProcedure,
365		svc.CreateMergeRequest,
366		connect.WithSchema(mergeRequestServiceMethods.ByName("CreateMergeRequest")),
367		connect.WithHandlerOptions(opts...),
368	)
369	mergeRequestServiceListMergeRequestsHandler := connect.NewUnaryHandler(
370		MergeRequestServiceListMergeRequestsProcedure,
371		svc.ListMergeRequests,
372		connect.WithSchema(mergeRequestServiceMethods.ByName("ListMergeRequests")),
373		connect.WithHandlerOptions(opts...),
374	)
375	mergeRequestServiceGetMergeRequestHandler := connect.NewUnaryHandler(
376		MergeRequestServiceGetMergeRequestProcedure,
377		svc.GetMergeRequest,
378		connect.WithSchema(mergeRequestServiceMethods.ByName("GetMergeRequest")),
379		connect.WithHandlerOptions(opts...),
380	)
381	mergeRequestServiceAddCommentHandler := connect.NewUnaryHandler(
382		MergeRequestServiceAddCommentProcedure,
383		svc.AddComment,
384		connect.WithSchema(mergeRequestServiceMethods.ByName("AddComment")),
385		connect.WithHandlerOptions(opts...),
386	)
387	mergeRequestServiceEditCommentHandler := connect.NewUnaryHandler(
388		MergeRequestServiceEditCommentProcedure,
389		svc.EditComment,
390		connect.WithSchema(mergeRequestServiceMethods.ByName("EditComment")),
391		connect.WithHandlerOptions(opts...),
392	)
393	mergeRequestServiceDeleteCommentHandler := connect.NewUnaryHandler(
394		MergeRequestServiceDeleteCommentProcedure,
395		svc.DeleteComment,
396		connect.WithSchema(mergeRequestServiceMethods.ByName("DeleteComment")),
397		connect.WithHandlerOptions(opts...),
398	)
399	mergeRequestServiceResolveCommentHandler := connect.NewUnaryHandler(
400		MergeRequestServiceResolveCommentProcedure,
401		svc.ResolveComment,
402		connect.WithSchema(mergeRequestServiceMethods.ByName("ResolveComment")),
403		connect.WithHandlerOptions(opts...),
404	)
405	mergeRequestServiceCloseMergeRequestHandler := connect.NewUnaryHandler(
406		MergeRequestServiceCloseMergeRequestProcedure,
407		svc.CloseMergeRequest,
408		connect.WithSchema(mergeRequestServiceMethods.ByName("CloseMergeRequest")),
409		connect.WithHandlerOptions(opts...),
410	)
411	mergeRequestServiceMergeMergeRequestHandler := connect.NewUnaryHandler(
412		MergeRequestServiceMergeMergeRequestProcedure,
413		svc.MergeMergeRequest,
414		connect.WithSchema(mergeRequestServiceMethods.ByName("MergeMergeRequest")),
415		connect.WithHandlerOptions(opts...),
416	)
417	mergeRequestServiceMarkReadHandler := connect.NewUnaryHandler(
418		MergeRequestServiceMarkReadProcedure,
419		svc.MarkRead,
420		connect.WithSchema(mergeRequestServiceMethods.ByName("MarkRead")),
421		connect.WithHandlerOptions(opts...),
422	)
423	return "/ermite.MergeRequestService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
424		switch r.URL.Path {
425		case MergeRequestServiceCreateMergeRequestProcedure:
426			mergeRequestServiceCreateMergeRequestHandler.ServeHTTP(w, r)
427		case MergeRequestServiceListMergeRequestsProcedure:
428			mergeRequestServiceListMergeRequestsHandler.ServeHTTP(w, r)
429		case MergeRequestServiceGetMergeRequestProcedure:
430			mergeRequestServiceGetMergeRequestHandler.ServeHTTP(w, r)
431		case MergeRequestServiceAddCommentProcedure:
432			mergeRequestServiceAddCommentHandler.ServeHTTP(w, r)
433		case MergeRequestServiceEditCommentProcedure:
434			mergeRequestServiceEditCommentHandler.ServeHTTP(w, r)
435		case MergeRequestServiceDeleteCommentProcedure:
436			mergeRequestServiceDeleteCommentHandler.ServeHTTP(w, r)
437		case MergeRequestServiceResolveCommentProcedure:
438			mergeRequestServiceResolveCommentHandler.ServeHTTP(w, r)
439		case MergeRequestServiceCloseMergeRequestProcedure:
440			mergeRequestServiceCloseMergeRequestHandler.ServeHTTP(w, r)
441		case MergeRequestServiceMergeMergeRequestProcedure:
442			mergeRequestServiceMergeMergeRequestHandler.ServeHTTP(w, r)
443		case MergeRequestServiceMarkReadProcedure:
444			mergeRequestServiceMarkReadHandler.ServeHTTP(w, r)
445		default:
446			http.NotFound(w, r)
447		}
448	})
449}
450
451// UnimplementedMergeRequestServiceHandler returns CodeUnimplemented from all methods.
452type UnimplementedMergeRequestServiceHandler struct{}
453
454func (UnimplementedMergeRequestServiceHandler) CreateMergeRequest(context.Context, *connect.Request[ermite.CreateMergeRequestRequest]) (*connect.Response[ermite.CreateMergeRequestResponse], error) {
455	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.CreateMergeRequest is not implemented"))
456}
457
458func (UnimplementedMergeRequestServiceHandler) ListMergeRequests(context.Context, *connect.Request[ermite.ListMergeRequestsRequest]) (*connect.Response[ermite.ListMergeRequestsResponse], error) {
459	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.ListMergeRequests is not implemented"))
460}
461
462func (UnimplementedMergeRequestServiceHandler) GetMergeRequest(context.Context, *connect.Request[ermite.GetMergeRequestRequest]) (*connect.Response[ermite.GetMergeRequestResponse], error) {
463	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.GetMergeRequest is not implemented"))
464}
465
466func (UnimplementedMergeRequestServiceHandler) AddComment(context.Context, *connect.Request[ermite.AddCommentRequest]) (*connect.Response[ermite.AddCommentResponse], error) {
467	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.AddComment is not implemented"))
468}
469
470func (UnimplementedMergeRequestServiceHandler) EditComment(context.Context, *connect.Request[ermite.EditCommentRequest]) (*connect.Response[ermite.EditCommentResponse], error) {
471	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.EditComment is not implemented"))
472}
473
474func (UnimplementedMergeRequestServiceHandler) DeleteComment(context.Context, *connect.Request[ermite.DeleteCommentRequest]) (*connect.Response[ermite.DeleteCommentResponse], error) {
475	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.DeleteComment is not implemented"))
476}
477
478func (UnimplementedMergeRequestServiceHandler) ResolveComment(context.Context, *connect.Request[ermite.ResolveCommentRequest]) (*connect.Response[ermite.ResolveCommentResponse], error) {
479	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.ResolveComment is not implemented"))
480}
481
482func (UnimplementedMergeRequestServiceHandler) CloseMergeRequest(context.Context, *connect.Request[ermite.CloseMergeRequestRequest]) (*connect.Response[ermite.CloseMergeRequestResponse], error) {
483	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.CloseMergeRequest is not implemented"))
484}
485
486func (UnimplementedMergeRequestServiceHandler) MergeMergeRequest(context.Context, *connect.Request[ermite.MergeMergeRequestRequest]) (*connect.Response[ermite.MergeMergeRequestResponse], error) {
487	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.MergeMergeRequest is not implemented"))
488}
489
490func (UnimplementedMergeRequestServiceHandler) MarkRead(context.Context, *connect.Request[ermite.MarkReadRequest]) (*connect.Response[ermite.MarkReadResponse], error) {
491	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.MergeRequestService.MarkRead is not implemented"))
492}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 18

↑↓ moveenter openesc close