payouts

package
v1.105.8-rc Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: AGPL-3.0 Imports: 9 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 HeldAmount added in v1.32.1

type HeldAmount struct {
	Period string `json:"period"`
	Amount int64  `json:"amount"`
}

HeldAmount contains amount held for period.

type HeldAmountHistory added in v1.32.1

type HeldAmountHistory struct {
	SatelliteID storj.NodeID `json:"satelliteId"`
	HeldAmounts []HeldAmount `json:"heldAmounts"`
}

HeldAmountHistory contains held amount history of particular satellite.

type HeldAmountSummary added in v1.32.1

type HeldAmountSummary struct {
	SatelliteID      storj.NodeID `json:"satelliteId"`
	SatelliteAddress string       `json:"satelliteAddress"`
	FirstQuarter     int64        `json:"firstQuarter"`
	SecondQuarter    int64        `json:"secondQuarter"`
	ThirdQuarter     int64        `json:"thirdQuarter"`
	PeriodCount      int          `json:"periodCount"`
}

HeldAmountSummary contains held amount summary for first 3 quarters.

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"`
	Disposed       int64   `json:"disposed"`
}

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) Earned added in v1.32.1

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

Earned retrieves all nodes earned amount for all time.

func (*Service) EarnedSatellite added in v1.32.1

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

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

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) HeldAmountSummary added in v1.32.1

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

HeldAmountSummary retrieves held amount history summary for a particular node.

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) 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) PaystubSatellite added in v1.32.1

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

PaystubSatellite returns specific satellite summed paystubs.

func (*Service) PaystubSatellitePeriod added in v1.32.1

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

PaystubSatellitePeriod returns specific satellite paystub for specific period.

func (*Service) Summary added in v1.32.1

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

Summary returns all satellites all time stats.

func (*Service) SummaryPeriod added in v1.32.1

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

SummaryPeriod returns all satellites stats for specific period.

func (*Service) SummarySatellite added in v1.32.1

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

SummarySatellite returns specific satellite all time stats.

func (*Service) SummarySatellitePeriod added in v1.32.1

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

SummarySatellitePeriod returns specific satellite stats 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