Pin protobuf packages (#3715)

* Pin protobuf packages

It happened in the past that I ran with the wrong protobuf version
installed locally, and apparently there is even still some file wrong in
splithttp. Fix this issue once and for all.

* bump protobuf packages

* Revert "bump protobuf packages"

This reverts commit 7a3509346a.

* Revert "Revert "bump protobuf packages""

This reverts commit bb79707d15.

* fix deprecated grpc usage
This commit is contained in:
mmmray 2024-08-22 16:18:36 +02:00 committed by GitHub
parent 790f908f0b
commit 2be03c56cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 544 additions and 559 deletions

View file

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.1
// protoc-gen-go v1.34.2
// protoc v5.27.0
// source: app/router/command/command.proto
@ -1019,7 +1019,7 @@ func file_app_router_command_command_proto_rawDescGZIP() []byte {
}
var file_app_router_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
var file_app_router_command_command_proto_goTypes = []interface{}{
var file_app_router_command_command_proto_goTypes = []any{
(*RoutingContext)(nil), // 0: xray.app.router.command.RoutingContext
(*SubscribeRoutingStatsRequest)(nil), // 1: xray.app.router.command.SubscribeRoutingStatsRequest
(*TestRouteRequest)(nil), // 2: xray.app.router.command.TestRouteRequest
@ -1072,7 +1072,7 @@ func file_app_router_command_command_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_app_router_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*RoutingContext); i {
case 0:
return &v.state
@ -1084,7 +1084,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*SubscribeRoutingStatsRequest); i {
case 0:
return &v.state
@ -1096,7 +1096,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*TestRouteRequest); i {
case 0:
return &v.state
@ -1108,7 +1108,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*PrincipleTargetInfo); i {
case 0:
return &v.state
@ -1120,7 +1120,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*OverrideInfo); i {
case 0:
return &v.state
@ -1132,7 +1132,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*BalancerMsg); i {
case 0:
return &v.state
@ -1144,7 +1144,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*GetBalancerInfoRequest); i {
case 0:
return &v.state
@ -1156,7 +1156,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*GetBalancerInfoResponse); i {
case 0:
return &v.state
@ -1168,7 +1168,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*OverrideBalancerTargetRequest); i {
case 0:
return &v.state
@ -1180,7 +1180,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*OverrideBalancerTargetResponse); i {
case 0:
return &v.state
@ -1192,7 +1192,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*AddRuleRequest); i {
case 0:
return &v.state
@ -1204,7 +1204,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*AddRuleResponse); i {
case 0:
return &v.state
@ -1216,7 +1216,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*RemoveRuleRequest); i {
case 0:
return &v.state
@ -1228,7 +1228,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[13].Exporter = func(v any, i int) any {
switch v := v.(*RemoveRuleResponse); i {
case 0:
return &v.state
@ -1240,7 +1240,7 @@ func file_app_router_command_command_proto_init() {
return nil
}
}
file_app_router_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
file_app_router_command_command_proto_msgTypes[14].Exporter = func(v any, i int) any {
switch v := v.(*Config); i {
case 0:
return &v.state

View file

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.27.0
// source: app/router/command/command.proto
@ -15,8 +15,8 @@ import (
// 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
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
RoutingService_SubscribeRoutingStats_FullMethodName = "/xray.app.router.command.RoutingService/SubscribeRoutingStats"
@ -31,7 +31,7 @@ const (
//
// 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 RoutingServiceClient interface {
SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error)
SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RoutingContext], error)
TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error)
GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error)
OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error)
@ -47,12 +47,13 @@ func NewRoutingServiceClient(cc grpc.ClientConnInterface) RoutingServiceClient {
return &routingServiceClient{cc}
}
func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error) {
stream, err := c.cc.NewStream(ctx, &RoutingService_ServiceDesc.Streams[0], RoutingService_SubscribeRoutingStats_FullMethodName, opts...)
func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RoutingContext], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &RoutingService_ServiceDesc.Streams[0], RoutingService_SubscribeRoutingStats_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &routingServiceSubscribeRoutingStatsClient{stream}
x := &grpc.GenericClientStream[SubscribeRoutingStatsRequest, RoutingContext]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
@ -62,26 +63,13 @@ func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *Su
return x, nil
}
type RoutingService_SubscribeRoutingStatsClient interface {
Recv() (*RoutingContext, error)
grpc.ClientStream
}
type routingServiceSubscribeRoutingStatsClient struct {
grpc.ClientStream
}
func (x *routingServiceSubscribeRoutingStatsClient) Recv() (*RoutingContext, error) {
m := new(RoutingContext)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type RoutingService_SubscribeRoutingStatsClient = grpc.ServerStreamingClient[RoutingContext]
func (c *routingServiceClient) TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RoutingContext)
err := c.cc.Invoke(ctx, RoutingService_TestRoute_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, RoutingService_TestRoute_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -89,8 +77,9 @@ func (c *routingServiceClient) TestRoute(ctx context.Context, in *TestRouteReque
}
func (c *routingServiceClient) GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetBalancerInfoResponse)
err := c.cc.Invoke(ctx, RoutingService_GetBalancerInfo_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, RoutingService_GetBalancerInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -98,8 +87,9 @@ func (c *routingServiceClient) GetBalancerInfo(ctx context.Context, in *GetBalan
}
func (c *routingServiceClient) OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OverrideBalancerTargetResponse)
err := c.cc.Invoke(ctx, RoutingService_OverrideBalancerTarget_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, RoutingService_OverrideBalancerTarget_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -107,8 +97,9 @@ func (c *routingServiceClient) OverrideBalancerTarget(ctx context.Context, in *O
}
func (c *routingServiceClient) AddRule(ctx context.Context, in *AddRuleRequest, opts ...grpc.CallOption) (*AddRuleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AddRuleResponse)
err := c.cc.Invoke(ctx, RoutingService_AddRule_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, RoutingService_AddRule_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -116,8 +107,9 @@ func (c *routingServiceClient) AddRule(ctx context.Context, in *AddRuleRequest,
}
func (c *routingServiceClient) RemoveRule(ctx context.Context, in *RemoveRuleRequest, opts ...grpc.CallOption) (*RemoveRuleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RemoveRuleResponse)
err := c.cc.Invoke(ctx, RoutingService_RemoveRule_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, RoutingService_RemoveRule_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -126,9 +118,9 @@ func (c *routingServiceClient) RemoveRule(ctx context.Context, in *RemoveRuleReq
// RoutingServiceServer is the server API for RoutingService service.
// All implementations must embed UnimplementedRoutingServiceServer
// for forward compatibility
// for forward compatibility.
type RoutingServiceServer interface {
SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error
SubscribeRoutingStats(*SubscribeRoutingStatsRequest, grpc.ServerStreamingServer[RoutingContext]) error
TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error)
GetBalancerInfo(context.Context, *GetBalancerInfoRequest) (*GetBalancerInfoResponse, error)
OverrideBalancerTarget(context.Context, *OverrideBalancerTargetRequest) (*OverrideBalancerTargetResponse, error)
@ -137,11 +129,14 @@ type RoutingServiceServer interface {
mustEmbedUnimplementedRoutingServiceServer()
}
// UnimplementedRoutingServiceServer must be embedded to have forward compatible implementations.
type UnimplementedRoutingServiceServer struct {
}
// UnimplementedRoutingServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedRoutingServiceServer struct{}
func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error {
func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, grpc.ServerStreamingServer[RoutingContext]) error {
return status.Errorf(codes.Unimplemented, "method SubscribeRoutingStats not implemented")
}
func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error) {
@ -160,6 +155,7 @@ func (UnimplementedRoutingServiceServer) RemoveRule(context.Context, *RemoveRule
return nil, status.Errorf(codes.Unimplemented, "method RemoveRule not implemented")
}
func (UnimplementedRoutingServiceServer) mustEmbedUnimplementedRoutingServiceServer() {}
func (UnimplementedRoutingServiceServer) testEmbeddedByValue() {}
// UnsafeRoutingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RoutingServiceServer will
@ -169,6 +165,13 @@ type UnsafeRoutingServiceServer interface {
}
func RegisterRoutingServiceServer(s grpc.ServiceRegistrar, srv RoutingServiceServer) {
// If the following call pancis, it indicates UnimplementedRoutingServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&RoutingService_ServiceDesc, srv)
}
@ -177,21 +180,11 @@ func _RoutingService_SubscribeRoutingStats_Handler(srv interface{}, stream grpc.
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(RoutingServiceServer).SubscribeRoutingStats(m, &routingServiceSubscribeRoutingStatsServer{stream})
return srv.(RoutingServiceServer).SubscribeRoutingStats(m, &grpc.GenericServerStream[SubscribeRoutingStatsRequest, RoutingContext]{ServerStream: stream})
}
type RoutingService_SubscribeRoutingStatsServer interface {
Send(*RoutingContext) error
grpc.ServerStream
}
type routingServiceSubscribeRoutingStatsServer struct {
grpc.ServerStream
}
func (x *routingServiceSubscribeRoutingStatsServer) Send(m *RoutingContext) error {
return x.ServerStream.SendMsg(m)
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type RoutingService_SubscribeRoutingStatsServer = grpc.ServerStreamingServer[RoutingContext]
func _RoutingService_TestRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TestRouteRequest)

View file

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.1
// protoc-gen-go v1.34.2
// protoc v5.27.0
// source: app/router/config.proto
@ -1275,7 +1275,7 @@ func file_app_router_config_proto_rawDescGZIP() []byte {
var file_app_router_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_app_router_config_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_app_router_config_proto_goTypes = []interface{}{
var file_app_router_config_proto_goTypes = []any{
(Domain_Type)(0), // 0: xray.app.router.Domain.Type
(Config_DomainStrategy)(0), // 1: xray.app.router.Config.DomainStrategy
(*Domain)(nil), // 2: xray.app.router.Domain
@ -1333,7 +1333,7 @@ func file_app_router_config_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_app_router_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Domain); i {
case 0:
return &v.state
@ -1345,7 +1345,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*CIDR); i {
case 0:
return &v.state
@ -1357,7 +1357,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*GeoIP); i {
case 0:
return &v.state
@ -1369,7 +1369,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*GeoIPList); i {
case 0:
return &v.state
@ -1381,7 +1381,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*GeoSite); i {
case 0:
return &v.state
@ -1393,7 +1393,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*GeoSiteList); i {
case 0:
return &v.state
@ -1405,7 +1405,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*RoutingRule); i {
case 0:
return &v.state
@ -1417,7 +1417,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*BalancingRule); i {
case 0:
return &v.state
@ -1429,7 +1429,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*StrategyWeight); i {
case 0:
return &v.state
@ -1441,7 +1441,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*StrategyLeastLoadConfig); i {
case 0:
return &v.state
@ -1453,7 +1453,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*Config); i {
case 0:
return &v.state
@ -1465,7 +1465,7 @@ func file_app_router_config_proto_init() {
return nil
}
}
file_app_router_config_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_app_router_config_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*Domain_Attribute); i {
case 0:
return &v.state
@ -1478,11 +1478,11 @@ func file_app_router_config_proto_init() {
}
}
}
file_app_router_config_proto_msgTypes[6].OneofWrappers = []interface{}{
file_app_router_config_proto_msgTypes[6].OneofWrappers = []any{
(*RoutingRule_Tag)(nil),
(*RoutingRule_BalancingTag)(nil),
}
file_app_router_config_proto_msgTypes[11].OneofWrappers = []interface{}{
file_app_router_config_proto_msgTypes[11].OneofWrappers = []any{
(*Domain_Attribute_BoolValue)(nil),
(*Domain_Attribute_IntValue)(nil),
}