core/proto: update protoc dependencies (#5218)

* core/proto: update protoc dependencies

* cleanup

* disable unimplemented forward compatibility check

* fix mock

* add generate make command

* add .0
This commit is contained in:
Caleb Doxsey 2024-08-15 11:12:05 -06:00 committed by GitHub
parent 3483447c37
commit 0cfb1025db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 1427 additions and 1832 deletions

View file

@ -1,17 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.34.2
// protoc v3.21.7
// source: registry.proto
package registry
import (
context "context"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
@ -513,7 +509,7 @@ func file_registry_proto_rawDescGZIP() []byte {
var file_registry_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_registry_proto_goTypes = []interface{}{
var file_registry_proto_goTypes = []any{
(ServiceKind)(0), // 0: registry.ServiceKind
(*Service)(nil), // 1: registry.Service
(*RegisterRequest)(nil), // 2: registry.RegisterRequest
@ -555,7 +551,7 @@ func file_registry_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_registry_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Service); i {
case 0:
return &v.state
@ -567,7 +563,7 @@ func file_registry_proto_init() {
return nil
}
}
file_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_registry_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*RegisterRequest); i {
case 0:
return &v.state
@ -579,7 +575,7 @@ func file_registry_proto_init() {
return nil
}
}
file_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_registry_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*RegisterResponse); i {
case 0:
return &v.state
@ -591,7 +587,7 @@ func file_registry_proto_init() {
return nil
}
}
file_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_registry_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ListRequest); i {
case 0:
return &v.state
@ -603,7 +599,7 @@ func file_registry_proto_init() {
return nil
}
}
file_registry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_registry_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*ServiceRegistration); i {
case 0:
return &v.state
@ -615,7 +611,7 @@ func file_registry_proto_init() {
return nil
}
}
file_registry_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_registry_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*ServiceList); i {
case 0:
return &v.state
@ -648,195 +644,3 @@ func file_registry_proto_init() {
file_registry_proto_goTypes = nil
file_registry_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// RegistryClient is the client API for Registry service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type RegistryClient interface {
// Report is periodically sent by each service to confirm it is still serving
// with the registry data is persisted with a certain TTL
Report(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
// List returns current snapshot of the services known to the registry
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ServiceList, error)
// Watch returns a stream of updates
// for the simplicity of consumer its delivered as full snapshots
// and is only sent when change is detected
Watch(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (Registry_WatchClient, error)
}
type registryClient struct {
cc grpc.ClientConnInterface
}
func NewRegistryClient(cc grpc.ClientConnInterface) RegistryClient {
return &registryClient{cc}
}
func (c *registryClient) Report(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
out := new(RegisterResponse)
err := c.cc.Invoke(ctx, "/registry.Registry/Report", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *registryClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ServiceList, error) {
out := new(ServiceList)
err := c.cc.Invoke(ctx, "/registry.Registry/List", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *registryClient) Watch(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (Registry_WatchClient, error) {
stream, err := c.cc.NewStream(ctx, &_Registry_serviceDesc.Streams[0], "/registry.Registry/Watch", opts...)
if err != nil {
return nil, err
}
x := &registryWatchClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Registry_WatchClient interface {
Recv() (*ServiceList, error)
grpc.ClientStream
}
type registryWatchClient struct {
grpc.ClientStream
}
func (x *registryWatchClient) Recv() (*ServiceList, error) {
m := new(ServiceList)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// RegistryServer is the server API for Registry service.
type RegistryServer interface {
// Report is periodically sent by each service to confirm it is still serving
// with the registry data is persisted with a certain TTL
Report(context.Context, *RegisterRequest) (*RegisterResponse, error)
// List returns current snapshot of the services known to the registry
List(context.Context, *ListRequest) (*ServiceList, error)
// Watch returns a stream of updates
// for the simplicity of consumer its delivered as full snapshots
// and is only sent when change is detected
Watch(*ListRequest, Registry_WatchServer) error
}
// UnimplementedRegistryServer can be embedded to have forward compatible implementations.
type UnimplementedRegistryServer struct {
}
func (*UnimplementedRegistryServer) Report(context.Context, *RegisterRequest) (*RegisterResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Report not implemented")
}
func (*UnimplementedRegistryServer) List(context.Context, *ListRequest) (*ServiceList, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (*UnimplementedRegistryServer) Watch(*ListRequest, Registry_WatchServer) error {
return status.Errorf(codes.Unimplemented, "method Watch not implemented")
}
func RegisterRegistryServer(s *grpc.Server, srv RegistryServer) {
s.RegisterService(&_Registry_serviceDesc, srv)
}
func _Registry_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RegistryServer).Report(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/registry.Registry/Report",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RegistryServer).Report(ctx, req.(*RegisterRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Registry_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RegistryServer).List(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/registry.Registry/List",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RegistryServer).List(ctx, req.(*ListRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Registry_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ListRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(RegistryServer).Watch(m, &registryWatchServer{stream})
}
type Registry_WatchServer interface {
Send(*ServiceList) error
grpc.ServerStream
}
type registryWatchServer struct {
grpc.ServerStream
}
func (x *registryWatchServer) Send(m *ServiceList) error {
return x.ServerStream.SendMsg(m)
}
var _Registry_serviceDesc = grpc.ServiceDesc{
ServiceName: "registry.Registry",
HandlerType: (*RegistryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Report",
Handler: _Registry_Report_Handler,
},
{
MethodName: "List",
Handler: _Registry_List_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Watch",
Handler: _Registry_Watch_Handler,
ServerStreams: true,
},
},
Metadata: "registry.proto",
}