pb: use *UnimplementedServer to avoid breaking API changes

Change-Id: I99a34eeb37ac4453411f273511710562a519f57a
This commit is contained in:
Egon Elbre 2021-03-29 11:58:04 +03:00
parent c8a3e0ff96
commit 86e698f572
18 changed files with 31 additions and 39 deletions

View File

@ -18,6 +18,8 @@ import (
// Endpoint implements pb.CertificatesServer. // Endpoint implements pb.CertificatesServer.
type Endpoint struct { type Endpoint struct {
pb.DRPCCertificatesUnimplementedServer
rpclog *rpcerrs.Log rpclog *rpcerrs.Log
log *zap.Logger log *zap.Logger
ca *identity.FullCertificateAuthority ca *identity.FullCertificateAuthority

View File

@ -26,6 +26,7 @@ var (
// Endpoint implements the contact service Endpoints. // Endpoint implements the contact service Endpoints.
type Endpoint struct { type Endpoint struct {
pb.DRPCNodeUnimplementedServer
log *zap.Logger log *zap.Logger
service *Service service *Service
} }

View File

@ -40,6 +40,8 @@ var (
// Endpoint for handling the transfer of pieces for Graceful Exit. // Endpoint for handling the transfer of pieces for Graceful Exit.
type Endpoint struct { type Endpoint struct {
pb.DRPCSatelliteGracefulExitUnimplementedServer
log *zap.Logger log *zap.Logger
interval time.Duration interval time.Duration
signer signing.Signer signer signing.Signer

View File

@ -30,6 +30,7 @@ var (
// //
// architecture: Endpoint // architecture: Endpoint
type Endpoint struct { type Endpoint struct {
internalpb.DRPCHealthInspectorUnimplementedServer
log *zap.Logger log *zap.Logger
overlay *overlay.Service overlay *overlay.Service
metabaseDB metainfo.MetabaseDB metabaseDB metainfo.MetabaseDB

View File

@ -62,6 +62,8 @@ type APIKeys interface {
// //
// architecture: Endpoint // architecture: Endpoint
type Endpoint struct { type Endpoint struct {
pb.DRPCMetainfoUnimplementedServer
log *zap.Logger log *zap.Logger
metainfo *Service metainfo *Service
deletePieces *piecedeletion.Service deletePieces *piecedeletion.Service
@ -1001,13 +1003,6 @@ func (endpoint *Endpoint) ListObjects(ctx context.Context, req *pb.ObjectListReq
return resp, nil return resp, nil
} }
// GetPendingObjects get pending objects according to specific parameters.
func (endpoint *Endpoint) GetPendingObjects(ctx context.Context, req *pb.GetPendingObjectsRequest) (resp *pb.GetPendingObjectsResponse, err error) {
defer mon.Task()(&ctx)(&err)
return nil, rpcstatus.Error(rpcstatus.Unimplemented, "Not Implemented")
}
// ListPendingObjectStreams list pending objects according to specific parameters. // ListPendingObjectStreams list pending objects according to specific parameters.
func (endpoint *Endpoint) ListPendingObjectStreams(ctx context.Context, req *pb.ObjectListPendingStreamsRequest) (resp *pb.ObjectListPendingStreamsResponse, err error) { func (endpoint *Endpoint) ListPendingObjectStreams(ctx context.Context, req *pb.ObjectListPendingStreamsRequest) (resp *pb.ObjectListPendingStreamsResponse, err error) {
defer mon.Task()(&ctx)(&err) defer mon.Task()(&ctx)(&err)
@ -1195,12 +1190,6 @@ func (endpoint *Endpoint) BeginDeleteObject(ctx context.Context, req *pb.ObjectB
}, nil }, nil
} }
// FinishDeleteObject finishes object deletion.
func (endpoint *Endpoint) FinishDeleteObject(ctx context.Context, req *pb.ObjectFinishDeleteRequest) (resp *pb.ObjectFinishDeleteResponse, err error) {
// all logic for deleting is now in BeginDeleteObject
return nil, rpcstatus.Error(rpcstatus.Unimplemented, "not implemented")
}
// GetObjectIPs returns the IP addresses of the nodes holding the pieces for // GetObjectIPs returns the IP addresses of the nodes holding the pieces for
// the provided object. This is useful for knowing the locations of the pieces. // the provided object. This is useful for knowing the locations of the pieces.
func (endpoint *Endpoint) GetObjectIPs(ctx context.Context, req *pb.ObjectGetIPsRequest) (resp *pb.ObjectGetIPsResponse, err error) { func (endpoint *Endpoint) GetObjectIPs(ctx context.Context, req *pb.ObjectGetIPsRequest) (resp *pb.ObjectGetIPsResponse, err error) {
@ -1643,18 +1632,6 @@ func (endpoint *Endpoint) makeInlineSegment(ctx context.Context, req *pb.Segment
return nil, &pb.SegmentMakeInlineResponse{}, nil return nil, &pb.SegmentMakeInlineResponse{}, nil
} }
// BeginDeleteSegment begins segment deletion process.
func (endpoint *Endpoint) BeginDeleteSegment(ctx context.Context, req *pb.SegmentBeginDeleteRequest) (resp *pb.SegmentBeginDeleteResponse, err error) {
// all logic for deleting is now in BeginDeleteObject
return nil, rpcstatus.Error(rpcstatus.Unimplemented, "not implemented")
}
// FinishDeleteSegment finishes segment deletion process.
func (endpoint *Endpoint) FinishDeleteSegment(ctx context.Context, req *pb.SegmentFinishDeleteRequest) (resp *pb.SegmentFinishDeleteResponse, err error) {
// all logic for deleting is now in BeginDeleteObject
return nil, rpcstatus.Error(rpcstatus.Unimplemented, "not implemented")
}
// ListSegments list object segments. // ListSegments list object segments.
func (endpoint *Endpoint) ListSegments(ctx context.Context, req *pb.SegmentListRequest) (resp *pb.SegmentListResponse, err error) { func (endpoint *Endpoint) ListSegments(ctx context.Context, req *pb.SegmentListRequest) (resp *pb.SegmentListResponse, err error) {
defer mon.Task()(&ctx)(&err) defer mon.Task()(&ctx)(&err)
@ -1729,12 +1706,6 @@ func (endpoint *Endpoint) ListSegments(ctx context.Context, req *pb.SegmentListR
}, nil }, nil
} }
// DownloadObject returns all the information necessary to begin downloading an object in a single request.
func (endpoint *Endpoint) DownloadObject(ctx context.Context, req *pb.ObjectDownloadRequest) (resp *pb.ObjectDownloadResponse, err error) {
defer mon.Task()(&ctx)(&err)
return nil, rpcstatus.Error(rpcstatus.Unimplemented, "Not Implemented")
}
// DownloadSegment returns data necessary to download segment. // DownloadSegment returns data necessary to download segment.
func (endpoint *Endpoint) DownloadSegment(ctx context.Context, req *pb.SegmentDownloadRequest) (resp *pb.SegmentDownloadResponse, err error) { func (endpoint *Endpoint) DownloadSegment(ctx context.Context, req *pb.SegmentDownloadRequest) (resp *pb.SegmentDownloadResponse, err error) {
defer mon.Task()(&ctx)(&err) defer mon.Task()(&ctx)(&err)

View File

@ -25,6 +25,8 @@ var (
// //
// architecture: Endpoint // architecture: Endpoint
type Endpoint struct { type Endpoint struct {
pb.DRPCNodeStatsUnimplementedServer
log *zap.Logger log *zap.Logger
overlay overlay.DB overlay overlay.DB
accounting accounting.StoragenodeAccounting accounting accounting.StoragenodeAccounting

View File

@ -146,6 +146,7 @@ func SortStoragenodeBandwidthRollups(rollups []StoragenodeBandwidthRollup) {
// //
// architecture: Endpoint // architecture: Endpoint
type Endpoint struct { type Endpoint struct {
pb.DRPCOrdersUnimplementedServer
log *zap.Logger log *zap.Logger
satelliteSignee signing.Signee satelliteSignee signing.Signee
DB DB DB DB

View File

@ -6,8 +6,6 @@ package overlay
import ( import (
"context" "context"
"github.com/zeebo/errs"
"storj.io/storj/satellite/internalpb" "storj.io/storj/satellite/internalpb"
) )
@ -15,6 +13,7 @@ import (
// //
// architecture: Endpoint // architecture: Endpoint
type Inspector struct { type Inspector struct {
internalpb.DRPCOverlayInspectorUnimplementedServer
service *Service service *Service
} }
@ -35,9 +34,3 @@ func (srv *Inspector) CountNodes(ctx context.Context, req *internalpb.CountNodes
Count: int64(len(overlayKeys)), Count: int64(len(overlayKeys)),
}, nil }, nil
} }
// DumpNodes returns all of the nodes in the overlay.
func (srv *Inspector) DumpNodes(ctx context.Context, req *internalpb.DumpNodesRequest) (_ *internalpb.DumpNodesResponse, err error) {
defer mon.Task()(&ctx)(&err)
return &internalpb.DumpNodesResponse{}, errs.New("Not Implemented")
}

View File

@ -19,6 +19,8 @@ var (
// //
// architecture: Endpoint // architecture: Endpoint
type Inspector struct { type Inspector struct {
internalpb.DRPCIrreparableInspectorUnimplementedServer
irrdb DB irrdb DB
} }

View File

@ -25,6 +25,8 @@ var (
// //
// architecture: Endpoint // architecture: Endpoint
type Endpoint struct { type Endpoint struct {
pb.DRPCHeldAmountUnimplementedServer
service *Service service *Service
log *zap.Logger log *zap.Logger
overlay overlay.DB overlay overlay.DB

View File

@ -20,6 +20,7 @@ import (
// //
// architecture: Endpoint // architecture: Endpoint
type Endpoint struct { type Endpoint struct {
pb.DRPCContactUnimplementedServer
log *zap.Logger log *zap.Logger
pingStats *PingStats pingStats *PingStats
} }

View File

@ -21,6 +21,8 @@ import (
// Endpoint implements private inspector for Graceful Exit. // Endpoint implements private inspector for Graceful Exit.
type Endpoint struct { type Endpoint struct {
internalpb.DRPCNodeGracefulExitUnimplementedServer
log *zap.Logger log *zap.Logger
usageCache *pieces.BlobsUsageCache usageCache *pieces.BlobsUsageCache
trust *trust.Pool trust *trust.Pool

View File

@ -31,6 +31,8 @@ var (
// //
// architecture: Endpoint // architecture: Endpoint
type Endpoint struct { type Endpoint struct {
internalpb.DRPCPieceStoreInspectorUnimplementedServer
log *zap.Logger log *zap.Logger
pieceStore *pieces.Store pieceStore *pieces.Store
contact *contact.Service contact *contact.Service

View File

@ -21,6 +21,8 @@ var _ multinodepb.DRPCBandwidthServer = (*BandwidthEndpoint)(nil)
// //
// architecture: Endpoint // architecture: Endpoint
type BandwidthEndpoint struct { type BandwidthEndpoint struct {
multinodepb.DRPCBandwidthUnimplementedServer
log *zap.Logger log *zap.Logger
apiKeys *apikeys.Service apiKeys *apikeys.Service
db bandwidth.DB db bandwidth.DB

View File

@ -23,6 +23,8 @@ var _ multinodepb.DRPCNodeServer = (*NodeEndpoint)(nil)
// //
// architecture: Endpoint // architecture: Endpoint
type NodeEndpoint struct { type NodeEndpoint struct {
multinodepb.DRPCNodeUnimplementedServer
log *zap.Logger log *zap.Logger
apiKeys *apikeys.Service apiKeys *apikeys.Service
version version.Info version version.Info

View File

@ -20,6 +20,8 @@ var _ multinodepb.DRPCPayoutServer = (*PayoutEndpoint)(nil)
// //
// architecture: Endpoint // architecture: Endpoint
type PayoutEndpoint struct { type PayoutEndpoint struct {
multinodepb.DRPCPayoutUnimplementedServer
log *zap.Logger log *zap.Logger
apiKeys *apikeys.Service apiKeys *apikeys.Service
db payouts.DB db payouts.DB

View File

@ -20,6 +20,8 @@ var _ multinodepb.DRPCStorageServer = (*StorageEndpoint)(nil)
// //
// architecture: Endpoint // architecture: Endpoint
type StorageEndpoint struct { type StorageEndpoint struct {
multinodepb.DRPCStorageUnimplementedServer
log *zap.Logger log *zap.Logger
apiKeys *apikeys.Service apiKeys *apikeys.Service
monitor *monitor.Service monitor *monitor.Service

View File

@ -78,6 +78,8 @@ type pingStatsSource interface {
// //
// architecture: Endpoint // architecture: Endpoint
type Endpoint struct { type Endpoint struct {
pb.DRPCContactUnimplementedServer
log *zap.Logger log *zap.Logger
config Config config Config