From dd1da914ff25872c56fac3da5637bea6bc7e42d0 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 28 Sep 2024 16:18:49 +0200 Subject: [PATCH] Update deps (#40) * Update deps * Regenerate stubs --- go.mod | 16 +++---- go.sum | 24 +++++----- plugin/v1/plugin.pb.go | 8 ++-- plugin/v1/plugin_grpc.pb.go | 94 +++++++++++++++++++++++++------------ plugin/v1/struct.pb.go | 12 ++--- 5 files changed, 93 insertions(+), 61 deletions(-) diff --git a/go.mod b/go.mod index 2e2b270..b97f4dc 100644 --- a/go.mod +++ b/go.mod @@ -1,21 +1,19 @@ module github.com/gatewayd-io/gatewayd-plugin-sdk -go 1.21 - -toolchain go1.22.0 +go 1.23.1 require ( github.com/expr-lang/expr v1.16.9 github.com/hashicorp/go-hclog v1.6.3 github.com/hashicorp/go-plugin v1.6.1 - github.com/jackc/pgx/v5 v5.7.0 + github.com/jackc/pgx/v5 v5.7.1 github.com/pganalyze/pg_query_go/v5 v5.1.0 - github.com/prometheus/client_golang v1.20.3 + github.com/prometheus/client_golang v1.20.4 github.com/redis/go-redis/v9 v9.6.1 github.com/rs/zerolog v1.33.0 github.com/stretchr/testify v1.9.0 github.com/wasilibs/go-pgquery v0.0.0-20240826014338-9ea9e19d01fd - google.golang.org/grpc v1.66.0 + google.golang.org/grpc v1.67.0 google.golang.org/protobuf v1.34.2 ) @@ -26,8 +24,8 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.17.0 // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/hashicorp/yamux v0.1.1 // indirect - github.com/klauspost/compress v1.17.9 // indirect + github.com/hashicorp/yamux v0.1.2 // indirect + github.com/klauspost/compress v1.17.10 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -43,6 +41,6 @@ require ( golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/text v0.18.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 22f220a..fc30e1c 100644 --- a/go.sum +++ b/go.sum @@ -31,18 +31,18 @@ github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB1 github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI= github.com/hashicorp/go-plugin v1.6.1/go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0= -github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= -github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= +github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.7.0 h1:FG6VLIdzvAPhnYqP14sQ2xhFLkiUQHCs6ySqO91kF4g= -github.com/jackc/pgx/v5 v5.7.0/go.mod h1:awP1KNnjylvpxHuHP63gzjhnGkI1iw+PMoIwvoleN/8= +github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs= +github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= +github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -70,8 +70,8 @@ github.com/pganalyze/pg_query_go/v5 v5.1.0/go.mod h1:FsglvxidZsVN+Ltw3Ai6nTgPVcK github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= @@ -112,10 +112,10 @@ golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= -google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 h1:N9BgCIAUvn/M+p4NJccWPWb3BWh88+zyL0ll9HgbEeM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= +google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= 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),