跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

guestservice_grpc.pb.go

265 行 · 11.1 KB历史下载
1// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2// versions:
3// - protoc-gen-go-grpc [version omitted for reproducibility]
4// - protoc [version omitted for reproducibility]
5// source: guestservice.proto
6
7package api
8
9import (
10 context "context"
11 grpc "google.golang.org/grpc"
12 codes "google.golang.org/grpc/codes"
13 status "google.golang.org/grpc/status"
14 emptypb "google.golang.org/protobuf/types/known/emptypb"
15)
16
17// This is a compile-time assertion to ensure that this generated file
18// is compatible with the grpc package it is being compiled against.
19// Requires gRPC-Go v1.64.0 or later.
20const _ = grpc.SupportPackageIsVersion9
21
22const (
23 GuestService_GetInfo_FullMethodName = "/GuestService/GetInfo"
24 GuestService_GetEvents_FullMethodName = "/GuestService/GetEvents"
25 GuestService_PostInotify_FullMethodName = "/GuestService/PostInotify"
26 GuestService_Tunnel_FullMethodName = "/GuestService/Tunnel"
27 GuestService_SyncTime_FullMethodName = "/GuestService/SyncTime"
28)
29
30// GuestServiceClient is the client API for GuestService service.
31//
32// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
33type GuestServiceClient interface {
34 GetInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Info, error)
35 GetEvents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
36 PostInotify(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[Inotify, emptypb.Empty], error)
37 Tunnel(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[TunnelMessage, TunnelMessage], error)
38 SyncTime(ctx context.Context, in *TimeSyncRequest, opts ...grpc.CallOption) (*TimeSyncResponse, error)
39}
40
41type guestServiceClient struct {
42 cc grpc.ClientConnInterface
43}
44
45func NewGuestServiceClient(cc grpc.ClientConnInterface) GuestServiceClient {
46 return &guestServiceClient{cc}
47}
48
49func (c *guestServiceClient) GetInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Info, error) {
50 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
51 out := new(Info)
52 err := c.cc.Invoke(ctx, GuestService_GetInfo_FullMethodName, in, out, cOpts...)
53 if err != nil {
54 return nil, err
55 }
56 return out, nil
57}
58
59func (c *guestServiceClient) GetEvents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error) {
60 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
61 stream, err := c.cc.NewStream(ctx, &GuestService_ServiceDesc.Streams[0], GuestService_GetEvents_FullMethodName, cOpts...)
62 if err != nil {
63 return nil, err
64 }
65 x := &grpc.GenericClientStream[emptypb.Empty, Event]{ClientStream: stream}
66 if err := x.ClientStream.SendMsg(in); err != nil {
67 return nil, err
68 }
69 if err := x.ClientStream.CloseSend(); err != nil {
70 return nil, err
71 }
72 return x, nil
73}
74
75// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
76type GuestService_GetEventsClient = grpc.ServerStreamingClient[Event]
77
78func (c *guestServiceClient) PostInotify(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[Inotify, emptypb.Empty], error) {
79 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
80 stream, err := c.cc.NewStream(ctx, &GuestService_ServiceDesc.Streams[1], GuestService_PostInotify_FullMethodName, cOpts...)
81 if err != nil {
82 return nil, err
83 }
84 x := &grpc.GenericClientStream[Inotify, emptypb.Empty]{ClientStream: stream}
85 return x, nil
86}
87
88// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
89type GuestService_PostInotifyClient = grpc.ClientStreamingClient[Inotify, emptypb.Empty]
90
91func (c *guestServiceClient) Tunnel(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[TunnelMessage, TunnelMessage], error) {
92 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
93 stream, err := c.cc.NewStream(ctx, &GuestService_ServiceDesc.Streams[2], GuestService_Tunnel_FullMethodName, cOpts...)
94 if err != nil {
95 return nil, err
96 }
97 x := &grpc.GenericClientStream[TunnelMessage, TunnelMessage]{ClientStream: stream}
98 return x, nil
99}
100
101// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
102type GuestService_TunnelClient = grpc.BidiStreamingClient[TunnelMessage, TunnelMessage]
103
104func (c *guestServiceClient) SyncTime(ctx context.Context, in *TimeSyncRequest, opts ...grpc.CallOption) (*TimeSyncResponse, error) {
105 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
106 out := new(TimeSyncResponse)
107 err := c.cc.Invoke(ctx, GuestService_SyncTime_FullMethodName, in, out, cOpts...)
108 if err != nil {
109 return nil, err
110 }
111 return out, nil
112}
113
114// GuestServiceServer is the server API for GuestService service.
115// All implementations must embed UnimplementedGuestServiceServer
116// for forward compatibility.
117type GuestServiceServer interface {
118 GetInfo(context.Context, *emptypb.Empty) (*Info, error)
119 GetEvents(*emptypb.Empty, grpc.ServerStreamingServer[Event]) error
120 PostInotify(grpc.ClientStreamingServer[Inotify, emptypb.Empty]) error
121 Tunnel(grpc.BidiStreamingServer[TunnelMessage, TunnelMessage]) error
122 SyncTime(context.Context, *TimeSyncRequest) (*TimeSyncResponse, error)
123 mustEmbedUnimplementedGuestServiceServer()
124}
125
126// UnimplementedGuestServiceServer must be embedded to have
127// forward compatible implementations.
128//
129// NOTE: this should be embedded by value instead of pointer to avoid a nil
130// pointer dereference when methods are called.
131type UnimplementedGuestServiceServer struct{}
132
133func (UnimplementedGuestServiceServer) GetInfo(context.Context, *emptypb.Empty) (*Info, error) {
134 return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
135}
136func (UnimplementedGuestServiceServer) GetEvents(*emptypb.Empty, grpc.ServerStreamingServer[Event]) error {
137 return status.Errorf(codes.Unimplemented, "method GetEvents not implemented")
138}
139func (UnimplementedGuestServiceServer) PostInotify(grpc.ClientStreamingServer[Inotify, emptypb.Empty]) error {
140 return status.Errorf(codes.Unimplemented, "method PostInotify not implemented")
141}
142func (UnimplementedGuestServiceServer) Tunnel(grpc.BidiStreamingServer[TunnelMessage, TunnelMessage]) error {
143 return status.Errorf(codes.Unimplemented, "method Tunnel not implemented")
144}
145func (UnimplementedGuestServiceServer) SyncTime(context.Context, *TimeSyncRequest) (*TimeSyncResponse, error) {
146 return nil, status.Errorf(codes.Unimplemented, "method SyncTime not implemented")
147}
148func (UnimplementedGuestServiceServer) mustEmbedUnimplementedGuestServiceServer() {}
149func (UnimplementedGuestServiceServer) testEmbeddedByValue() {}
150
151// UnsafeGuestServiceServer may be embedded to opt out of forward compatibility for this service.
152// Use of this interface is not recommended, as added methods to GuestServiceServer will
153// result in compilation errors.
154type UnsafeGuestServiceServer interface {
155 mustEmbedUnimplementedGuestServiceServer()
156}
157
158func RegisterGuestServiceServer(s grpc.ServiceRegistrar, srv GuestServiceServer) {
159 // If the following call pancis, it indicates UnimplementedGuestServiceServer was
160 // embedded by pointer and is nil. This will cause panics if an
161 // unimplemented method is ever invoked, so we test this at initialization
162 // time to prevent it from happening at runtime later due to I/O.
163 if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
164 t.testEmbeddedByValue()
165 }
166 s.RegisterService(&GuestService_ServiceDesc, srv)
167}
168
169func _GuestService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
170 in := new(emptypb.Empty)
171 if err := dec(in); err != nil {
172 return nil, err
173 }
174 if interceptor == nil {
175 return srv.(GuestServiceServer).GetInfo(ctx, in)
176 }
177 info := &grpc.UnaryServerInfo{
178 Server: srv,
179 FullMethod: GuestService_GetInfo_FullMethodName,
180 }
181 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
182 return srv.(GuestServiceServer).GetInfo(ctx, req.(*emptypb.Empty))
183 }
184 return interceptor(ctx, in, info, handler)
185}
186
187func _GuestService_GetEvents_Handler(srv interface{}, stream grpc.ServerStream) error {
188 m := new(emptypb.Empty)
189 if err := stream.RecvMsg(m); err != nil {
190 return err
191 }
192 return srv.(GuestServiceServer).GetEvents(m, &grpc.GenericServerStream[emptypb.Empty, Event]{ServerStream: stream})
193}
194
195// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
196type GuestService_GetEventsServer = grpc.ServerStreamingServer[Event]
197
198func _GuestService_PostInotify_Handler(srv interface{}, stream grpc.ServerStream) error {
199 return srv.(GuestServiceServer).PostInotify(&grpc.GenericServerStream[Inotify, emptypb.Empty]{ServerStream: stream})
200}
201
202// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
203type GuestService_PostInotifyServer = grpc.ClientStreamingServer[Inotify, emptypb.Empty]
204
205func _GuestService_Tunnel_Handler(srv interface{}, stream grpc.ServerStream) error {
206 return srv.(GuestServiceServer).Tunnel(&grpc.GenericServerStream[TunnelMessage, TunnelMessage]{ServerStream: stream})
207}
208
209// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
210type GuestService_TunnelServer = grpc.BidiStreamingServer[TunnelMessage, TunnelMessage]
211
212func _GuestService_SyncTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
213 in := new(TimeSyncRequest)
214 if err := dec(in); err != nil {
215 return nil, err
216 }
217 if interceptor == nil {
218 return srv.(GuestServiceServer).SyncTime(ctx, in)
219 }
220 info := &grpc.UnaryServerInfo{
221 Server: srv,
222 FullMethod: GuestService_SyncTime_FullMethodName,
223 }
224 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
225 return srv.(GuestServiceServer).SyncTime(ctx, req.(*TimeSyncRequest))
226 }
227 return interceptor(ctx, in, info, handler)
228}
229
230// GuestService_ServiceDesc is the grpc.ServiceDesc for GuestService service.
231// It's only intended for direct use with grpc.RegisterService,
232// and not to be introspected or modified (even as a copy)
233var GuestService_ServiceDesc = grpc.ServiceDesc{
234 ServiceName: "GuestService",
235 HandlerType: (*GuestServiceServer)(nil),
236 Methods: []grpc.MethodDesc{
237 {
238 MethodName: "GetInfo",
239 Handler: _GuestService_GetInfo_Handler,
240 },
241 {
242 MethodName: "SyncTime",
243 Handler: _GuestService_SyncTime_Handler,
244 },
245 },
246 Streams: []grpc.StreamDesc{
247 {
248 StreamName: "GetEvents",
249 Handler: _GuestService_GetEvents_Handler,
250 ServerStreams: true,
251 },
252 {
253 StreamName: "PostInotify",
254 Handler: _GuestService_PostInotify_Handler,
255 ClientStreams: true,
256 },
257 {
258 StreamName: "Tunnel",
259 Handler: _GuestService_Tunnel_Handler,
260 ServerStreams: true,
261 ClientStreams: true,
262 },
263 },
264 Metadata: "guestservice.proto",
265}