Skip to content

Commit

Permalink
Embed "Unimplemented" structs as proto recommended
Browse files Browse the repository at this point in the history
Embedding these structs will be mandatory after migratring off from
gogo/protobuf (see containerd#6564).

Signed-off-by: Kazuyoshi Kato <[email protected]>
  • Loading branch information
kzys authored and Kirtana Ashok committed Jan 18, 2023
1 parent d8bc609 commit f23bd28
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions contrib/snapshotservice/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var empty = &ptypes.Empty{}

type service struct {
sn snapshots.Snapshotter
snapshotsapi.UnimplementedSnapshotsServer
}

// FromSnapshotter returns a Snapshot API server from a containerd snapshotter
Expand Down
1 change: 1 addition & 0 deletions services/containers/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func init() {

type service struct {
local api.ContainersClient
api.UnimplementedContainersServer
}

var _ api.ContainersServer = &service{}
Expand Down
1 change: 1 addition & 0 deletions services/content/contentserver/contentserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (

type service struct {
store content.Store
api.UnimplementedContentServer
}

var bufPool = sync.Pool{
Expand Down
1 change: 1 addition & 0 deletions services/diff/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func init() {

type service struct {
local diffapi.DiffClient
diffapi.UnimplementedDiffServer
}

var _ diffapi.DiffServer = &service{}
Expand Down
1 change: 1 addition & 0 deletions services/events/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func init() {
type service struct {
ttService *ttrpcService
events *exchange.Exchange
api.UnimplementedEventsServer
}

// NewService returns the GRPC events server
Expand Down
1 change: 1 addition & 0 deletions services/images/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func init() {

type service struct {
local imagesapi.ImagesClient
imagesapi.UnimplementedImagesServer
}

var _ imagesapi.ImagesServer = &service{}
Expand Down
1 change: 1 addition & 0 deletions services/introspection/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func init() {

type server struct {
local api.IntrospectionClient
api.UnimplementedIntrospectionServer
}

var _ = (api.IntrospectionServer)(&server{})
Expand Down
1 change: 1 addition & 0 deletions services/leases/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func init() {

type service struct {
lm leases.Manager
api.UnimplementedLeasesServer
}

func (s *service) Register(server *grpc.Server) error {
Expand Down
1 change: 1 addition & 0 deletions services/namespaces/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func init() {

type service struct {
local api.NamespacesClient
api.UnimplementedNamespacesServer
}

var _ api.NamespacesServer = &service{}
Expand Down
1 change: 1 addition & 0 deletions services/sandbox/controller_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func init() {

type controllerService struct {
local api.ControllerClient
api.UnimplementedControllerServer
}

var _ api.ControllerServer = (*controllerService)(nil)
Expand Down
1 change: 1 addition & 0 deletions services/sandbox/store_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func init() {

type sandboxService struct {
local api.StoreClient
api.UnimplementedStoreServer
}

var _ api.StoreServer = (*sandboxService)(nil)
Expand Down
1 change: 1 addition & 0 deletions services/snapshots/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var empty = &ptypes.Empty{}

type service struct {
ss map[string]snapshots.Snapshotter
snapshotsapi.UnimplementedSnapshotsServer
}

func newService(ic *plugin.InitContext) (interface{}, error) {
Expand Down
1 change: 1 addition & 0 deletions services/tasks/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func init() {

type service struct {
local api.TasksClient
api.UnimplementedTasksServer
}

func (s *service) Register(server *grpc.Server) error {
Expand Down
1 change: 1 addition & 0 deletions services/version/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
}

type service struct {
api.UnimplementedVersionServer
}

func (s *service) Register(server *grpc.Server) error {
Expand Down

0 comments on commit f23bd28

Please sign in to comment.