diff --git a/plugin/v1/plugin.pb.go b/plugin/v1/plugin.pb.go index ca27ba4..fe321b9 100644 --- a/plugin/v1/plugin.pb.go +++ b/plugin/v1/plugin.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: plugin/v1/plugin.proto @@ -508,7 +508,7 @@ func file_plugin_v1_plugin_proto_rawDescGZIP() []byte { var file_plugin_v1_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_plugin_v1_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_plugin_v1_plugin_proto_goTypes = []interface{}{ +var file_plugin_v1_plugin_proto_goTypes = []any{ (HookName)(0), // 0: plugin.v1.HookName (*PluginID)(nil), // 1: plugin.v1.PluginID (*PluginConfig)(nil), // 2: plugin.v1.PluginConfig @@ -581,7 +581,7 @@ func file_plugin_v1_plugin_proto_init() { } file_plugin_v1_struct_proto_init() if !protoimpl.UnsafeEnabled { - file_plugin_v1_plugin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_plugin_v1_plugin_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*PluginID); i { case 0: return &v.state @@ -593,7 +593,7 @@ func file_plugin_v1_plugin_proto_init() { return nil } } - file_plugin_v1_plugin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_plugin_v1_plugin_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*PluginConfig); i { case 0: return &v.state diff --git a/plugin/v1/plugin_grpc.pb.go b/plugin/v1/plugin_grpc.pb.go index 8caca68..a3bdc9b 100644 --- a/plugin/v1/plugin_grpc.pb.go +++ b/plugin/v1/plugin_grpc.pb.go @@ -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 (unknown) // source: plugin/v1/plugin.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 ( GatewayDPluginService_GetPluginConfig_FullMethodName = "/plugin.v1.GatewayDPluginService/GetPluginConfig" @@ -105,8 +105,9 @@ func NewGatewayDPluginServiceClient(cc grpc.ClientConnInterface) GatewayDPluginS } func (c *gatewayDPluginServiceClient) GetPluginConfig(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_GetPluginConfig_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_GetPluginConfig_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -114,8 +115,9 @@ func (c *gatewayDPluginServiceClient) GetPluginConfig(ctx context.Context, in *S } func (c *gatewayDPluginServiceClient) OnConfigLoaded(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnConfigLoaded_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnConfigLoaded_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -123,8 +125,9 @@ func (c *gatewayDPluginServiceClient) OnConfigLoaded(ctx context.Context, in *St } func (c *gatewayDPluginServiceClient) OnNewLogger(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewLogger_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewLogger_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -132,8 +135,9 @@ func (c *gatewayDPluginServiceClient) OnNewLogger(ctx context.Context, in *Struc } func (c *gatewayDPluginServiceClient) OnNewPool(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewPool_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewPool_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -141,8 +145,9 @@ func (c *gatewayDPluginServiceClient) OnNewPool(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnNewClient(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewClient_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewClient_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -150,8 +155,9 @@ func (c *gatewayDPluginServiceClient) OnNewClient(ctx context.Context, in *Struc } func (c *gatewayDPluginServiceClient) OnNewProxy(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewProxy_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewProxy_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -159,8 +165,9 @@ func (c *gatewayDPluginServiceClient) OnNewProxy(ctx context.Context, in *Struct } func (c *gatewayDPluginServiceClient) OnNewServer(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewServer_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnNewServer_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -168,8 +175,9 @@ func (c *gatewayDPluginServiceClient) OnNewServer(ctx context.Context, in *Struc } func (c *gatewayDPluginServiceClient) OnSignal(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnSignal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnSignal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -177,8 +185,9 @@ func (c *gatewayDPluginServiceClient) OnSignal(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnRun(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnRun_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnRun_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -186,8 +195,9 @@ func (c *gatewayDPluginServiceClient) OnRun(ctx context.Context, in *Struct, opt } func (c *gatewayDPluginServiceClient) OnBooting(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnBooting_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnBooting_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -195,8 +205,9 @@ func (c *gatewayDPluginServiceClient) OnBooting(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnBooted(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnBooted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnBooted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -204,8 +215,9 @@ func (c *gatewayDPluginServiceClient) OnBooted(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnOpening(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnOpening_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnOpening_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -213,8 +225,9 @@ func (c *gatewayDPluginServiceClient) OnOpening(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnOpened(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnOpened_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnOpened_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -222,8 +235,9 @@ func (c *gatewayDPluginServiceClient) OnOpened(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnClosing(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnClosing_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnClosing_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -231,8 +245,9 @@ func (c *gatewayDPluginServiceClient) OnClosing(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnClosed(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnClosed_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnClosed_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -240,8 +255,9 @@ func (c *gatewayDPluginServiceClient) OnClosed(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnTraffic(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnTraffic_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnTraffic_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -249,8 +265,9 @@ func (c *gatewayDPluginServiceClient) OnTraffic(ctx context.Context, in *Struct, } func (c *gatewayDPluginServiceClient) OnTrafficFromClient(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnTrafficFromClient_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnTrafficFromClient_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -258,8 +275,9 @@ func (c *gatewayDPluginServiceClient) OnTrafficFromClient(ctx context.Context, i } func (c *gatewayDPluginServiceClient) OnTrafficToServer(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnTrafficToServer_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnTrafficToServer_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -267,8 +285,9 @@ func (c *gatewayDPluginServiceClient) OnTrafficToServer(ctx context.Context, in } func (c *gatewayDPluginServiceClient) OnTrafficFromServer(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnTrafficFromServer_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnTrafficFromServer_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -276,8 +295,9 @@ func (c *gatewayDPluginServiceClient) OnTrafficFromServer(ctx context.Context, i } func (c *gatewayDPluginServiceClient) OnTrafficToClient(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnTrafficToClient_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnTrafficToClient_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -285,8 +305,9 @@ func (c *gatewayDPluginServiceClient) OnTrafficToClient(ctx context.Context, in } func (c *gatewayDPluginServiceClient) OnShutdown(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnShutdown_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnShutdown_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -294,8 +315,9 @@ func (c *gatewayDPluginServiceClient) OnShutdown(ctx context.Context, in *Struct } func (c *gatewayDPluginServiceClient) OnTick(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnTick_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnTick_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -303,8 +325,9 @@ func (c *gatewayDPluginServiceClient) OnTick(ctx context.Context, in *Struct, op } func (c *gatewayDPluginServiceClient) OnHook(ctx context.Context, in *Struct, opts ...grpc.CallOption) (*Struct, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Struct) - err := c.cc.Invoke(ctx, GatewayDPluginService_OnHook_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GatewayDPluginService_OnHook_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -313,7 +336,7 @@ func (c *gatewayDPluginServiceClient) OnHook(ctx context.Context, in *Struct, op // GatewayDPluginServiceServer is the server API for GatewayDPluginService service. // All implementations must embed UnimplementedGatewayDPluginServiceServer -// for forward compatibility +// for forward compatibility. type GatewayDPluginServiceServer interface { // GetPluginConfig returns the plugin config upon registration GetPluginConfig(context.Context, *Struct) (*Struct, error) @@ -364,9 +387,12 @@ type GatewayDPluginServiceServer interface { mustEmbedUnimplementedGatewayDPluginServiceServer() } -// UnimplementedGatewayDPluginServiceServer must be embedded to have forward compatible implementations. -type UnimplementedGatewayDPluginServiceServer struct { -} +// UnimplementedGatewayDPluginServiceServer 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 UnimplementedGatewayDPluginServiceServer struct{} func (UnimplementedGatewayDPluginServiceServer) GetPluginConfig(context.Context, *Struct) (*Struct, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPluginConfig not implemented") @@ -438,6 +464,7 @@ func (UnimplementedGatewayDPluginServiceServer) OnHook(context.Context, *Struct) return nil, status.Errorf(codes.Unimplemented, "method OnHook not implemented") } func (UnimplementedGatewayDPluginServiceServer) mustEmbedUnimplementedGatewayDPluginServiceServer() {} +func (UnimplementedGatewayDPluginServiceServer) testEmbeddedByValue() {} // UnsafeGatewayDPluginServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to GatewayDPluginServiceServer will @@ -447,6 +474,13 @@ type UnsafeGatewayDPluginServiceServer interface { } func RegisterGatewayDPluginServiceServer(s grpc.ServiceRegistrar, srv GatewayDPluginServiceServer) { + // If the following call pancis, it indicates UnimplementedGatewayDPluginServiceServer 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(&GatewayDPluginService_ServiceDesc, srv) } diff --git a/plugin/v1/struct.pb.go b/plugin/v1/struct.pb.go index 4b8d971..d629ed5 100644 --- a/plugin/v1/struct.pb.go +++ b/plugin/v1/struct.pb.go @@ -35,7 +35,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: plugin/v1/struct.proto @@ -442,7 +442,7 @@ func file_plugin_v1_struct_proto_rawDescGZIP() []byte { var file_plugin_v1_struct_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_plugin_v1_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_plugin_v1_struct_proto_goTypes = []interface{}{ +var file_plugin_v1_struct_proto_goTypes = []any{ (NullValue)(0), // 0: plugin.v1.NullValue (*Struct)(nil), // 1: plugin.v1.Struct (*Value)(nil), // 2: plugin.v1.Value @@ -469,7 +469,7 @@ func file_plugin_v1_struct_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_plugin_v1_struct_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_plugin_v1_struct_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Struct); i { case 0: return &v.state @@ -481,7 +481,7 @@ func file_plugin_v1_struct_proto_init() { return nil } } - file_plugin_v1_struct_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_plugin_v1_struct_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Value); i { case 0: return &v.state @@ -493,7 +493,7 @@ func file_plugin_v1_struct_proto_init() { return nil } } - file_plugin_v1_struct_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_plugin_v1_struct_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*ListValue); i { case 0: return &v.state @@ -506,7 +506,7 @@ func file_plugin_v1_struct_proto_init() { } } } - file_plugin_v1_struct_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_plugin_v1_struct_proto_msgTypes[1].OneofWrappers = []any{ (*Value_NullValue)(nil), (*Value_NumberValue)(nil), (*Value_StringValue)(nil),