Embed "Unimplemented" structs as proto recommended

Embedding these structs will be mandatory after migratring off from
gogo/protobuf (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
Kazuyoshi Kato 2022-04-20 05:42:01 +00:00
parent eb66262121
commit 95dde4959d
14 changed files with 14 additions and 0 deletions

View File

@ -32,6 +32,7 @@ var empty = &ptypes.Empty{}
type service struct { type service struct {
sn snapshots.Snapshotter sn snapshots.Snapshotter
snapshotsapi.UnimplementedSnapshotsServer
} }
// FromSnapshotter returns a Snapshot API server from a containerd snapshotter // FromSnapshotter returns a Snapshot API server from a containerd snapshotter

View File

@ -55,6 +55,7 @@ func init() {
type service struct { type service struct {
local api.ContainersClient local api.ContainersClient
api.UnimplementedContainersServer
} }
var _ api.ContainersServer = &service{} var _ api.ContainersServer = &service{}

View File

@ -38,6 +38,7 @@ import (
type service struct { type service struct {
store content.Store store content.Store
api.UnimplementedContentServer
} }
var bufPool = sync.Pool{ var bufPool = sync.Pool{

View File

@ -53,6 +53,7 @@ func init() {
type service struct { type service struct {
local diffapi.DiffClient local diffapi.DiffClient
diffapi.UnimplementedDiffServer
} }
var _ diffapi.DiffServer = &service{} var _ diffapi.DiffServer = &service{}

View File

@ -52,6 +52,7 @@ func init() {
type service struct { type service struct {
ttService *ttrpcService ttService *ttrpcService
events *exchange.Exchange events *exchange.Exchange
api.UnimplementedEventsServer
} }
// NewService returns the GRPC events server // NewService returns the GRPC events server

View File

@ -54,6 +54,7 @@ func init() {
type service struct { type service struct {
local imagesapi.ImagesClient local imagesapi.ImagesClient
imagesapi.UnimplementedImagesServer
} }
var _ imagesapi.ImagesServer = &service{} var _ imagesapi.ImagesServer = &service{}

View File

@ -62,6 +62,7 @@ func init() {
type server struct { type server struct {
local api.IntrospectionClient local api.IntrospectionClient
api.UnimplementedIntrospectionServer
} }
var _ = (api.IntrospectionServer)(&server{}) var _ = (api.IntrospectionServer)(&server{})

View File

@ -47,6 +47,7 @@ func init() {
type service struct { type service struct {
lm leases.Manager lm leases.Manager
api.UnimplementedLeasesServer
} }
func (s *service) Register(server *grpc.Server) error { func (s *service) Register(server *grpc.Server) error {

View File

@ -54,6 +54,7 @@ func init() {
type service struct { type service struct {
local api.NamespacesClient local api.NamespacesClient
api.UnimplementedNamespacesServer
} }
var _ api.NamespacesServer = &service{} var _ api.NamespacesServer = &service{}

View File

@ -59,6 +59,7 @@ func init() {
type controllerService struct { type controllerService struct {
local api.ControllerClient local api.ControllerClient
api.UnimplementedControllerServer
} }
var _ api.ControllerServer = (*controllerService)(nil) var _ api.ControllerServer = (*controllerService)(nil)

View File

@ -55,6 +55,7 @@ func init() {
type sandboxService struct { type sandboxService struct {
local api.StoreClient local api.StoreClient
api.UnimplementedStoreServer
} }
var _ api.StoreServer = (*sandboxService)(nil) var _ api.StoreServer = (*sandboxService)(nil)

View File

@ -48,6 +48,7 @@ var empty = &ptypes.Empty{}
type service struct { type service struct {
ss map[string]snapshots.Snapshotter ss map[string]snapshots.Snapshotter
snapshotsapi.UnimplementedSnapshotsServer
} }
func newService(ic *plugin.InitContext) (interface{}, error) { func newService(ic *plugin.InitContext) (interface{}, error) {

View File

@ -58,6 +58,7 @@ func init() {
type service struct { type service struct {
local api.TasksClient local api.TasksClient
api.UnimplementedTasksServer
} }
func (s *service) Register(server *grpc.Server) error { func (s *service) Register(server *grpc.Server) error {

View File

@ -41,6 +41,7 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
} }
type service struct { type service struct {
api.UnimplementedVersionServer
} }
func (s *service) Register(server *grpc.Server) error { func (s *service) Register(server *grpc.Server) error {