payouts

package
v1.31.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is an error class for payouts service error.
	Error = errs.Class("payouts")
)

Functions

This section is empty.

Types

type Expectations added in v1.31.1

type Expectations struct {
	CurrentMonthEstimation int64 `json:"currentMonthEstimation"`
	Undistributed          int64 `json:"undistributed"`
}

Expectations contains estimated and undistributed payouts.

type NodeSummary added in v1.30.1

type NodeSummary struct {
	NodeID   storj.NodeID `json:"nodeId"`
	NodeName string       `json:"nodeName"`
	Held     int64        `json:"held"`
	Paid     int64        `json:"paid"`
}

NodeSummary contains node's payout information.

type Paystub added in v1.31.1

type Paystub struct {
	UsageAtRest    float64 `json:"usageAtRest"`
	UsageGet       int64   `json:"usageGet"`
	UsageGetRepair int64   `json:"usageGetRepair"`
	UsageGetAudit  int64   `json:"usageGetAudit"`
	CompAtRest     int64   `json:"compAtRest"`
	CompGet        int64   `json:"compGet"`
	CompGetRepair  int64   `json:"compGetRepair"`
	CompGetAudit   int64   `json:"compGetAudit"`
	Held           int64   `json:"held"`
	Paid           int64   `json:"paid"`
	Distributed    int64   `json:"distributed"`
}

Paystub is node payouts data for satellite by specific period.

type SatelliteSummary

type SatelliteSummary struct {
	SatelliteID storj.NodeID `json:"satelliteID"`
	Earned      int64        `json:"earned"`
}

SatelliteSummary contains satellite id and earned amount.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service exposes all payouts related logic.

architecture: Service

func NewService

func NewService(log *zap.Logger, dialer rpc.Dialer, nodes nodes.DB) *Service

NewService creates new instance of Service.

func (*Service) Expectations added in v1.31.1

func (service *Service) Expectations(ctx context.Context) (_ Expectations, err error)

Expectations returns all nodes estimated and undistributed earnings.

func (*Service) GetAllNodesAllTimeEarned

func (service *Service) GetAllNodesAllTimeEarned(ctx context.Context) (earned int64, err error)

GetAllNodesAllTimeEarned retrieves all nodes earned amount for all time.

func (*Service) GetAllNodesEarnedOnSatellite

func (service *Service) GetAllNodesEarnedOnSatellite(ctx context.Context) (earned []SatelliteSummary, err error)

GetAllNodesEarnedOnSatellite retrieves all nodes earned amount for all time per satellite.

func (*Service) NodeExpectations added in v1.31.1

func (service *Service) NodeExpectations(ctx context.Context, nodeID storj.NodeID) (_ Expectations, err error)

NodeExpectations returns node's estimated and undistributed earnings.

func (*Service) NodesPeriodSummary added in v1.30.1

func (service *Service) NodesPeriodSummary(ctx context.Context, period string) (_ Summary, err error)

NodesPeriodSummary returns all satellites stats for specific period.

func (*Service) NodesSatellitePeriodSummary added in v1.31.1

func (service *Service) NodesSatellitePeriodSummary(ctx context.Context, satelliteID storj.NodeID, period string) (_ Summary, err error)

NodesSatellitePeriodSummary returns specific satellite stats for specific period.

func (*Service) NodesSatelliteSummary added in v1.31.1

func (service *Service) NodesSatelliteSummary(ctx context.Context, satelliteID storj.NodeID) (_ Summary, err error)

NodesSatelliteSummary returns specific satellite all time stats.

func (*Service) NodesSummary added in v1.30.1

func (service *Service) NodesSummary(ctx context.Context) (_ Summary, err error)

NodesSummary returns all satellites all time stats.

func (*Service) Paystub added in v1.31.1

func (service *Service) Paystub(ctx context.Context, nodeID storj.NodeID) (_ Paystub, err error)

Paystub returns summed all paystubs.

func (*Service) PaystubPeriod added in v1.31.1

func (service *Service) PaystubPeriod(ctx context.Context, period string, nodeID storj.NodeID) (_ Paystub, err error)

PaystubPeriod returns all satellites paystub for specific period.

func (*Service) SatellitePaystub added in v1.31.1

func (service *Service) SatellitePaystub(ctx context.Context, nodeID, satelliteID storj.NodeID) (_ Paystub, err error)

SatellitePaystub returns specific satellite summed paystubs.

func (*Service) SatellitePaystubPeriod added in v1.31.1

func (service *Service) SatellitePaystubPeriod(ctx context.Context, period string, nodeID, satelliteID storj.NodeID) (_ Paystub, err error)

SatellitePaystubPeriod returns specific satellite paystub for specific period.

type Summary added in v1.30.1

type Summary struct {
	TotalEarned int64         `json:"totalEarned"`
	TotalHeld   int64         `json:"totalHeld"`
	TotalPaid   int64         `json:"totalPaid"`
	NodeSummary []NodeSummary `json:"nodeSummary"`
}

Summary contains payouts page data.

func (*Summary) Add added in v1.31.1

func (summary *Summary) Add(held, paid int64, id storj.NodeID, name string)

Add appends node payout data to summary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL