multinode/payouts: naming refactoring

Renamed methods, error messages.

Change-Id: I7d7b6b092c05bbc5bf1322855efc5ccb9b312671
This commit is contained in:
Qweder93 2021-05-25 19:48:45 +03:00 committed by Yaroslav Vorobiov
parent 20b98d31b8
commit 91b7e24d55
11 changed files with 1305 additions and 786 deletions

View File

@ -35,13 +35,13 @@ func NewPayouts(log *zap.Logger, service *payouts.Service) *Payouts {
}
}
// GetAllNodesTotalEarned handles retrieval total earned amount .
func (controller *Payouts) GetAllNodesTotalEarned(w http.ResponseWriter, r *http.Request) {
// Earned handles retrieval total earned amount .
func (controller *Payouts) Earned(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
defer mon.Task()(&ctx)(&err)
earned, err := controller.service.GetAllNodesAllTimeEarned(ctx)
earned, err := controller.service.Earned(ctx)
if err != nil {
controller.log.Error("all node total earned internal error", zap.Error(err))
controller.serveError(w, http.StatusInternalServerError, ErrPayouts.Wrap(err))
@ -107,8 +107,8 @@ func (controller *Payouts) Expectations(w http.ResponseWriter, r *http.Request)
}
}
// PeriodSummary handles retrieval from nodes for specific period.
func (controller *Payouts) PeriodSummary(w http.ResponseWriter, r *http.Request) {
// SummaryPeriod handles retrieval from nodes for specific period.
func (controller *Payouts) SummaryPeriod(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
defer mon.Task()(&ctx)(&err)
@ -122,7 +122,7 @@ func (controller *Payouts) PeriodSummary(w http.ResponseWriter, r *http.Request)
return
}
summary, err := controller.service.NodesPeriodSummary(ctx, period)
summary, err := controller.service.SummaryPeriod(ctx, period)
if err != nil {
controller.serveError(w, http.StatusInternalServerError, ErrPayouts.Wrap(err))
return
@ -142,7 +142,7 @@ func (controller *Payouts) Summary(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Content-Type", "application/json")
summary, err := controller.service.NodesSummary(ctx)
summary, err := controller.service.Summary(ctx)
if err != nil {
controller.serveError(w, http.StatusInternalServerError, ErrPayouts.Wrap(err))
return
@ -154,8 +154,8 @@ func (controller *Payouts) Summary(w http.ResponseWriter, r *http.Request) {
}
}
// SatellitePeriodSummary handles retrieval from nodes from specific satellite for specific period.
func (controller *Payouts) SatellitePeriodSummary(w http.ResponseWriter, r *http.Request) {
// SummarySatellitePeriod handles retrieval from nodes from specific satellite for specific period.
func (controller *Payouts) SummarySatellitePeriod(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
defer mon.Task()(&ctx)(&err)
@ -171,7 +171,7 @@ func (controller *Payouts) SatellitePeriodSummary(w http.ResponseWriter, r *http
id, ok := segmentParams["id"]
if !ok {
controller.serveError(w, http.StatusBadRequest, ErrPayouts.New("couldn't receive route variable id"))
controller.serveError(w, http.StatusBadRequest, ErrPayouts.New("couldn't receive route variable satellite id"))
return
}
@ -181,7 +181,7 @@ func (controller *Payouts) SatellitePeriodSummary(w http.ResponseWriter, r *http
return
}
summary, err := controller.service.NodesSatellitePeriodSummary(ctx, satelliteID, period)
summary, err := controller.service.SummarySatellitePeriod(ctx, satelliteID, period)
if err != nil {
controller.serveError(w, http.StatusInternalServerError, ErrPayouts.Wrap(err))
return
@ -193,8 +193,8 @@ func (controller *Payouts) SatellitePeriodSummary(w http.ResponseWriter, r *http
}
}
// SatelliteSummary handles retrieval from nodes from specific satellite.
func (controller *Payouts) SatelliteSummary(w http.ResponseWriter, r *http.Request) {
// SummarySatellite handles retrieval from nodes from specific satellite.
func (controller *Payouts) SummarySatellite(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
defer mon.Task()(&ctx)(&err)
@ -204,7 +204,7 @@ func (controller *Payouts) SatelliteSummary(w http.ResponseWriter, r *http.Reque
id, ok := segmentParams["id"]
if !ok {
controller.serveError(w, http.StatusBadRequest, ErrPayouts.New("couldn't receive route variable id"))
controller.serveError(w, http.StatusBadRequest, ErrPayouts.New("couldn't receive route variable satellite id"))
return
}
@ -214,7 +214,7 @@ func (controller *Payouts) SatelliteSummary(w http.ResponseWriter, r *http.Reque
return
}
summary, err := controller.service.NodesSatelliteSummary(ctx, satelliteID)
summary, err := controller.service.SummarySatellite(ctx, satelliteID)
if err != nil {
controller.serveError(w, http.StatusInternalServerError, ErrPayouts.Wrap(err))
return
@ -259,8 +259,8 @@ func (controller *Payouts) Paystub(w http.ResponseWriter, r *http.Request) {
}
}
// SatellitePaystub returns all summed paystubs from specific satellite.
func (controller *Payouts) SatellitePaystub(w http.ResponseWriter, r *http.Request) {
// PaystubSatellite returns all summed paystubs from specific satellite.
func (controller *Payouts) PaystubSatellite(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
defer mon.Task()(&ctx)(&err)
@ -270,7 +270,7 @@ func (controller *Payouts) SatellitePaystub(w http.ResponseWriter, r *http.Reque
id, ok := segmentParams["id"]
if !ok {
controller.serveError(w, http.StatusBadRequest, ErrPayouts.New("couldn't receive route variable id"))
controller.serveError(w, http.StatusBadRequest, ErrPayouts.New("couldn't receive route variable satellite id"))
return
}
@ -292,7 +292,7 @@ func (controller *Payouts) SatellitePaystub(w http.ResponseWriter, r *http.Reque
return
}
paystub, err := controller.service.SatellitePaystub(ctx, nodeID, satelliteID)
paystub, err := controller.service.PaystubSatellite(ctx, nodeID, satelliteID)
if err != nil {
controller.serveError(w, http.StatusInternalServerError, ErrPayouts.Wrap(err))
return
@ -304,8 +304,8 @@ func (controller *Payouts) SatellitePaystub(w http.ResponseWriter, r *http.Reque
}
}
// SatellitePaystubPeriod returns satellite summed paystubs for period.
func (controller *Payouts) SatellitePaystubPeriod(w http.ResponseWriter, r *http.Request) {
// PaystubSatellitePeriod returns satellite summed paystubs for period.
func (controller *Payouts) PaystubSatellitePeriod(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
defer mon.Task()(&ctx)(&err)
@ -315,7 +315,7 @@ func (controller *Payouts) SatellitePaystubPeriod(w http.ResponseWriter, r *http
id, ok := segmentParams["id"]
if !ok {
controller.serveError(w, http.StatusBadRequest, ErrPayouts.New("couldn't receive route variable id"))
controller.serveError(w, http.StatusBadRequest, ErrPayouts.New("couldn't receive route variable satellite id"))
return
}
@ -343,7 +343,7 @@ func (controller *Payouts) SatellitePaystubPeriod(w http.ResponseWriter, r *http
return
}
paystub, err := controller.service.SatellitePaystubPeriod(ctx, period, nodeID, satelliteID)
paystub, err := controller.service.PaystubSatellitePeriod(ctx, period, nodeID, satelliteID)
if err != nil {
controller.serveError(w, http.StatusInternalServerError, ErrPayouts.Wrap(err))
return

View File

@ -76,17 +76,17 @@ func NewServer(log *zap.Logger, config Config, nodes *nodes.Service, payouts *pa
payoutsController := controllers.NewPayouts(server.log, server.payouts)
payoutsRouter := apiRouter.PathPrefix("/payouts").Subrouter()
payoutsRouter.HandleFunc("/summaries", payoutsController.Summary).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/summaries/{period}", payoutsController.PeriodSummary).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/summaries/{period}", payoutsController.SummaryPeriod).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/expectations", payoutsController.Expectations).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/expectations/{nodeID}", payoutsController.NodeExpectations).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/paystubs/{nodeID}", payoutsController.Paystub).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/paystubs/{period}/{nodeID}", payoutsController.PaystubPeriod).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/total-earned", payoutsController.GetAllNodesTotalEarned).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/total-earned", payoutsController.Earned).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/held-amounts/{nodeID}", payoutsController.HeldAmountSummary).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/satellites/{id}/summaries", payoutsController.SatelliteSummary).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/satellites/{id}/summaries/{period}", payoutsController.SatellitePeriodSummary).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/satellites/{id}/paystubs/{nodeID}", payoutsController.SatellitePaystub).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/satellites/{id}/paystubs/{period}/{nodeID}", payoutsController.SatellitePaystubPeriod).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/satellites/{id}/summaries", payoutsController.SummarySatellite).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/satellites/{id}/summaries/{period}", payoutsController.SummarySatellitePeriod).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/satellites/{id}/paystubs/{nodeID}", payoutsController.PaystubSatellite).Methods(http.MethodGet)
payoutsRouter.HandleFunc("/satellites/{id}/paystubs/{period}/{nodeID}", payoutsController.PaystubSatellitePeriod).Methods(http.MethodGet)
if server.config.StaticDir != "" {
router.PathPrefix("/static/").Handler(http.StripPrefix("/static", fs))

View File

@ -102,7 +102,7 @@ func (service *Service) ListInfos(ctx context.Context) (_ []NodeInfo, err error)
nodeClient := multinodepb.NewDRPCNodeClient(conn)
storageClient := multinodepb.NewDRPCStorageClient(conn)
bandwidthClient := multinodepb.NewDRPCBandwidthClient(conn)
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
@ -185,7 +185,7 @@ func (service *Service) ListInfosSatellite(ctx context.Context, satelliteID stor
}()
nodeClient := multinodepb.NewDRPCNodeClient(conn)
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,

View File

@ -41,8 +41,8 @@ func NewService(log *zap.Logger, dialer rpc.Dialer, nodes nodes.DB) *Service {
}
}
// GetAllNodesAllTimeEarned retrieves all nodes earned amount for all time.
func (service *Service) GetAllNodesAllTimeEarned(ctx context.Context) (earned int64, err error) {
// Earned retrieves all nodes earned amount for all time.
func (service *Service) Earned(ctx context.Context) (earned int64, err error) {
defer mon.Task()(&ctx)(&err)
storageNodes, err := service.nodes.List(ctx)
@ -51,7 +51,7 @@ func (service *Service) GetAllNodesAllTimeEarned(ctx context.Context) (earned in
}
for _, node := range storageNodes {
amount, err := service.getAmount(ctx, node)
amount, err := service.earned(ctx, node)
if err != nil {
service.log.Error("failed to getAmount", zap.Error(err))
continue
@ -63,8 +63,8 @@ func (service *Service) GetAllNodesAllTimeEarned(ctx context.Context) (earned in
return earned, nil
}
// GetAllNodesEarnedOnSatellite retrieves all nodes earned amount for all time per satellite.
func (service *Service) GetAllNodesEarnedOnSatellite(ctx context.Context) (earned []SatelliteSummary, err error) {
// EarnedSatellite retrieves all nodes earned amount for all time per satellite.
func (service *Service) EarnedSatellite(ctx context.Context) (earned []SatelliteSummary, err error) {
defer mon.Task()(&ctx)(&err)
storageNodes, err := service.nodes.List(ctx)
@ -73,10 +73,10 @@ func (service *Service) GetAllNodesEarnedOnSatellite(ctx context.Context) (earne
}
var listSatellites storj.NodeIDList
var listNodesEarnedPerSatellite []multinodepb.EarnedPerSatelliteResponse
var listNodesEarnedPerSatellite []multinodepb.EarnedSatelliteResponse
for _, node := range storageNodes {
earnedPerSatellite, err := service.getEarnedOnSatellite(ctx, node)
earnedPerSatellite, err := service.earnedSatellite(ctx, node)
if err != nil {
service.log.Error("failed to getEarnedFromSatellite", zap.Error(err))
continue
@ -113,8 +113,8 @@ func (service *Service) GetAllNodesEarnedOnSatellite(ctx context.Context) (earne
return earned, nil
}
// NodesSummary returns all satellites all time stats.
func (service *Service) NodesSummary(ctx context.Context) (_ Summary, err error) {
// Summary returns all satellites all time stats.
func (service *Service) Summary(ctx context.Context) (_ Summary, err error) {
defer mon.Task()(&ctx)(&err)
var summary Summary
@ -125,7 +125,7 @@ func (service *Service) NodesSummary(ctx context.Context) (_ Summary, err error)
}
for _, node := range list {
info, err := service.getAllSatellitesAllTime(ctx, node)
info, err := service.summary(ctx, node)
if err != nil {
return Summary{}, Error.Wrap(err)
}
@ -136,8 +136,8 @@ func (service *Service) NodesSummary(ctx context.Context) (_ Summary, err error)
return summary, nil
}
// NodesPeriodSummary returns all satellites stats for specific period.
func (service *Service) NodesPeriodSummary(ctx context.Context, period string) (_ Summary, err error) {
// SummaryPeriod returns all satellites stats for specific period.
func (service *Service) SummaryPeriod(ctx context.Context, period string) (_ Summary, err error) {
defer mon.Task()(&ctx)(&err)
var summary Summary
@ -148,7 +148,7 @@ func (service *Service) NodesPeriodSummary(ctx context.Context, period string) (
}
for _, node := range list {
info, err := service.getAllSatellitesPeriod(ctx, node, period)
info, err := service.summaryPeriod(ctx, node, period)
if err != nil {
return Summary{}, Error.Wrap(err)
}
@ -159,8 +159,8 @@ func (service *Service) NodesPeriodSummary(ctx context.Context, period string) (
return summary, nil
}
// NodesSatelliteSummary returns specific satellite all time stats.
func (service *Service) NodesSatelliteSummary(ctx context.Context, satelliteID storj.NodeID) (_ Summary, err error) {
// SummarySatellite returns specific satellite all time stats.
func (service *Service) SummarySatellite(ctx context.Context, satelliteID storj.NodeID) (_ Summary, err error) {
defer mon.Task()(&ctx)(&err)
var summary Summary
@ -170,7 +170,7 @@ func (service *Service) NodesSatelliteSummary(ctx context.Context, satelliteID s
}
for _, node := range list {
info, err := service.nodeSatelliteSummary(ctx, node, satelliteID)
info, err := service.summarySatellite(ctx, node, satelliteID)
if err != nil {
return Summary{}, Error.Wrap(err)
}
@ -181,8 +181,8 @@ func (service *Service) NodesSatelliteSummary(ctx context.Context, satelliteID s
return summary, nil
}
// NodesSatellitePeriodSummary returns specific satellite stats for specific period.
func (service *Service) NodesSatellitePeriodSummary(ctx context.Context, satelliteID storj.NodeID, period string) (_ Summary, err error) {
// SummarySatellitePeriod returns specific satellite stats for specific period.
func (service *Service) SummarySatellitePeriod(ctx context.Context, satelliteID storj.NodeID, period string) (_ Summary, err error) {
defer mon.Task()(&ctx)(&err)
var summary Summary
@ -192,7 +192,7 @@ func (service *Service) NodesSatellitePeriodSummary(ctx context.Context, satelli
}
for _, node := range list {
info, err := service.nodeSatellitePeriodSummary(ctx, node, satelliteID, period)
info, err := service.summarySatellitePeriod(ctx, node, satelliteID, period)
if err != nil {
return Summary{}, Error.Wrap(err)
}
@ -203,8 +203,8 @@ func (service *Service) NodesSatellitePeriodSummary(ctx context.Context, satelli
return summary, nil
}
// nodeSatelliteSummary returns payout info for single satellite, for specific node.
func (service *Service) nodeSatelliteSummary(ctx context.Context, node nodes.Node, satelliteID storj.NodeID) (info *multinodepb.PayoutInfo, err error) {
// summarySatellite returns payout info for single satellite, for specific node.
func (service *Service) summarySatellite(ctx context.Context, node nodes.Node, satelliteID storj.NodeID) (info *multinodepb.PayoutInfo, err error) {
conn, err := service.dialer.DialNodeURL(ctx, storj.NodeURL{
ID: node.ID,
Address: node.PublicAddress,
@ -217,12 +217,12 @@ func (service *Service) nodeSatelliteSummary(ctx context.Context, node nodes.Nod
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
response, err := payoutClient.SatelliteSummary(ctx, &multinodepb.SatelliteSummaryRequest{Header: header, SatelliteId: satelliteID})
response, err := payoutClient.SummarySatellite(ctx, &multinodepb.SummarySatelliteRequest{Header: header, SatelliteId: satelliteID})
if err != nil {
return &multinodepb.PayoutInfo{}, Error.Wrap(err)
}
@ -230,8 +230,8 @@ func (service *Service) nodeSatelliteSummary(ctx context.Context, node nodes.Nod
return response.PayoutInfo, nil
}
// nodeSatellitePeriodSummary returns satellite payout info for specific node for specific period.
func (service *Service) nodeSatellitePeriodSummary(ctx context.Context, node nodes.Node, satelliteID storj.NodeID, period string) (info *multinodepb.PayoutInfo, err error) {
// summarySatellitePeriod returns satellite payout info for specific node for specific period.
func (service *Service) summarySatellitePeriod(ctx context.Context, node nodes.Node, satelliteID storj.NodeID, period string) (info *multinodepb.PayoutInfo, err error) {
conn, err := service.dialer.DialNodeURL(ctx, storj.NodeURL{
ID: node.ID,
Address: node.PublicAddress,
@ -244,12 +244,12 @@ func (service *Service) nodeSatellitePeriodSummary(ctx context.Context, node nod
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
response, err := payoutClient.SatellitePeriodSummary(ctx, &multinodepb.SatellitePeriodSummaryRequest{Header: header, SatelliteId: satelliteID, Period: period})
response, err := payoutClient.SummarySatellitePeriod(ctx, &multinodepb.SummarySatellitePeriodRequest{Header: header, SatelliteId: satelliteID, Period: period})
if err != nil {
return &multinodepb.PayoutInfo{}, Error.Wrap(err)
}
@ -257,7 +257,8 @@ func (service *Service) nodeSatellitePeriodSummary(ctx context.Context, node nod
return response.PayoutInfo, nil
}
func (service *Service) getAllSatellitesPeriod(ctx context.Context, node nodes.Node, period string) (info *multinodepb.PayoutInfo, err error) {
// summaryPeriod returns node's payout info for specific period.
func (service *Service) summaryPeriod(ctx context.Context, node nodes.Node, period string) (info *multinodepb.PayoutInfo, err error) {
conn, err := service.dialer.DialNodeURL(ctx, storj.NodeURL{
ID: node.ID,
Address: node.PublicAddress,
@ -270,12 +271,12 @@ func (service *Service) getAllSatellitesPeriod(ctx context.Context, node nodes.N
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
response, err := payoutClient.AllSatellitesPeriodSummary(ctx, &multinodepb.AllSatellitesPeriodSummaryRequest{Header: header, Period: period})
response, err := payoutClient.SummaryPeriod(ctx, &multinodepb.SummaryPeriodRequest{Header: header, Period: period})
if err != nil {
return &multinodepb.PayoutInfo{}, Error.Wrap(err)
}
@ -283,7 +284,8 @@ func (service *Service) getAllSatellitesPeriod(ctx context.Context, node nodes.N
return response.PayoutInfo, nil
}
func (service *Service) getAllSatellitesAllTime(ctx context.Context, node nodes.Node) (info *multinodepb.PayoutInfo, err error) {
// summary returns node's total payout info.
func (service *Service) summary(ctx context.Context, node nodes.Node) (info *multinodepb.PayoutInfo, err error) {
conn, err := service.dialer.DialNodeURL(ctx, storj.NodeURL{
ID: node.ID,
Address: node.PublicAddress,
@ -296,12 +298,12 @@ func (service *Service) getAllSatellitesAllTime(ctx context.Context, node nodes.
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
response, err := payoutClient.AllSatellitesSummary(ctx, &multinodepb.AllSatellitesSummaryRequest{Header: header})
response, err := payoutClient.Summary(ctx, &multinodepb.SummaryRequest{Header: header})
if err != nil {
return &multinodepb.PayoutInfo{}, Error.Wrap(err)
}
@ -431,7 +433,7 @@ func (service *Service) HeldAmountSummary(ctx context.Context, nodeID storj.Node
// heldAmountHistory retrieves held amount history for a particular node.
func (service *Service) heldAmountHistory(ctx context.Context, node nodes.Node, conn drpc.Conn) (_ []HeldAmountHistory, err error) {
defer mon.Task()(&ctx)(&err)
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
@ -477,12 +479,12 @@ func (service *Service) nodeExpectations(ctx context.Context, node nodes.Node) (
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
estimated, err := payoutClient.EstimatedPayoutTotal(ctx, &multinodepb.EstimatedPayoutTotalRequest{Header: header})
estimated, err := payoutClient.EstimatedPayout(ctx, &multinodepb.EstimatedPayoutRequest{Header: header})
if err != nil {
return Expectations{}, Error.Wrap(err)
}
@ -495,8 +497,8 @@ func (service *Service) nodeExpectations(ctx context.Context, node nodes.Node) (
return Expectations{Undistributed: undistributed.Total, CurrentMonthEstimation: estimated.EstimatedEarnings}, nil
}
// getAmount returns earned from node.
func (service *Service) getAmount(ctx context.Context, node nodes.Node) (_ int64, err error) {
// earned returns earned from node.
func (service *Service) earned(ctx context.Context, node nodes.Node) (_ int64, err error) {
conn, err := service.dialer.DialNodeURL(ctx, storj.NodeURL{
ID: node.ID,
Address: node.PublicAddress,
@ -509,7 +511,7 @@ func (service *Service) getAmount(ctx context.Context, node nodes.Node) (_ int64
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
@ -522,35 +524,35 @@ func (service *Service) getAmount(ctx context.Context, node nodes.Node) (_ int64
return amount.Total, nil
}
// getEarnedOnSatellite returns earned split by satellites.
func (service *Service) getEarnedOnSatellite(ctx context.Context, node nodes.Node) (_ multinodepb.EarnedPerSatelliteResponse, err error) {
// earnedSatellite returns earned split by satellites.
func (service *Service) earnedSatellite(ctx context.Context, node nodes.Node) (_ multinodepb.EarnedSatelliteResponse, err error) {
conn, err := service.dialer.DialNodeURL(ctx, storj.NodeURL{
ID: node.ID,
Address: node.PublicAddress,
})
if err != nil {
return multinodepb.EarnedPerSatelliteResponse{}, Error.Wrap(err)
return multinodepb.EarnedSatelliteResponse{}, Error.Wrap(err)
}
defer func() {
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
response, err := payoutClient.EarnedPerSatellite(ctx, &multinodepb.EarnedPerSatelliteRequest{Header: header})
response, err := payoutClient.EarnedSatellite(ctx, &multinodepb.EarnedSatelliteRequest{Header: header})
if err != nil {
return multinodepb.EarnedPerSatelliteResponse{}, Error.Wrap(err)
return multinodepb.EarnedSatelliteResponse{}, Error.Wrap(err)
}
return *response, nil
}
// SatellitePaystubPeriod returns specific satellite paystub for specific period.
func (service *Service) SatellitePaystubPeriod(ctx context.Context, period string, nodeID, satelliteID storj.NodeID) (_ Paystub, err error) {
// PaystubSatellitePeriod returns specific satellite paystub for specific period.
func (service *Service) PaystubSatellitePeriod(ctx context.Context, period string, nodeID, satelliteID storj.NodeID) (_ Paystub, err error) {
defer mon.Task()(&ctx)(&err)
node, err := service.nodes.Get(ctx, nodeID)
@ -570,12 +572,12 @@ func (service *Service) SatellitePaystubPeriod(ctx context.Context, period strin
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
response, err := payoutClient.SatellitePeriodPaystub(ctx, &multinodepb.SatellitePeriodPaystubRequest{
response, err := payoutClient.PaystubSatellitePeriod(ctx, &multinodepb.PaystubSatellitePeriodRequest{
Header: header,
SatelliteId: satelliteID,
Period: period,
@ -620,12 +622,12 @@ func (service *Service) PaystubPeriod(ctx context.Context, period string, nodeID
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
response, err := payoutClient.PeriodPaystub(ctx, &multinodepb.PeriodPaystubRequest{
response, err := payoutClient.PaystubPeriod(ctx, &multinodepb.PaystubPeriodRequest{
Header: header,
Period: period,
})
@ -648,8 +650,8 @@ func (service *Service) PaystubPeriod(ctx context.Context, period string, nodeID
}, nil
}
// SatellitePaystub returns specific satellite summed paystubs.
func (service *Service) SatellitePaystub(ctx context.Context, nodeID, satelliteID storj.NodeID) (_ Paystub, err error) {
// PaystubSatellite returns specific satellite summed paystubs.
func (service *Service) PaystubSatellite(ctx context.Context, nodeID, satelliteID storj.NodeID) (_ Paystub, err error) {
defer mon.Task()(&ctx)(&err)
node, err := service.nodes.Get(ctx, nodeID)
@ -669,12 +671,12 @@ func (service *Service) SatellitePaystub(ctx context.Context, nodeID, satelliteI
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}
response, err := payoutClient.SatellitePaystub(ctx, &multinodepb.SatellitePaystubRequest{
response, err := payoutClient.PaystubSatellite(ctx, &multinodepb.PaystubSatelliteRequest{
Header: header,
SatelliteId: satelliteID,
})
@ -718,7 +720,7 @@ func (service *Service) Paystub(ctx context.Context, nodeID storj.NodeID) (_ Pay
err = errs.Combine(err, conn.Close())
}()
payoutClient := multinodepb.NewDRPCPayoutClient(conn)
payoutClient := multinodepb.NewDRPCPayoutsClient(conn)
header := &multinodepb.RequestHeader{
ApiKey: node.APISecret,
}

File diff suppressed because it is too large Load Diff

View File

@ -96,20 +96,20 @@ message TrustedSatellitesResponse {
repeated NodeURL trusted_satellites = 1;
}
service Payout {
rpc AllSatellitesSummary(AllSatellitesSummaryRequest) returns (AllSatellitesSummaryResponse);
rpc AllSatellitesPeriodSummary(AllSatellitesPeriodSummaryRequest) returns (AllSatellitesPeriodSummaryResponse);
rpc SatelliteSummary(SatelliteSummaryRequest) returns (SatelliteSummaryResponse);
rpc SatellitePeriodSummary(SatellitePeriodSummaryRequest) returns (SatellitePeriodSummaryResponse);
service Payouts {
rpc Summary(SummaryRequest) returns (SummaryResponse);
rpc SummaryPeriod(SummaryPeriodRequest) returns (SummaryPeriodResponse);
rpc SummarySatellite(SummarySatelliteRequest) returns (SummarySatelliteResponse);
rpc SummarySatellitePeriod(SummarySatellitePeriodRequest) returns (SummarySatellitePeriodResponse);
rpc Earned(EarnedRequest) returns (EarnedResponse);
rpc EarnedPerSatellite(EarnedPerSatelliteRequest) returns (EarnedPerSatelliteResponse);
rpc EarnedSatellite(EarnedSatelliteRequest) returns (EarnedSatelliteResponse);
rpc EstimatedPayoutSatellite(EstimatedPayoutSatelliteRequest) returns (EstimatedPayoutSatelliteResponse);
rpc EstimatedPayoutTotal(EstimatedPayoutTotalRequest) returns (EstimatedPayoutTotalResponse);
rpc EstimatedPayout(EstimatedPayoutRequest) returns (EstimatedPayoutResponse);
rpc Undistributed(UndistributedRequest) returns (UndistributedResponse);
rpc SatellitePaystub(SatellitePaystubRequest) returns (SatellitePaystubResponse);
rpc PaystubSatellite(PaystubSatelliteRequest) returns (PaystubSatelliteResponse);
rpc Paystub(PaystubRequest) returns (PaystubResponse);
rpc PeriodPaystub(PeriodPaystubRequest) returns (PeriodPaystubResponse);
rpc SatellitePeriodPaystub(SatellitePeriodPaystubRequest) returns (SatellitePeriodPaystubResponse);
rpc PaystubPeriod(PaystubPeriodRequest) returns (PaystubPeriodResponse);
rpc PaystubSatellitePeriod(PaystubSatellitePeriodRequest) returns (PaystubSatellitePeriodResponse);
rpc HeldAmountHistory(HeldAmountHistoryRequest) returns (HeldAmountHistoryResponse);
}
@ -122,47 +122,47 @@ message EstimatedPayoutSatelliteResponse {
int64 estimated_earnings = 1;
}
message EstimatedPayoutTotalRequest {
message EstimatedPayoutRequest {
RequestHeader header = 1;
}
message EstimatedPayoutTotalResponse {
message EstimatedPayoutResponse {
int64 estimated_earnings = 1;
}
message AllSatellitesSummaryRequest {
message SummaryRequest {
RequestHeader header = 1;
}
message AllSatellitesSummaryResponse {
message SummaryResponse {
PayoutInfo payout_info = 1;
}
message AllSatellitesPeriodSummaryRequest {
message SummaryPeriodRequest {
RequestHeader header = 1;
string period = 2;
}
message AllSatellitesPeriodSummaryResponse {
message SummaryPeriodResponse {
PayoutInfo payout_info = 1;
}
message SatelliteSummaryRequest {
message SummarySatelliteRequest {
RequestHeader header = 1;
bytes satellite_id = 2 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
}
message SatelliteSummaryResponse {
message SummarySatelliteResponse {
PayoutInfo payout_info = 1;
}
message SatellitePeriodSummaryRequest {
message SummarySatellitePeriodRequest {
RequestHeader header = 1;
bytes satellite_id = 2 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
string period = 3;
}
message SatellitePeriodSummaryResponse {
message SummarySatellitePeriodResponse {
PayoutInfo payout_info = 1;
}
@ -174,11 +174,11 @@ message EarnedResponse {
int64 total = 1;
}
message EarnedPerSatelliteRequest {
message EarnedSatelliteRequest {
RequestHeader header = 1;
}
message EarnedPerSatelliteResponse {
message EarnedSatelliteResponse {
repeated EarnedSatellite earned_satellite = 1;
}
@ -195,11 +195,11 @@ message UndistributedResponse {
int64 total = 1;
}
message SatellitePaystubRequest {
message PaystubSatelliteRequest {
RequestHeader header = 1;
bytes satellite_id = 2 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
}
message SatellitePaystubResponse {
message PaystubSatelliteResponse {
Paystub paystub = 1;
}
message PaystubRequest {
@ -209,22 +209,22 @@ message PaystubResponse {
Paystub paystub = 1;
}
message PeriodPaystubRequest {
message PaystubPeriodRequest {
RequestHeader header = 1;
string period = 2;
}
message PeriodPaystubResponse {
message PaystubPeriodResponse {
Paystub paystub = 1;
}
message SatellitePeriodPaystubRequest {
message PaystubSatellitePeriodRequest {
RequestHeader header = 1;
bytes satellite_id = 2 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
string period = 3;
}
message SatellitePeriodPaystubResponse {
message PaystubSatellitePeriodResponse {
Paystub paystub = 1;
}

View File

@ -384,595 +384,595 @@ func (x *drpcNode_TrustedSatellitesStream) SendAndClose(m *TrustedSatellitesResp
return x.CloseSend()
}
type DRPCPayoutClient interface {
type DRPCPayoutsClient interface {
DRPCConn() drpc.Conn
AllSatellitesSummary(ctx context.Context, in *AllSatellitesSummaryRequest) (*AllSatellitesSummaryResponse, error)
AllSatellitesPeriodSummary(ctx context.Context, in *AllSatellitesPeriodSummaryRequest) (*AllSatellitesPeriodSummaryResponse, error)
SatelliteSummary(ctx context.Context, in *SatelliteSummaryRequest) (*SatelliteSummaryResponse, error)
SatellitePeriodSummary(ctx context.Context, in *SatellitePeriodSummaryRequest) (*SatellitePeriodSummaryResponse, error)
Summary(ctx context.Context, in *SummaryRequest) (*SummaryResponse, error)
SummaryPeriod(ctx context.Context, in *SummaryPeriodRequest) (*SummaryPeriodResponse, error)
SummarySatellite(ctx context.Context, in *SummarySatelliteRequest) (*SummarySatelliteResponse, error)
SummarySatellitePeriod(ctx context.Context, in *SummarySatellitePeriodRequest) (*SummarySatellitePeriodResponse, error)
Earned(ctx context.Context, in *EarnedRequest) (*EarnedResponse, error)
EarnedPerSatellite(ctx context.Context, in *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error)
EarnedSatellite(ctx context.Context, in *EarnedSatelliteRequest) (*EarnedSatelliteResponse, error)
EstimatedPayoutSatellite(ctx context.Context, in *EstimatedPayoutSatelliteRequest) (*EstimatedPayoutSatelliteResponse, error)
EstimatedPayoutTotal(ctx context.Context, in *EstimatedPayoutTotalRequest) (*EstimatedPayoutTotalResponse, error)
EstimatedPayout(ctx context.Context, in *EstimatedPayoutRequest) (*EstimatedPayoutResponse, error)
Undistributed(ctx context.Context, in *UndistributedRequest) (*UndistributedResponse, error)
SatellitePaystub(ctx context.Context, in *SatellitePaystubRequest) (*SatellitePaystubResponse, error)
PaystubSatellite(ctx context.Context, in *PaystubSatelliteRequest) (*PaystubSatelliteResponse, error)
Paystub(ctx context.Context, in *PaystubRequest) (*PaystubResponse, error)
PeriodPaystub(ctx context.Context, in *PeriodPaystubRequest) (*PeriodPaystubResponse, error)
SatellitePeriodPaystub(ctx context.Context, in *SatellitePeriodPaystubRequest) (*SatellitePeriodPaystubResponse, error)
PaystubPeriod(ctx context.Context, in *PaystubPeriodRequest) (*PaystubPeriodResponse, error)
PaystubSatellitePeriod(ctx context.Context, in *PaystubSatellitePeriodRequest) (*PaystubSatellitePeriodResponse, error)
HeldAmountHistory(ctx context.Context, in *HeldAmountHistoryRequest) (*HeldAmountHistoryResponse, error)
}
type drpcPayoutClient struct {
type drpcPayoutsClient struct {
cc drpc.Conn
}
func NewDRPCPayoutClient(cc drpc.Conn) DRPCPayoutClient {
return &drpcPayoutClient{cc}
func NewDRPCPayoutsClient(cc drpc.Conn) DRPCPayoutsClient {
return &drpcPayoutsClient{cc}
}
func (c *drpcPayoutClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcPayoutsClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcPayoutClient) AllSatellitesSummary(ctx context.Context, in *AllSatellitesSummaryRequest) (*AllSatellitesSummaryResponse, error) {
out := new(AllSatellitesSummaryResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/AllSatellitesSummary", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) Summary(ctx context.Context, in *SummaryRequest) (*SummaryResponse, error) {
out := new(SummaryResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/Summary", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) AllSatellitesPeriodSummary(ctx context.Context, in *AllSatellitesPeriodSummaryRequest) (*AllSatellitesPeriodSummaryResponse, error) {
out := new(AllSatellitesPeriodSummaryResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/AllSatellitesPeriodSummary", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) SummaryPeriod(ctx context.Context, in *SummaryPeriodRequest) (*SummaryPeriodResponse, error) {
out := new(SummaryPeriodResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/SummaryPeriod", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) SatelliteSummary(ctx context.Context, in *SatelliteSummaryRequest) (*SatelliteSummaryResponse, error) {
out := new(SatelliteSummaryResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/SatelliteSummary", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) SummarySatellite(ctx context.Context, in *SummarySatelliteRequest) (*SummarySatelliteResponse, error) {
out := new(SummarySatelliteResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/SummarySatellite", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) SatellitePeriodSummary(ctx context.Context, in *SatellitePeriodSummaryRequest) (*SatellitePeriodSummaryResponse, error) {
out := new(SatellitePeriodSummaryResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/SatellitePeriodSummary", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) SummarySatellitePeriod(ctx context.Context, in *SummarySatellitePeriodRequest) (*SummarySatellitePeriodResponse, error) {
out := new(SummarySatellitePeriodResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/SummarySatellitePeriod", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) Earned(ctx context.Context, in *EarnedRequest) (*EarnedResponse, error) {
func (c *drpcPayoutsClient) Earned(ctx context.Context, in *EarnedRequest) (*EarnedResponse, error) {
out := new(EarnedResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/Earned", drpcEncoding_File_multinode_proto{}, in, out)
err := c.cc.Invoke(ctx, "/multinode.Payouts/Earned", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) EarnedPerSatellite(ctx context.Context, in *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error) {
out := new(EarnedPerSatelliteResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/EarnedPerSatellite", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) EarnedSatellite(ctx context.Context, in *EarnedSatelliteRequest) (*EarnedSatelliteResponse, error) {
out := new(EarnedSatelliteResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/EarnedSatellite", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) EstimatedPayoutSatellite(ctx context.Context, in *EstimatedPayoutSatelliteRequest) (*EstimatedPayoutSatelliteResponse, error) {
func (c *drpcPayoutsClient) EstimatedPayoutSatellite(ctx context.Context, in *EstimatedPayoutSatelliteRequest) (*EstimatedPayoutSatelliteResponse, error) {
out := new(EstimatedPayoutSatelliteResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/EstimatedPayoutSatellite", drpcEncoding_File_multinode_proto{}, in, out)
err := c.cc.Invoke(ctx, "/multinode.Payouts/EstimatedPayoutSatellite", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) EstimatedPayoutTotal(ctx context.Context, in *EstimatedPayoutTotalRequest) (*EstimatedPayoutTotalResponse, error) {
out := new(EstimatedPayoutTotalResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/EstimatedPayoutTotal", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) EstimatedPayout(ctx context.Context, in *EstimatedPayoutRequest) (*EstimatedPayoutResponse, error) {
out := new(EstimatedPayoutResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/EstimatedPayout", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) Undistributed(ctx context.Context, in *UndistributedRequest) (*UndistributedResponse, error) {
func (c *drpcPayoutsClient) Undistributed(ctx context.Context, in *UndistributedRequest) (*UndistributedResponse, error) {
out := new(UndistributedResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/Undistributed", drpcEncoding_File_multinode_proto{}, in, out)
err := c.cc.Invoke(ctx, "/multinode.Payouts/Undistributed", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) SatellitePaystub(ctx context.Context, in *SatellitePaystubRequest) (*SatellitePaystubResponse, error) {
out := new(SatellitePaystubResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/SatellitePaystub", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) PaystubSatellite(ctx context.Context, in *PaystubSatelliteRequest) (*PaystubSatelliteResponse, error) {
out := new(PaystubSatelliteResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/PaystubSatellite", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) Paystub(ctx context.Context, in *PaystubRequest) (*PaystubResponse, error) {
func (c *drpcPayoutsClient) Paystub(ctx context.Context, in *PaystubRequest) (*PaystubResponse, error) {
out := new(PaystubResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/Paystub", drpcEncoding_File_multinode_proto{}, in, out)
err := c.cc.Invoke(ctx, "/multinode.Payouts/Paystub", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) PeriodPaystub(ctx context.Context, in *PeriodPaystubRequest) (*PeriodPaystubResponse, error) {
out := new(PeriodPaystubResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/PeriodPaystub", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) PaystubPeriod(ctx context.Context, in *PaystubPeriodRequest) (*PaystubPeriodResponse, error) {
out := new(PaystubPeriodResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/PaystubPeriod", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) SatellitePeriodPaystub(ctx context.Context, in *SatellitePeriodPaystubRequest) (*SatellitePeriodPaystubResponse, error) {
out := new(SatellitePeriodPaystubResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/SatellitePeriodPaystub", drpcEncoding_File_multinode_proto{}, in, out)
func (c *drpcPayoutsClient) PaystubSatellitePeriod(ctx context.Context, in *PaystubSatellitePeriodRequest) (*PaystubSatellitePeriodResponse, error) {
out := new(PaystubSatellitePeriodResponse)
err := c.cc.Invoke(ctx, "/multinode.Payouts/PaystubSatellitePeriod", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) HeldAmountHistory(ctx context.Context, in *HeldAmountHistoryRequest) (*HeldAmountHistoryResponse, error) {
func (c *drpcPayoutsClient) HeldAmountHistory(ctx context.Context, in *HeldAmountHistoryRequest) (*HeldAmountHistoryResponse, error) {
out := new(HeldAmountHistoryResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/HeldAmountHistory", drpcEncoding_File_multinode_proto{}, in, out)
err := c.cc.Invoke(ctx, "/multinode.Payouts/HeldAmountHistory", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCPayoutServer interface {
AllSatellitesSummary(context.Context, *AllSatellitesSummaryRequest) (*AllSatellitesSummaryResponse, error)
AllSatellitesPeriodSummary(context.Context, *AllSatellitesPeriodSummaryRequest) (*AllSatellitesPeriodSummaryResponse, error)
SatelliteSummary(context.Context, *SatelliteSummaryRequest) (*SatelliteSummaryResponse, error)
SatellitePeriodSummary(context.Context, *SatellitePeriodSummaryRequest) (*SatellitePeriodSummaryResponse, error)
type DRPCPayoutsServer interface {
Summary(context.Context, *SummaryRequest) (*SummaryResponse, error)
SummaryPeriod(context.Context, *SummaryPeriodRequest) (*SummaryPeriodResponse, error)
SummarySatellite(context.Context, *SummarySatelliteRequest) (*SummarySatelliteResponse, error)
SummarySatellitePeriod(context.Context, *SummarySatellitePeriodRequest) (*SummarySatellitePeriodResponse, error)
Earned(context.Context, *EarnedRequest) (*EarnedResponse, error)
EarnedPerSatellite(context.Context, *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error)
EarnedSatellite(context.Context, *EarnedSatelliteRequest) (*EarnedSatelliteResponse, error)
EstimatedPayoutSatellite(context.Context, *EstimatedPayoutSatelliteRequest) (*EstimatedPayoutSatelliteResponse, error)
EstimatedPayoutTotal(context.Context, *EstimatedPayoutTotalRequest) (*EstimatedPayoutTotalResponse, error)
EstimatedPayout(context.Context, *EstimatedPayoutRequest) (*EstimatedPayoutResponse, error)
Undistributed(context.Context, *UndistributedRequest) (*UndistributedResponse, error)
SatellitePaystub(context.Context, *SatellitePaystubRequest) (*SatellitePaystubResponse, error)
PaystubSatellite(context.Context, *PaystubSatelliteRequest) (*PaystubSatelliteResponse, error)
Paystub(context.Context, *PaystubRequest) (*PaystubResponse, error)
PeriodPaystub(context.Context, *PeriodPaystubRequest) (*PeriodPaystubResponse, error)
SatellitePeriodPaystub(context.Context, *SatellitePeriodPaystubRequest) (*SatellitePeriodPaystubResponse, error)
PaystubPeriod(context.Context, *PaystubPeriodRequest) (*PaystubPeriodResponse, error)
PaystubSatellitePeriod(context.Context, *PaystubSatellitePeriodRequest) (*PaystubSatellitePeriodResponse, error)
HeldAmountHistory(context.Context, *HeldAmountHistoryRequest) (*HeldAmountHistoryResponse, error)
}
type DRPCPayoutUnimplementedServer struct{}
type DRPCPayoutsUnimplementedServer struct{}
func (s *DRPCPayoutUnimplementedServer) AllSatellitesSummary(context.Context, *AllSatellitesSummaryRequest) (*AllSatellitesSummaryResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) Summary(context.Context, *SummaryRequest) (*SummaryResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) AllSatellitesPeriodSummary(context.Context, *AllSatellitesPeriodSummaryRequest) (*AllSatellitesPeriodSummaryResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) SummaryPeriod(context.Context, *SummaryPeriodRequest) (*SummaryPeriodResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) SatelliteSummary(context.Context, *SatelliteSummaryRequest) (*SatelliteSummaryResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) SummarySatellite(context.Context, *SummarySatelliteRequest) (*SummarySatelliteResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) SatellitePeriodSummary(context.Context, *SatellitePeriodSummaryRequest) (*SatellitePeriodSummaryResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) SummarySatellitePeriod(context.Context, *SummarySatellitePeriodRequest) (*SummarySatellitePeriodResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) Earned(context.Context, *EarnedRequest) (*EarnedResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) Earned(context.Context, *EarnedRequest) (*EarnedResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) EarnedPerSatellite(context.Context, *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) EarnedSatellite(context.Context, *EarnedSatelliteRequest) (*EarnedSatelliteResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) EstimatedPayoutSatellite(context.Context, *EstimatedPayoutSatelliteRequest) (*EstimatedPayoutSatelliteResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) EstimatedPayoutSatellite(context.Context, *EstimatedPayoutSatelliteRequest) (*EstimatedPayoutSatelliteResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) EstimatedPayoutTotal(context.Context, *EstimatedPayoutTotalRequest) (*EstimatedPayoutTotalResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) EstimatedPayout(context.Context, *EstimatedPayoutRequest) (*EstimatedPayoutResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) Undistributed(context.Context, *UndistributedRequest) (*UndistributedResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) Undistributed(context.Context, *UndistributedRequest) (*UndistributedResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) SatellitePaystub(context.Context, *SatellitePaystubRequest) (*SatellitePaystubResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) PaystubSatellite(context.Context, *PaystubSatelliteRequest) (*PaystubSatelliteResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) Paystub(context.Context, *PaystubRequest) (*PaystubResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) Paystub(context.Context, *PaystubRequest) (*PaystubResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) PeriodPaystub(context.Context, *PeriodPaystubRequest) (*PeriodPaystubResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) PaystubPeriod(context.Context, *PaystubPeriodRequest) (*PaystubPeriodResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) SatellitePeriodPaystub(context.Context, *SatellitePeriodPaystubRequest) (*SatellitePeriodPaystubResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) PaystubSatellitePeriod(context.Context, *PaystubSatellitePeriodRequest) (*PaystubSatellitePeriodResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) HeldAmountHistory(context.Context, *HeldAmountHistoryRequest) (*HeldAmountHistoryResponse, error) {
func (s *DRPCPayoutsUnimplementedServer) HeldAmountHistory(context.Context, *HeldAmountHistoryRequest) (*HeldAmountHistoryResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCPayoutDescription struct{}
type DRPCPayoutsDescription struct{}
func (DRPCPayoutDescription) NumMethods() int { return 14 }
func (DRPCPayoutsDescription) NumMethods() int { return 14 }
func (DRPCPayoutDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
func (DRPCPayoutsDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Payout/AllSatellitesSummary", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/Summary", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
AllSatellitesSummary(
return srv.(DRPCPayoutsServer).
Summary(
ctx,
in1.(*AllSatellitesSummaryRequest),
in1.(*SummaryRequest),
)
}, DRPCPayoutServer.AllSatellitesSummary, true
}, DRPCPayoutsServer.Summary, true
case 1:
return "/multinode.Payout/AllSatellitesPeriodSummary", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/SummaryPeriod", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
AllSatellitesPeriodSummary(
return srv.(DRPCPayoutsServer).
SummaryPeriod(
ctx,
in1.(*AllSatellitesPeriodSummaryRequest),
in1.(*SummaryPeriodRequest),
)
}, DRPCPayoutServer.AllSatellitesPeriodSummary, true
}, DRPCPayoutsServer.SummaryPeriod, true
case 2:
return "/multinode.Payout/SatelliteSummary", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/SummarySatellite", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
SatelliteSummary(
return srv.(DRPCPayoutsServer).
SummarySatellite(
ctx,
in1.(*SatelliteSummaryRequest),
in1.(*SummarySatelliteRequest),
)
}, DRPCPayoutServer.SatelliteSummary, true
}, DRPCPayoutsServer.SummarySatellite, true
case 3:
return "/multinode.Payout/SatellitePeriodSummary", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/SummarySatellitePeriod", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
SatellitePeriodSummary(
return srv.(DRPCPayoutsServer).
SummarySatellitePeriod(
ctx,
in1.(*SatellitePeriodSummaryRequest),
in1.(*SummarySatellitePeriodRequest),
)
}, DRPCPayoutServer.SatellitePeriodSummary, true
}, DRPCPayoutsServer.SummarySatellitePeriod, true
case 4:
return "/multinode.Payout/Earned", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/Earned", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
return srv.(DRPCPayoutsServer).
Earned(
ctx,
in1.(*EarnedRequest),
)
}, DRPCPayoutServer.Earned, true
}, DRPCPayoutsServer.Earned, true
case 5:
return "/multinode.Payout/EarnedPerSatellite", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/EarnedSatellite", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
EarnedPerSatellite(
return srv.(DRPCPayoutsServer).
EarnedSatellite(
ctx,
in1.(*EarnedPerSatelliteRequest),
in1.(*EarnedSatelliteRequest),
)
}, DRPCPayoutServer.EarnedPerSatellite, true
}, DRPCPayoutsServer.EarnedSatellite, true
case 6:
return "/multinode.Payout/EstimatedPayoutSatellite", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/EstimatedPayoutSatellite", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
return srv.(DRPCPayoutsServer).
EstimatedPayoutSatellite(
ctx,
in1.(*EstimatedPayoutSatelliteRequest),
)
}, DRPCPayoutServer.EstimatedPayoutSatellite, true
}, DRPCPayoutsServer.EstimatedPayoutSatellite, true
case 7:
return "/multinode.Payout/EstimatedPayoutTotal", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/EstimatedPayout", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
EstimatedPayoutTotal(
return srv.(DRPCPayoutsServer).
EstimatedPayout(
ctx,
in1.(*EstimatedPayoutTotalRequest),
in1.(*EstimatedPayoutRequest),
)
}, DRPCPayoutServer.EstimatedPayoutTotal, true
}, DRPCPayoutsServer.EstimatedPayout, true
case 8:
return "/multinode.Payout/Undistributed", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/Undistributed", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
return srv.(DRPCPayoutsServer).
Undistributed(
ctx,
in1.(*UndistributedRequest),
)
}, DRPCPayoutServer.Undistributed, true
}, DRPCPayoutsServer.Undistributed, true
case 9:
return "/multinode.Payout/SatellitePaystub", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/PaystubSatellite", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
SatellitePaystub(
return srv.(DRPCPayoutsServer).
PaystubSatellite(
ctx,
in1.(*SatellitePaystubRequest),
in1.(*PaystubSatelliteRequest),
)
}, DRPCPayoutServer.SatellitePaystub, true
}, DRPCPayoutsServer.PaystubSatellite, true
case 10:
return "/multinode.Payout/Paystub", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/Paystub", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
return srv.(DRPCPayoutsServer).
Paystub(
ctx,
in1.(*PaystubRequest),
)
}, DRPCPayoutServer.Paystub, true
}, DRPCPayoutsServer.Paystub, true
case 11:
return "/multinode.Payout/PeriodPaystub", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/PaystubPeriod", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
PeriodPaystub(
return srv.(DRPCPayoutsServer).
PaystubPeriod(
ctx,
in1.(*PeriodPaystubRequest),
in1.(*PaystubPeriodRequest),
)
}, DRPCPayoutServer.PeriodPaystub, true
}, DRPCPayoutsServer.PaystubPeriod, true
case 12:
return "/multinode.Payout/SatellitePeriodPaystub", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/PaystubSatellitePeriod", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
SatellitePeriodPaystub(
return srv.(DRPCPayoutsServer).
PaystubSatellitePeriod(
ctx,
in1.(*SatellitePeriodPaystubRequest),
in1.(*PaystubSatellitePeriodRequest),
)
}, DRPCPayoutServer.SatellitePeriodPaystub, true
}, DRPCPayoutsServer.PaystubSatellitePeriod, true
case 13:
return "/multinode.Payout/HeldAmountHistory", drpcEncoding_File_multinode_proto{},
return "/multinode.Payouts/HeldAmountHistory", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
return srv.(DRPCPayoutsServer).
HeldAmountHistory(
ctx,
in1.(*HeldAmountHistoryRequest),
)
}, DRPCPayoutServer.HeldAmountHistory, true
}, DRPCPayoutsServer.HeldAmountHistory, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterPayout(mux drpc.Mux, impl DRPCPayoutServer) error {
return mux.Register(impl, DRPCPayoutDescription{})
func DRPCRegisterPayouts(mux drpc.Mux, impl DRPCPayoutsServer) error {
return mux.Register(impl, DRPCPayoutsDescription{})
}
type DRPCPayout_AllSatellitesSummaryStream interface {
type DRPCPayouts_SummaryStream interface {
drpc.Stream
SendAndClose(*AllSatellitesSummaryResponse) error
SendAndClose(*SummaryResponse) error
}
type drpcPayout_AllSatellitesSummaryStream struct {
type drpcPayouts_SummaryStream struct {
drpc.Stream
}
func (x *drpcPayout_AllSatellitesSummaryStream) SendAndClose(m *AllSatellitesSummaryResponse) error {
func (x *drpcPayouts_SummaryStream) SendAndClose(m *SummaryResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_AllSatellitesPeriodSummaryStream interface {
type DRPCPayouts_SummaryPeriodStream interface {
drpc.Stream
SendAndClose(*AllSatellitesPeriodSummaryResponse) error
SendAndClose(*SummaryPeriodResponse) error
}
type drpcPayout_AllSatellitesPeriodSummaryStream struct {
type drpcPayouts_SummaryPeriodStream struct {
drpc.Stream
}
func (x *drpcPayout_AllSatellitesPeriodSummaryStream) SendAndClose(m *AllSatellitesPeriodSummaryResponse) error {
func (x *drpcPayouts_SummaryPeriodStream) SendAndClose(m *SummaryPeriodResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_SatelliteSummaryStream interface {
type DRPCPayouts_SummarySatelliteStream interface {
drpc.Stream
SendAndClose(*SatelliteSummaryResponse) error
SendAndClose(*SummarySatelliteResponse) error
}
type drpcPayout_SatelliteSummaryStream struct {
type drpcPayouts_SummarySatelliteStream struct {
drpc.Stream
}
func (x *drpcPayout_SatelliteSummaryStream) SendAndClose(m *SatelliteSummaryResponse) error {
func (x *drpcPayouts_SummarySatelliteStream) SendAndClose(m *SummarySatelliteResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_SatellitePeriodSummaryStream interface {
type DRPCPayouts_SummarySatellitePeriodStream interface {
drpc.Stream
SendAndClose(*SatellitePeriodSummaryResponse) error
SendAndClose(*SummarySatellitePeriodResponse) error
}
type drpcPayout_SatellitePeriodSummaryStream struct {
type drpcPayouts_SummarySatellitePeriodStream struct {
drpc.Stream
}
func (x *drpcPayout_SatellitePeriodSummaryStream) SendAndClose(m *SatellitePeriodSummaryResponse) error {
func (x *drpcPayouts_SummarySatellitePeriodStream) SendAndClose(m *SummarySatellitePeriodResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_EarnedStream interface {
type DRPCPayouts_EarnedStream interface {
drpc.Stream
SendAndClose(*EarnedResponse) error
}
type drpcPayout_EarnedStream struct {
type drpcPayouts_EarnedStream struct {
drpc.Stream
}
func (x *drpcPayout_EarnedStream) SendAndClose(m *EarnedResponse) error {
func (x *drpcPayouts_EarnedStream) SendAndClose(m *EarnedResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_EarnedPerSatelliteStream interface {
type DRPCPayouts_EarnedSatelliteStream interface {
drpc.Stream
SendAndClose(*EarnedPerSatelliteResponse) error
SendAndClose(*EarnedSatelliteResponse) error
}
type drpcPayout_EarnedPerSatelliteStream struct {
type drpcPayouts_EarnedSatelliteStream struct {
drpc.Stream
}
func (x *drpcPayout_EarnedPerSatelliteStream) SendAndClose(m *EarnedPerSatelliteResponse) error {
func (x *drpcPayouts_EarnedSatelliteStream) SendAndClose(m *EarnedSatelliteResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_EstimatedPayoutSatelliteStream interface {
type DRPCPayouts_EstimatedPayoutSatelliteStream interface {
drpc.Stream
SendAndClose(*EstimatedPayoutSatelliteResponse) error
}
type drpcPayout_EstimatedPayoutSatelliteStream struct {
type drpcPayouts_EstimatedPayoutSatelliteStream struct {
drpc.Stream
}
func (x *drpcPayout_EstimatedPayoutSatelliteStream) SendAndClose(m *EstimatedPayoutSatelliteResponse) error {
func (x *drpcPayouts_EstimatedPayoutSatelliteStream) SendAndClose(m *EstimatedPayoutSatelliteResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_EstimatedPayoutTotalStream interface {
type DRPCPayouts_EstimatedPayoutStream interface {
drpc.Stream
SendAndClose(*EstimatedPayoutTotalResponse) error
SendAndClose(*EstimatedPayoutResponse) error
}
type drpcPayout_EstimatedPayoutTotalStream struct {
type drpcPayouts_EstimatedPayoutStream struct {
drpc.Stream
}
func (x *drpcPayout_EstimatedPayoutTotalStream) SendAndClose(m *EstimatedPayoutTotalResponse) error {
func (x *drpcPayouts_EstimatedPayoutStream) SendAndClose(m *EstimatedPayoutResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_UndistributedStream interface {
type DRPCPayouts_UndistributedStream interface {
drpc.Stream
SendAndClose(*UndistributedResponse) error
}
type drpcPayout_UndistributedStream struct {
type drpcPayouts_UndistributedStream struct {
drpc.Stream
}
func (x *drpcPayout_UndistributedStream) SendAndClose(m *UndistributedResponse) error {
func (x *drpcPayouts_UndistributedStream) SendAndClose(m *UndistributedResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_SatellitePaystubStream interface {
type DRPCPayouts_PaystubSatelliteStream interface {
drpc.Stream
SendAndClose(*SatellitePaystubResponse) error
SendAndClose(*PaystubSatelliteResponse) error
}
type drpcPayout_SatellitePaystubStream struct {
type drpcPayouts_PaystubSatelliteStream struct {
drpc.Stream
}
func (x *drpcPayout_SatellitePaystubStream) SendAndClose(m *SatellitePaystubResponse) error {
func (x *drpcPayouts_PaystubSatelliteStream) SendAndClose(m *PaystubSatelliteResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_PaystubStream interface {
type DRPCPayouts_PaystubStream interface {
drpc.Stream
SendAndClose(*PaystubResponse) error
}
type drpcPayout_PaystubStream struct {
type drpcPayouts_PaystubStream struct {
drpc.Stream
}
func (x *drpcPayout_PaystubStream) SendAndClose(m *PaystubResponse) error {
func (x *drpcPayouts_PaystubStream) SendAndClose(m *PaystubResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_PeriodPaystubStream interface {
type DRPCPayouts_PaystubPeriodStream interface {
drpc.Stream
SendAndClose(*PeriodPaystubResponse) error
SendAndClose(*PaystubPeriodResponse) error
}
type drpcPayout_PeriodPaystubStream struct {
type drpcPayouts_PaystubPeriodStream struct {
drpc.Stream
}
func (x *drpcPayout_PeriodPaystubStream) SendAndClose(m *PeriodPaystubResponse) error {
func (x *drpcPayouts_PaystubPeriodStream) SendAndClose(m *PaystubPeriodResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_SatellitePeriodPaystubStream interface {
type DRPCPayouts_PaystubSatellitePeriodStream interface {
drpc.Stream
SendAndClose(*SatellitePeriodPaystubResponse) error
SendAndClose(*PaystubSatellitePeriodResponse) error
}
type drpcPayout_SatellitePeriodPaystubStream struct {
type drpcPayouts_PaystubSatellitePeriodStream struct {
drpc.Stream
}
func (x *drpcPayout_SatellitePeriodPaystubStream) SendAndClose(m *SatellitePeriodPaystubResponse) error {
func (x *drpcPayouts_PaystubSatellitePeriodStream) SendAndClose(m *PaystubSatellitePeriodResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_HeldAmountHistoryStream interface {
type DRPCPayouts_HeldAmountHistoryStream interface {
drpc.Stream
SendAndClose(*HeldAmountHistoryResponse) error
}
type drpcPayout_HeldAmountHistoryStream struct {
type drpcPayouts_HeldAmountHistoryStream struct {
drpc.Stream
}
func (x *drpcPayout_HeldAmountHistoryStream) SendAndClose(m *HeldAmountHistoryResponse) error {
func (x *drpcPayouts_HeldAmountHistoryStream) SendAndClose(m *HeldAmountHistoryResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}

View File

@ -480,6 +480,10 @@
{
"name": "java_outer_classname",
"value": "GoGoProtos"
},
{
"name": "go_package",
"value": "storj.io/storj/private/multinodepb"
}
]
}
@ -728,6 +732,181 @@
}
]
},
{
"name": "EstimatedPayoutSatelliteRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
},
{
"id": 2,
"name": "satellite_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
}
]
},
{
"name": "EstimatedPayoutSatelliteResponse",
"fields": [
{
"id": 1,
"name": "estimated_earnings",
"type": "int64"
}
]
},
{
"name": "EstimatedPayoutRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
}
]
},
{
"name": "EstimatedPayoutResponse",
"fields": [
{
"id": 1,
"name": "estimated_earnings",
"type": "int64"
}
]
},
{
"name": "SummaryRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
}
]
},
{
"name": "SummaryResponse",
"fields": [
{
"id": 1,
"name": "payout_info",
"type": "PayoutInfo"
}
]
},
{
"name": "SummaryPeriodRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
},
{
"id": 2,
"name": "period",
"type": "string"
}
]
},
{
"name": "SummaryPeriodResponse",
"fields": [
{
"id": 1,
"name": "payout_info",
"type": "PayoutInfo"
}
]
},
{
"name": "SummarySatelliteRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
},
{
"id": 2,
"name": "satellite_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
}
]
},
{
"name": "SummarySatelliteResponse",
"fields": [
{
"id": 1,
"name": "payout_info",
"type": "PayoutInfo"
}
]
},
{
"name": "SummarySatellitePeriodRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
},
{
"id": 2,
"name": "satellite_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
},
{
"id": 3,
"name": "period",
"type": "string"
}
]
},
{
"name": "SummarySatellitePeriodResponse",
"fields": [
{
"id": 1,
"name": "payout_info",
"type": "PayoutInfo"
}
]
},
{
"name": "EarnedRequest",
"fields": [
@ -749,7 +928,7 @@
]
},
{
"name": "EarnedPerSatelliteRequest",
"name": "EarnedSatelliteRequest",
"fields": [
{
"id": 1,
@ -759,7 +938,7 @@
]
},
{
"name": "EarnedPerSatelliteResponse",
"name": "EarnedSatelliteResponse",
"fields": [
{
"id": 1,
@ -793,6 +972,285 @@
]
}
]
},
{
"name": "UndistributedRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
}
]
},
{
"name": "UndistributedResponse",
"fields": [
{
"id": 1,
"name": "total",
"type": "int64"
}
]
},
{
"name": "PaystubSatelliteRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
},
{
"id": 2,
"name": "satellite_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
}
]
},
{
"name": "PaystubSatelliteResponse",
"fields": [
{
"id": 1,
"name": "paystub",
"type": "Paystub"
}
]
},
{
"name": "PaystubRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
}
]
},
{
"name": "PaystubResponse",
"fields": [
{
"id": 1,
"name": "paystub",
"type": "Paystub"
}
]
},
{
"name": "PaystubPeriodRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
},
{
"id": 2,
"name": "period",
"type": "string"
}
]
},
{
"name": "PaystubPeriodResponse",
"fields": [
{
"id": 1,
"name": "paystub",
"type": "Paystub"
}
]
},
{
"name": "PaystubSatellitePeriodRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
},
{
"id": 2,
"name": "satellite_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
},
{
"id": 3,
"name": "period",
"type": "string"
}
]
},
{
"name": "PaystubSatellitePeriodResponse",
"fields": [
{
"id": 1,
"name": "paystub",
"type": "Paystub"
}
]
},
{
"name": "PayoutInfo",
"fields": [
{
"id": 1,
"name": "held",
"type": "int64"
},
{
"id": 2,
"name": "paid",
"type": "int64"
}
]
},
{
"name": "Paystub",
"fields": [
{
"id": 5,
"name": "usage_at_rest",
"type": "double"
},
{
"id": 6,
"name": "usage_get",
"type": "int64"
},
{
"id": 8,
"name": "usage_get_repair",
"type": "int64"
},
{
"id": 10,
"name": "usage_get_audit",
"type": "int64"
},
{
"id": 11,
"name": "comp_at_rest",
"type": "int64"
},
{
"id": 12,
"name": "comp_get",
"type": "int64"
},
{
"id": 14,
"name": "comp_get_repair",
"type": "int64"
},
{
"id": 16,
"name": "comp_get_audit",
"type": "int64"
},
{
"id": 18,
"name": "held",
"type": "int64"
},
{
"id": 21,
"name": "paid",
"type": "int64"
},
{
"id": 22,
"name": "distributed",
"type": "int64"
}
]
},
{
"name": "HeldAmountHistoryRequest",
"fields": [
{
"id": 1,
"name": "header",
"type": "RequestHeader"
}
]
},
{
"name": "HeldAmountHistoryResponse",
"fields": [
{
"id": 1,
"name": "history",
"type": "HeldAmountHistory",
"is_repeated": true
}
],
"messages": [
{
"name": "HeldAmount",
"fields": [
{
"id": 1,
"name": "period",
"type": "string"
},
{
"id": 2,
"name": "amount",
"type": "int64"
}
]
},
{
"name": "HeldAmountHistory",
"fields": [
{
"id": 1,
"name": "satellite_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
},
{
"id": 2,
"name": "held_amounts",
"type": "HeldAmount",
"is_repeated": true
}
]
}
]
}
],
"services": [
@ -842,17 +1300,77 @@
]
},
{
"name": "Payout",
"name": "Payouts",
"rpcs": [
{
"name": "Summary",
"in_type": "SummaryRequest",
"out_type": "SummaryResponse"
},
{
"name": "SummaryPeriod",
"in_type": "SummaryPeriodRequest",
"out_type": "SummaryPeriodResponse"
},
{
"name": "SummarySatellite",
"in_type": "SummarySatelliteRequest",
"out_type": "SummarySatelliteResponse"
},
{
"name": "SummarySatellitePeriod",
"in_type": "SummarySatellitePeriodRequest",
"out_type": "SummarySatellitePeriodResponse"
},
{
"name": "Earned",
"in_type": "EarnedRequest",
"out_type": "EarnedResponse"
},
{
"name": "EarnedPerSatellite",
"in_type": "EarnedPerSatelliteRequest",
"out_type": "EarnedPerSatelliteResponse"
"name": "EarnedSatellite",
"in_type": "EarnedSatelliteRequest",
"out_type": "EarnedSatelliteResponse"
},
{
"name": "EstimatedPayoutSatellite",
"in_type": "EstimatedPayoutSatelliteRequest",
"out_type": "EstimatedPayoutSatelliteResponse"
},
{
"name": "EstimatedPayout",
"in_type": "EstimatedPayoutRequest",
"out_type": "EstimatedPayoutResponse"
},
{
"name": "Undistributed",
"in_type": "UndistributedRequest",
"out_type": "UndistributedResponse"
},
{
"name": "PaystubSatellite",
"in_type": "PaystubSatelliteRequest",
"out_type": "PaystubSatelliteResponse"
},
{
"name": "Paystub",
"in_type": "PaystubRequest",
"out_type": "PaystubResponse"
},
{
"name": "PaystubPeriod",
"in_type": "PaystubPeriodRequest",
"out_type": "PaystubPeriodResponse"
},
{
"name": "PaystubSatellitePeriod",
"in_type": "PaystubSatellitePeriodRequest",
"out_type": "PaystubSatellitePeriodResponse"
},
{
"name": "HeldAmountHistory",
"in_type": "HeldAmountHistoryRequest",
"out_type": "HeldAmountHistoryResponse"
}
]
}

View File

@ -16,13 +16,13 @@ import (
"storj.io/storj/storagenode/payouts/estimatedpayouts"
)
var _ multinodepb.DRPCPayoutServer = (*PayoutEndpoint)(nil)
var _ multinodepb.DRPCPayoutsServer = (*PayoutEndpoint)(nil)
// PayoutEndpoint implements multinode payouts endpoint.
//
// architecture: Endpoint
type PayoutEndpoint struct {
multinodepb.DRPCPayoutUnimplementedServer
multinodepb.DRPCPayoutsUnimplementedServer
log *zap.Logger
apiKeys *apikeys.Service
@ -60,15 +60,15 @@ func (payout *PayoutEndpoint) Earned(ctx context.Context, req *multinodepb.Earne
}, nil
}
// EarnedPerSatellite returns total earned amount per satellite.
func (payout *PayoutEndpoint) EarnedPerSatellite(ctx context.Context, req *multinodepb.EarnedPerSatelliteRequest) (_ *multinodepb.EarnedPerSatelliteResponse, err error) {
// EarnedSatellite returns total earned amount per satellite.
func (payout *PayoutEndpoint) EarnedSatellite(ctx context.Context, req *multinodepb.EarnedSatelliteRequest) (_ *multinodepb.EarnedSatelliteResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
return nil, rpcstatus.Wrap(rpcstatus.Unauthenticated, err)
}
var resp multinodepb.EarnedPerSatelliteResponse
var resp multinodepb.EarnedSatelliteResponse
satelliteIDs, err := payout.db.GetPayingSatellitesIDs(ctx)
if err != nil {
return nil, rpcstatus.Wrap(rpcstatus.Internal, err)
@ -89,8 +89,8 @@ func (payout *PayoutEndpoint) EarnedPerSatellite(ctx context.Context, req *multi
return &resp, nil
}
// EstimatedPayoutTotal returns estimated earnings for current month from all satellites.
func (payout *PayoutEndpoint) EstimatedPayoutTotal(ctx context.Context, req *multinodepb.EstimatedPayoutTotalRequest) (_ *multinodepb.EstimatedPayoutTotalResponse, err error) {
// EstimatedPayout returns estimated earnings for current month from all satellites.
func (payout *PayoutEndpoint) EstimatedPayout(ctx context.Context, req *multinodepb.EstimatedPayoutRequest) (_ *multinodepb.EstimatedPayoutResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
@ -99,10 +99,10 @@ func (payout *PayoutEndpoint) EstimatedPayoutTotal(ctx context.Context, req *mul
estimated, err := payout.estimatedPayouts.GetAllSatellitesEstimatedPayout(ctx, time.Now())
if err != nil {
return &multinodepb.EstimatedPayoutTotalResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
return &multinodepb.EstimatedPayoutResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
}
return &multinodepb.EstimatedPayoutTotalResponse{EstimatedEarnings: estimated.CurrentMonthExpectations}, nil
return &multinodepb.EstimatedPayoutResponse{EstimatedEarnings: estimated.CurrentMonthExpectations}, nil
}
// EstimatedPayoutSatellite returns estimated earnings for current month from specific satellite.
@ -121,8 +121,8 @@ func (payout *PayoutEndpoint) EstimatedPayoutSatellite(ctx context.Context, req
return &multinodepb.EstimatedPayoutSatelliteResponse{EstimatedEarnings: estimated.CurrentMonthExpectations}, nil
}
// AllSatellitesSummary returns all satellites all time payout summary.
func (payout *PayoutEndpoint) AllSatellitesSummary(ctx context.Context, req *multinodepb.AllSatellitesSummaryRequest) (_ *multinodepb.AllSatellitesSummaryResponse, err error) {
// Summary returns all satellites all time payout summary.
func (payout *PayoutEndpoint) Summary(ctx context.Context, req *multinodepb.SummaryRequest) (_ *multinodepb.SummaryResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
@ -132,24 +132,24 @@ func (payout *PayoutEndpoint) AllSatellitesSummary(ctx context.Context, req *mul
var totalPaid, totalHeld int64
satelliteIDs, err := payout.db.GetPayingSatellitesIDs(ctx)
if err != nil {
return &multinodepb.AllSatellitesSummaryResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
return &multinodepb.SummaryResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
}
for _, id := range satelliteIDs {
paid, held, err := payout.db.GetSatelliteSummary(ctx, id)
if err != nil {
return &multinodepb.AllSatellitesSummaryResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
return &multinodepb.SummaryResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
}
totalHeld += held
totalPaid += paid
}
return &multinodepb.AllSatellitesSummaryResponse{PayoutInfo: &multinodepb.PayoutInfo{Paid: totalPaid, Held: totalHeld}}, nil
return &multinodepb.SummaryResponse{PayoutInfo: &multinodepb.PayoutInfo{Paid: totalPaid, Held: totalHeld}}, nil
}
// AllSatellitesPeriodSummary returns all satellites period payout summary.
func (payout *PayoutEndpoint) AllSatellitesPeriodSummary(ctx context.Context, req *multinodepb.AllSatellitesPeriodSummaryRequest) (_ *multinodepb.AllSatellitesPeriodSummaryResponse, err error) {
// SummaryPeriod returns all satellites period payout summary.
func (payout *PayoutEndpoint) SummaryPeriod(ctx context.Context, req *multinodepb.SummaryPeriodRequest) (_ *multinodepb.SummaryPeriodResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
@ -159,24 +159,24 @@ func (payout *PayoutEndpoint) AllSatellitesPeriodSummary(ctx context.Context, re
var totalPaid, totalHeld int64
satelliteIDs, err := payout.db.GetPayingSatellitesIDs(ctx)
if err != nil {
return &multinodepb.AllSatellitesPeriodSummaryResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
return &multinodepb.SummaryPeriodResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
}
for _, id := range satelliteIDs {
paid, held, err := payout.db.GetSatellitePeriodSummary(ctx, id, req.Period)
if err != nil {
return &multinodepb.AllSatellitesPeriodSummaryResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
return &multinodepb.SummaryPeriodResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
}
totalHeld += held
totalPaid += paid
}
return &multinodepb.AllSatellitesPeriodSummaryResponse{PayoutInfo: &multinodepb.PayoutInfo{Held: totalHeld, Paid: totalPaid}}, nil
return &multinodepb.SummaryPeriodResponse{PayoutInfo: &multinodepb.PayoutInfo{Held: totalHeld, Paid: totalPaid}}, nil
}
// SatelliteSummary returns satellite all time payout summary.
func (payout *PayoutEndpoint) SatelliteSummary(ctx context.Context, req *multinodepb.SatelliteSummaryRequest) (_ *multinodepb.SatelliteSummaryResponse, err error) {
// SummarySatellite returns satellite all time payout summary.
func (payout *PayoutEndpoint) SummarySatellite(ctx context.Context, req *multinodepb.SummarySatelliteRequest) (_ *multinodepb.SummarySatelliteResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
@ -187,14 +187,14 @@ func (payout *PayoutEndpoint) SatelliteSummary(ctx context.Context, req *multino
totalPaid, totalHeld, err = payout.db.GetSatelliteSummary(ctx, req.SatelliteId)
if err != nil {
return &multinodepb.SatelliteSummaryResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
return &multinodepb.SummarySatelliteResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
}
return &multinodepb.SatelliteSummaryResponse{PayoutInfo: &multinodepb.PayoutInfo{Held: totalHeld, Paid: totalPaid}}, nil
return &multinodepb.SummarySatelliteResponse{PayoutInfo: &multinodepb.PayoutInfo{Held: totalHeld, Paid: totalPaid}}, nil
}
// SatellitePeriodSummary returns satellite period payout summary.
func (payout *PayoutEndpoint) SatellitePeriodSummary(ctx context.Context, req *multinodepb.SatellitePeriodSummaryRequest) (_ *multinodepb.SatellitePeriodSummaryResponse, err error) {
// SummarySatellitePeriod returns satellite period payout summary.
func (payout *PayoutEndpoint) SummarySatellitePeriod(ctx context.Context, req *multinodepb.SummarySatellitePeriodRequest) (_ *multinodepb.SummarySatellitePeriodResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
@ -205,10 +205,10 @@ func (payout *PayoutEndpoint) SatellitePeriodSummary(ctx context.Context, req *m
totalPaid, totalHeld, err = payout.db.GetSatellitePeriodSummary(ctx, req.SatelliteId, req.Period)
if err != nil {
return &multinodepb.SatellitePeriodSummaryResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
return &multinodepb.SummarySatellitePeriodResponse{}, rpcstatus.Wrap(rpcstatus.Internal, err)
}
return &multinodepb.SatellitePeriodSummaryResponse{PayoutInfo: &multinodepb.PayoutInfo{Held: totalHeld, Paid: totalPaid}}, nil
return &multinodepb.SummarySatellitePeriodResponse{PayoutInfo: &multinodepb.PayoutInfo{Held: totalHeld, Paid: totalPaid}}, nil
}
// Undistributed returns total undistributed amount.
@ -227,8 +227,8 @@ func (payout *PayoutEndpoint) Undistributed(ctx context.Context, req *multinodep
return &multinodepb.UndistributedResponse{Total: earned}, nil
}
// SatellitePaystub returns summed amounts of all values from paystubs from all satellites.
func (payout *PayoutEndpoint) SatellitePaystub(ctx context.Context, req *multinodepb.SatellitePaystubRequest) (_ *multinodepb.SatellitePaystubResponse, err error) {
// PaystubSatellite returns summed amounts of all values from paystubs from all satellites.
func (payout *PayoutEndpoint) PaystubSatellite(ctx context.Context, req *multinodepb.PaystubSatelliteRequest) (_ *multinodepb.PaystubSatelliteResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
@ -240,7 +240,7 @@ func (payout *PayoutEndpoint) SatellitePaystub(ctx context.Context, req *multino
return nil, rpcstatus.Wrap(rpcstatus.Internal, err)
}
return &multinodepb.SatellitePaystubResponse{Paystub: &multinodepb.Paystub{
return &multinodepb.PaystubSatelliteResponse{Paystub: &multinodepb.Paystub{
UsageAtRest: paystub.UsageAtRest,
UsageGet: paystub.UsageGet,
UsageGetRepair: paystub.UsageGetRepair,
@ -283,8 +283,8 @@ func (payout *PayoutEndpoint) Paystub(ctx context.Context, req *multinodepb.Pays
}}, nil
}
// PeriodPaystub returns summed amounts of all values from paystubs from all satellites for specific period.
func (payout *PayoutEndpoint) PeriodPaystub(ctx context.Context, req *multinodepb.PeriodPaystubRequest) (_ *multinodepb.PeriodPaystubResponse, err error) {
// PaystubPeriod returns summed amounts of all values from paystubs from all satellites for specific period.
func (payout *PayoutEndpoint) PaystubPeriod(ctx context.Context, req *multinodepb.PaystubPeriodRequest) (_ *multinodepb.PaystubPeriodResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
@ -296,7 +296,7 @@ func (payout *PayoutEndpoint) PeriodPaystub(ctx context.Context, req *multinodep
return nil, rpcstatus.Wrap(rpcstatus.Internal, err)
}
return &multinodepb.PeriodPaystubResponse{Paystub: &multinodepb.Paystub{
return &multinodepb.PaystubPeriodResponse{Paystub: &multinodepb.Paystub{
UsageAtRest: paystub.UsageAtRest,
UsageGet: paystub.UsageGet,
UsageGetRepair: paystub.UsageGetRepair,
@ -311,8 +311,8 @@ func (payout *PayoutEndpoint) PeriodPaystub(ctx context.Context, req *multinodep
}}, nil
}
// SatellitePeriodPaystub returns summed amounts of all values from paystubs from all satellites for specific period.
func (payout *PayoutEndpoint) SatellitePeriodPaystub(ctx context.Context, req *multinodepb.SatellitePeriodPaystubRequest) (_ *multinodepb.SatellitePeriodPaystubResponse, err error) {
// PaystubPeriodSatellite returns summed amounts of all values from paystubs from all satellites for specific period.
func (payout *PayoutEndpoint) PaystubPeriodSatellite(ctx context.Context, req *multinodepb.PaystubSatellitePeriodRequest) (_ *multinodepb.PaystubSatellitePeriodResponse, err error) {
defer mon.Task()(&ctx)(&err)
if err = authenticate(ctx, payout.apiKeys, req.GetHeader()); err != nil {
@ -324,7 +324,7 @@ func (payout *PayoutEndpoint) SatellitePeriodPaystub(ctx context.Context, req *m
return nil, rpcstatus.Wrap(rpcstatus.Internal, err)
}
return &multinodepb.SatellitePeriodPaystubResponse{Paystub: &multinodepb.Paystub{
return &multinodepb.PaystubSatellitePeriodResponse{Paystub: &multinodepb.Paystub{
UsageAtRest: paystub.UsageAtRest,
UsageGet: paystub.UsageGet,
UsageGetRepair: paystub.UsageGetRepair,

View File

@ -97,7 +97,7 @@ func TestPayoutsEndpointSummary(t *testing.T) {
key, err := service.Issue(ctx)
require.NoError(t, err)
response, err := endpoint.AllSatellitesPeriodSummary(ctx, &multinodepb.AllSatellitesPeriodSummaryRequest{
response, err := endpoint.SummaryPeriod(ctx, &multinodepb.SummaryPeriodRequest{
Header: &multinodepb.RequestHeader{
ApiKey: key.Secret[:],
}, Period: "2020-10",
@ -106,7 +106,7 @@ func TestPayoutsEndpointSummary(t *testing.T) {
require.Equal(t, response.PayoutInfo.Paid, amount)
require.Equal(t, response.PayoutInfo.Held, amount)
response2, err := endpoint.AllSatellitesSummary(ctx, &multinodepb.AllSatellitesSummaryRequest{
response2, err := endpoint.Summary(ctx, &multinodepb.SummaryRequest{
Header: &multinodepb.RequestHeader{
ApiKey: key.Secret[:],
},
@ -115,7 +115,7 @@ func TestPayoutsEndpointSummary(t *testing.T) {
require.Equal(t, response2.PayoutInfo.Paid, amount+amount2)
require.Equal(t, response2.PayoutInfo.Held, amount+amount2)
response3, err := endpoint.SatellitePeriodSummary(ctx, &multinodepb.SatellitePeriodSummaryRequest{
response3, err := endpoint.SummarySatellitePeriod(ctx, &multinodepb.SummarySatellitePeriodRequest{
Header: &multinodepb.RequestHeader{
ApiKey: key.Secret[:],
}, SatelliteId: id2, Period: "2020-11",
@ -124,7 +124,7 @@ func TestPayoutsEndpointSummary(t *testing.T) {
require.Equal(t, response3.PayoutInfo.Paid, amount2)
require.Equal(t, response3.PayoutInfo.Held, amount2)
response4, err := endpoint.SatelliteSummary(ctx, &multinodepb.SatelliteSummaryRequest{
response4, err := endpoint.SummarySatellite(ctx, &multinodepb.SummarySatelliteRequest{
Header: &multinodepb.RequestHeader{
ApiKey: key.Secret[:],
}, SatelliteId: id,
@ -199,7 +199,7 @@ func TestPayoutsEndpointEstimations(t *testing.T) {
estimation, err := estimatedPayoutsService.GetAllSatellitesEstimatedPayout(ctx, time.Now())
require.NoError(t, err)
resp, err := endpoint.EstimatedPayoutTotal(ctx, &multinodepb.EstimatedPayoutTotalRequest{Header: &multinodepb.RequestHeader{
resp, err := endpoint.EstimatedPayout(ctx, &multinodepb.EstimatedPayoutRequest{Header: &multinodepb.RequestHeader{
ApiKey: key.Secret[:],
}})
require.NoError(t, err)

View File

@ -821,7 +821,7 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB, revocationDB exten
if err = multinodepb.DRPCRegisterNode(peer.Server.DRPC(), peer.Multinode.Node); err != nil {
return nil, errs.Combine(err, peer.Close())
}
if err = multinodepb.DRPCRegisterPayout(peer.Server.DRPC(), peer.Multinode.Payout); err != nil {
if err = multinodepb.DRPCRegisterPayouts(peer.Server.DRPC(), peer.Multinode.Payout); err != nil {
return nil, errs.Combine(err, peer.Close())
}
}