v0.11.0 94ffd87

signature.connect.go RawHistoryFolder

1// SPDX-License-Identifier: MIT
2
3// Code generated by protoc-gen-connect-go. DO NOT EDIT.
4//
5// Source: ermite/signature.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	// TrustedKeyServiceName is the fully-qualified name of the TrustedKeyService service.
27	TrustedKeyServiceName = "ermite.TrustedKeyService"
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	// TrustedKeyServiceListTrustedKeysProcedure is the fully-qualified name of the TrustedKeyService's
39	// ListTrustedKeys RPC.
40	TrustedKeyServiceListTrustedKeysProcedure = "/ermite.TrustedKeyService/ListTrustedKeys"
41	// TrustedKeyServiceAddTrustedKeyProcedure is the fully-qualified name of the TrustedKeyService's
42	// AddTrustedKey RPC.
43	TrustedKeyServiceAddTrustedKeyProcedure = "/ermite.TrustedKeyService/AddTrustedKey"
44	// TrustedKeyServiceRemoveTrustedKeyProcedure is the fully-qualified name of the TrustedKeyService's
45	// RemoveTrustedKey RPC.
46	TrustedKeyServiceRemoveTrustedKeyProcedure = "/ermite.TrustedKeyService/RemoveTrustedKey"
47)
48
49// TrustedKeyServiceClient is a client for the ermite.TrustedKeyService service.
50type TrustedKeyServiceClient interface {
51	// ListTrustedKeys lists the keys, the builtin key first. Any authenticated
52	// caller may.
53	ListTrustedKeys(context.Context, *connect.Request[ermite.ListTrustedKeysRequest]) (*connect.Response[ermite.ListTrustedKeysResponse], error)
54	// AddTrustedKey adds a key. Owner only. invalid_argument for a key that
55	// does not parse, a private key, no or too many emails; already_exists for
56	// a key already listed; resource_exhausted beyond 100 keys.
57	AddTrustedKey(context.Context, *connect.Request[ermite.AddTrustedKeyRequest]) (*connect.Response[ermite.AddTrustedKeyResponse], error)
58	// RemoveTrustedKey removes a key. Owner only. not_found for an unknown id;
59	// failed_precondition for the builtin key.
60	RemoveTrustedKey(context.Context, *connect.Request[ermite.RemoveTrustedKeyRequest]) (*connect.Response[ermite.RemoveTrustedKeyResponse], error)
61}
62
63// NewTrustedKeyServiceClient constructs a client for the ermite.TrustedKeyService service. By
64// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
65// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
66// connect.WithGRPC() or connect.WithGRPCWeb() options.
67//
68// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
69// http://api.acme.com or https://acme.com/grpc).
70func NewTrustedKeyServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) TrustedKeyServiceClient {
71	baseURL = strings.TrimRight(baseURL, "/")
72	trustedKeyServiceMethods := ermite.File_ermite_signature_proto.Services().ByName("TrustedKeyService").Methods()
73	return &trustedKeyServiceClient{
74		listTrustedKeys: connect.NewClient[ermite.ListTrustedKeysRequest, ermite.ListTrustedKeysResponse](
75			httpClient,
76			baseURL+TrustedKeyServiceListTrustedKeysProcedure,
77			connect.WithSchema(trustedKeyServiceMethods.ByName("ListTrustedKeys")),
78			connect.WithClientOptions(opts...),
79		),
80		addTrustedKey: connect.NewClient[ermite.AddTrustedKeyRequest, ermite.AddTrustedKeyResponse](
81			httpClient,
82			baseURL+TrustedKeyServiceAddTrustedKeyProcedure,
83			connect.WithSchema(trustedKeyServiceMethods.ByName("AddTrustedKey")),
84			connect.WithClientOptions(opts...),
85		),
86		removeTrustedKey: connect.NewClient[ermite.RemoveTrustedKeyRequest, ermite.RemoveTrustedKeyResponse](
87			httpClient,
88			baseURL+TrustedKeyServiceRemoveTrustedKeyProcedure,
89			connect.WithSchema(trustedKeyServiceMethods.ByName("RemoveTrustedKey")),
90			connect.WithClientOptions(opts...),
91		),
92	}
93}
94
95// trustedKeyServiceClient implements TrustedKeyServiceClient.
96type trustedKeyServiceClient struct {
97	listTrustedKeys  *connect.Client[ermite.ListTrustedKeysRequest, ermite.ListTrustedKeysResponse]
98	addTrustedKey    *connect.Client[ermite.AddTrustedKeyRequest, ermite.AddTrustedKeyResponse]
99	removeTrustedKey *connect.Client[ermite.RemoveTrustedKeyRequest, ermite.RemoveTrustedKeyResponse]
100}
101
102// ListTrustedKeys calls ermite.TrustedKeyService.ListTrustedKeys.
103func (c *trustedKeyServiceClient) ListTrustedKeys(ctx context.Context, req *connect.Request[ermite.ListTrustedKeysRequest]) (*connect.Response[ermite.ListTrustedKeysResponse], error) {
104	return c.listTrustedKeys.CallUnary(ctx, req)
105}
106
107// AddTrustedKey calls ermite.TrustedKeyService.AddTrustedKey.
108func (c *trustedKeyServiceClient) AddTrustedKey(ctx context.Context, req *connect.Request[ermite.AddTrustedKeyRequest]) (*connect.Response[ermite.AddTrustedKeyResponse], error) {
109	return c.addTrustedKey.CallUnary(ctx, req)
110}
111
112// RemoveTrustedKey calls ermite.TrustedKeyService.RemoveTrustedKey.
113func (c *trustedKeyServiceClient) RemoveTrustedKey(ctx context.Context, req *connect.Request[ermite.RemoveTrustedKeyRequest]) (*connect.Response[ermite.RemoveTrustedKeyResponse], error) {
114	return c.removeTrustedKey.CallUnary(ctx, req)
115}
116
117// TrustedKeyServiceHandler is an implementation of the ermite.TrustedKeyService service.
118type TrustedKeyServiceHandler interface {
119	// ListTrustedKeys lists the keys, the builtin key first. Any authenticated
120	// caller may.
121	ListTrustedKeys(context.Context, *connect.Request[ermite.ListTrustedKeysRequest]) (*connect.Response[ermite.ListTrustedKeysResponse], error)
122	// AddTrustedKey adds a key. Owner only. invalid_argument for a key that
123	// does not parse, a private key, no or too many emails; already_exists for
124	// a key already listed; resource_exhausted beyond 100 keys.
125	AddTrustedKey(context.Context, *connect.Request[ermite.AddTrustedKeyRequest]) (*connect.Response[ermite.AddTrustedKeyResponse], error)
126	// RemoveTrustedKey removes a key. Owner only. not_found for an unknown id;
127	// failed_precondition for the builtin key.
128	RemoveTrustedKey(context.Context, *connect.Request[ermite.RemoveTrustedKeyRequest]) (*connect.Response[ermite.RemoveTrustedKeyResponse], error)
129}
130
131// NewTrustedKeyServiceHandler builds an HTTP handler from the service implementation. It returns
132// the path on which to mount the handler and the handler itself.
133//
134// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
135// and JSON codecs. They also support gzip compression.
136func NewTrustedKeyServiceHandler(svc TrustedKeyServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
137	trustedKeyServiceMethods := ermite.File_ermite_signature_proto.Services().ByName("TrustedKeyService").Methods()
138	trustedKeyServiceListTrustedKeysHandler := connect.NewUnaryHandler(
139		TrustedKeyServiceListTrustedKeysProcedure,
140		svc.ListTrustedKeys,
141		connect.WithSchema(trustedKeyServiceMethods.ByName("ListTrustedKeys")),
142		connect.WithHandlerOptions(opts...),
143	)
144	trustedKeyServiceAddTrustedKeyHandler := connect.NewUnaryHandler(
145		TrustedKeyServiceAddTrustedKeyProcedure,
146		svc.AddTrustedKey,
147		connect.WithSchema(trustedKeyServiceMethods.ByName("AddTrustedKey")),
148		connect.WithHandlerOptions(opts...),
149	)
150	trustedKeyServiceRemoveTrustedKeyHandler := connect.NewUnaryHandler(
151		TrustedKeyServiceRemoveTrustedKeyProcedure,
152		svc.RemoveTrustedKey,
153		connect.WithSchema(trustedKeyServiceMethods.ByName("RemoveTrustedKey")),
154		connect.WithHandlerOptions(opts...),
155	)
156	return "/ermite.TrustedKeyService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
157		switch r.URL.Path {
158		case TrustedKeyServiceListTrustedKeysProcedure:
159			trustedKeyServiceListTrustedKeysHandler.ServeHTTP(w, r)
160		case TrustedKeyServiceAddTrustedKeyProcedure:
161			trustedKeyServiceAddTrustedKeyHandler.ServeHTTP(w, r)
162		case TrustedKeyServiceRemoveTrustedKeyProcedure:
163			trustedKeyServiceRemoveTrustedKeyHandler.ServeHTTP(w, r)
164		default:
165			http.NotFound(w, r)
166		}
167	})
168}
169
170// UnimplementedTrustedKeyServiceHandler returns CodeUnimplemented from all methods.
171type UnimplementedTrustedKeyServiceHandler struct{}
172
173func (UnimplementedTrustedKeyServiceHandler) ListTrustedKeys(context.Context, *connect.Request[ermite.ListTrustedKeysRequest]) (*connect.Response[ermite.ListTrustedKeysResponse], error) {
174	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.TrustedKeyService.ListTrustedKeys is not implemented"))
175}
176
177func (UnimplementedTrustedKeyServiceHandler) AddTrustedKey(context.Context, *connect.Request[ermite.AddTrustedKeyRequest]) (*connect.Response[ermite.AddTrustedKeyResponse], error) {
178	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.TrustedKeyService.AddTrustedKey is not implemented"))
179}
180
181func (UnimplementedTrustedKeyServiceHandler) RemoveTrustedKey(context.Context, *connect.Request[ermite.RemoveTrustedKeyRequest]) (*connect.Response[ermite.RemoveTrustedKeyResponse], error) {
182	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.TrustedKeyService.RemoveTrustedKey is not implemented"))
183}

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