disable unimplemented forward compatibility check

This commit is contained in:
Caleb Doxsey 2024-08-15 09:27:40 -06:00
parent 313823245a
commit 80132c5275
7 changed files with 13 additions and 27 deletions

View file

@ -16,9 +16,6 @@ import (
// A dataBrokerServer implements the data broker service interface.
type dataBrokerServer struct {
databrokerpb.UnimplementedDataBrokerServiceServer
registrypb.UnimplementedRegistryServer
server *databroker.Server
sharedKey *atomicutil.Value[[]byte]
}

View file

@ -26,8 +26,6 @@ import (
// Server implements the databroker service using an in memory database.
type Server struct {
databroker.UnimplementedDataBrokerServiceServer
cfg *serverConfig
mu sync.RWMutex

View file

@ -17,8 +17,6 @@ import (
)
type inMemoryServer struct {
pb.UnimplementedRegistryServer
ttl time.Duration
// onchange is used to broadcast changes to listeners
onchange *signal.Signal

View file

@ -96,7 +96,7 @@ func (c *configClient) Import(ctx context.Context, in *ImportRequest, opts ...gr
}
// ConfigServer is the server API for Config service.
// All implementations must embed UnimplementedConfigServer
// All implementations should embed UnimplementedConfigServer
// for forward compatibility.
type ConfigServer interface {
List(context.Context, *Selector) (*ListRecordsResponse, error)
@ -104,10 +104,9 @@ type ConfigServer interface {
Upsert(context.Context, *Record) (*Record, error)
Export(context.Context, *ExportRequest) (*ConfigData, error)
Import(context.Context, *ImportRequest) (*ImportResponse, error)
mustEmbedUnimplementedConfigServer()
}
// UnimplementedConfigServer must be embedded to have
// UnimplementedConfigServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
@ -129,8 +128,7 @@ func (UnimplementedConfigServer) Export(context.Context, *ExportRequest) (*Confi
func (UnimplementedConfigServer) Import(context.Context, *ImportRequest) (*ImportResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Import not implemented")
}
func (UnimplementedConfigServer) mustEmbedUnimplementedConfigServer() {}
func (UnimplementedConfigServer) testEmbeddedByValue() {}
func (UnimplementedConfigServer) testEmbeddedByValue() {}
// UnsafeConfigServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ConfigServer will
@ -329,7 +327,7 @@ func (c *listenerClient) StatusUpdates(ctx context.Context, in *Selector, opts .
type Listener_StatusUpdatesClient = grpc.ServerStreamingClient[ConnectionStatusUpdates]
// ListenerServer is the server API for Listener service.
// All implementations must embed UnimplementedListenerServer
// All implementations should embed UnimplementedListenerServer
// for forward compatibility.
//
// Listener service controls listeners
@ -340,10 +338,9 @@ type ListenerServer interface {
// a client has to subscribe and continuously
// listen to the broadcasted updates
StatusUpdates(*Selector, grpc.ServerStreamingServer[ConnectionStatusUpdates]) error
mustEmbedUnimplementedListenerServer()
}
// UnimplementedListenerServer must be embedded to have
// UnimplementedListenerServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
@ -356,8 +353,7 @@ func (UnimplementedListenerServer) Update(context.Context, *ListenerUpdateReques
func (UnimplementedListenerServer) StatusUpdates(*Selector, grpc.ServerStreamingServer[ConnectionStatusUpdates]) error {
return status.Errorf(codes.Unimplemented, "method StatusUpdates not implemented")
}
func (UnimplementedListenerServer) mustEmbedUnimplementedListenerServer() {}
func (UnimplementedListenerServer) testEmbeddedByValue() {}
func (UnimplementedListenerServer) testEmbeddedByValue() {}
// UnsafeListenerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ListenerServer will

View file

@ -200,7 +200,7 @@ func (c *dataBrokerServiceClient) SyncLatest(ctx context.Context, in *SyncLatest
type DataBrokerService_SyncLatestClient = grpc.ServerStreamingClient[SyncLatestResponse]
// DataBrokerServiceServer is the server API for DataBrokerService service.
// All implementations must embed UnimplementedDataBrokerServiceServer
// All implementations should embed UnimplementedDataBrokerServiceServer
// for forward compatibility.
//
// The DataBrokerService stores key-value data.
@ -227,10 +227,9 @@ type DataBrokerServiceServer interface {
Sync(*SyncRequest, grpc.ServerStreamingServer[SyncResponse]) error
// SyncLatest streams the latest version of every record.
SyncLatest(*SyncLatestRequest, grpc.ServerStreamingServer[SyncLatestResponse]) error
mustEmbedUnimplementedDataBrokerServiceServer()
}
// UnimplementedDataBrokerServiceServer must be embedded to have
// UnimplementedDataBrokerServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
@ -270,8 +269,7 @@ func (UnimplementedDataBrokerServiceServer) Sync(*SyncRequest, grpc.ServerStream
func (UnimplementedDataBrokerServiceServer) SyncLatest(*SyncLatestRequest, grpc.ServerStreamingServer[SyncLatestResponse]) error {
return status.Errorf(codes.Unimplemented, "method SyncLatest not implemented")
}
func (UnimplementedDataBrokerServiceServer) mustEmbedUnimplementedDataBrokerServiceServer() {}
func (UnimplementedDataBrokerServiceServer) testEmbeddedByValue() {}
func (UnimplementedDataBrokerServiceServer) testEmbeddedByValue() {}
// UnsafeDataBrokerServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DataBrokerServiceServer will

View file

@ -92,6 +92,7 @@ for _d in "${_sub_directories[@]}"; do
--go_opt="paths=source_relative" \
--go-grpc_out="./$_d" \
--go-grpc_opt="paths=source_relative" \
--go-grpc_opt="require_unimplemented_servers=false" \
"${_imports[@]}" \
"./$_d/"*.proto
done

View file

@ -89,7 +89,7 @@ func (c *registryClient) Watch(ctx context.Context, in *ListRequest, opts ...grp
type Registry_WatchClient = grpc.ServerStreamingClient[ServiceList]
// RegistryServer is the server API for Registry service.
// All implementations must embed UnimplementedRegistryServer
// All implementations should embed UnimplementedRegistryServer
// for forward compatibility.
//
// Registry is invoked by services to inform
@ -103,10 +103,9 @@ type RegistryServer interface {
// for the simplicity of consumer its delivered as full snapshots
// and is only sent when change is detected
Watch(*ListRequest, grpc.ServerStreamingServer[ServiceList]) error
mustEmbedUnimplementedRegistryServer()
}
// UnimplementedRegistryServer must be embedded to have
// UnimplementedRegistryServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
@ -122,8 +121,7 @@ func (UnimplementedRegistryServer) List(context.Context, *ListRequest) (*Service
func (UnimplementedRegistryServer) Watch(*ListRequest, grpc.ServerStreamingServer[ServiceList]) error {
return status.Errorf(codes.Unimplemented, "method Watch not implemented")
}
func (UnimplementedRegistryServer) mustEmbedUnimplementedRegistryServer() {}
func (UnimplementedRegistryServer) testEmbeddedByValue() {}
func (UnimplementedRegistryServer) testEmbeddedByValue() {}
// UnsafeRegistryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RegistryServer will