| // Copyright 2020 The LUCI Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| // versions: |
| // - protoc-gen-go-grpc v1.3.0 |
| // - protoc v3.21.7 |
| // source: go.chromium.org/luci/cipd/client/cipd/plugin/protocol/plugin.proto |
| |
| package protocol |
| |
| import ( |
| context "context" |
| grpc "google.golang.org/grpc" |
| codes "google.golang.org/grpc/codes" |
| status "google.golang.org/grpc/status" |
| emptypb "google.golang.org/protobuf/types/known/emptypb" |
| ) |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the grpc package it is being compiled against. |
| // Requires gRPC-Go v1.32.0 or later. |
| const _ = grpc.SupportPackageIsVersion7 |
| |
| const ( |
| Host_Log_FullMethodName = "/cipd.plugin.Host/Log" |
| Host_ListMetadata_FullMethodName = "/cipd.plugin.Host/ListMetadata" |
| ) |
| |
| // HostClient is the client API for Host service. |
| // |
| // 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. |
| type HostClient interface { |
| // Log adds a logging message to the CIPD client logging output. |
| Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) |
| // Lists metadata entries attached to a package instance. |
| // |
| // Either returns all metadata or only entries with requested keys. The list |
| // is sorted by the registration time of metadata entries (the most recent |
| // first). |
| // |
| // Returns one page of the results. Use `next_page_token` to fetch the next |
| // page. The last page has `next_page_token` empty. |
| ListMetadata(ctx context.Context, in *ListMetadataRequest, opts ...grpc.CallOption) (*ListMetadataResponse, error) |
| } |
| |
| type hostClient struct { |
| cc grpc.ClientConnInterface |
| } |
| |
| func NewHostClient(cc grpc.ClientConnInterface) HostClient { |
| return &hostClient{cc} |
| } |
| |
| func (c *hostClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { |
| out := new(emptypb.Empty) |
| err := c.cc.Invoke(ctx, Host_Log_FullMethodName, in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *hostClient) ListMetadata(ctx context.Context, in *ListMetadataRequest, opts ...grpc.CallOption) (*ListMetadataResponse, error) { |
| out := new(ListMetadataResponse) |
| err := c.cc.Invoke(ctx, Host_ListMetadata_FullMethodName, in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| // HostServer is the server API for Host service. |
| // All implementations must embed UnimplementedHostServer |
| // for forward compatibility |
| type HostServer interface { |
| // Log adds a logging message to the CIPD client logging output. |
| Log(context.Context, *LogRequest) (*emptypb.Empty, error) |
| // Lists metadata entries attached to a package instance. |
| // |
| // Either returns all metadata or only entries with requested keys. The list |
| // is sorted by the registration time of metadata entries (the most recent |
| // first). |
| // |
| // Returns one page of the results. Use `next_page_token` to fetch the next |
| // page. The last page has `next_page_token` empty. |
| ListMetadata(context.Context, *ListMetadataRequest) (*ListMetadataResponse, error) |
| mustEmbedUnimplementedHostServer() |
| } |
| |
| // UnimplementedHostServer must be embedded to have forward compatible implementations. |
| type UnimplementedHostServer struct { |
| } |
| |
| func (UnimplementedHostServer) Log(context.Context, *LogRequest) (*emptypb.Empty, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method Log not implemented") |
| } |
| func (UnimplementedHostServer) ListMetadata(context.Context, *ListMetadataRequest) (*ListMetadataResponse, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method ListMetadata not implemented") |
| } |
| func (UnimplementedHostServer) mustEmbedUnimplementedHostServer() {} |
| |
| // UnsafeHostServer may be embedded to opt out of forward compatibility for this service. |
| // Use of this interface is not recommended, as added methods to HostServer will |
| // result in compilation errors. |
| type UnsafeHostServer interface { |
| mustEmbedUnimplementedHostServer() |
| } |
| |
| func RegisterHostServer(s grpc.ServiceRegistrar, srv HostServer) { |
| s.RegisterService(&Host_ServiceDesc, srv) |
| } |
| |
| func _Host_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(LogRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(HostServer).Log(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: Host_Log_FullMethodName, |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(HostServer).Log(ctx, req.(*LogRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _Host_ListMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(ListMetadataRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(HostServer).ListMetadata(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: Host_ListMetadata_FullMethodName, |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(HostServer).ListMetadata(ctx, req.(*ListMetadataRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| // Host_ServiceDesc is the grpc.ServiceDesc for Host service. |
| // It's only intended for direct use with grpc.RegisterService, |
| // and not to be introspected or modified (even as a copy) |
| var Host_ServiceDesc = grpc.ServiceDesc{ |
| ServiceName: "cipd.plugin.Host", |
| HandlerType: (*HostServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "Log", |
| Handler: _Host_Log_Handler, |
| }, |
| { |
| MethodName: "ListMetadata", |
| Handler: _Host_ListMetadata_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{}, |
| Metadata: "go.chromium.org/luci/cipd/client/cipd/plugin/protocol/plugin.proto", |
| } |