estimatedpayouts

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EstimationServiceErr defines sno service error.
	EstimationServiceErr = errs.Class("storage node estimation payouts service error")
)

Functions

func RoundFloat

func RoundFloat(value float64) float64

RoundFloat rounds float value till 2 signs after dot.

Types

type EstimatedPayout

type EstimatedPayout struct {
	CurrentMonth             PayoutMonthly `json:"currentMonth"`
	PreviousMonth            PayoutMonthly `json:"previousMonth"`
	CurrentMonthExpectations float64       `json:"currentMonthExpectations"`
}

EstimatedPayout contains usage and estimated payouts data for current and previous months.

type PayoutMonthly

type PayoutMonthly struct {
	EgressBandwidth         int64   `json:"egressBandwidth"`
	EgressBandwidthPayout   float64 `json:"egressBandwidthPayout"`
	EgressRepairAudit       int64   `json:"egressRepairAudit"`
	EgressRepairAuditPayout float64 `json:"egressRepairAuditPayout"`
	DiskSpace               float64 `json:"diskSpace"`
	DiskSpacePayout         float64 `json:"diskSpacePayout"`
	HeldRate                float64 `json:"heldRate"`
	Payout                  float64 `json:"payout"`
	Held                    float64 `json:"held"`
}

PayoutMonthly contains usage and estimated payouts date.

func (*PayoutMonthly) SetDiskSpacePayout

func (pm *PayoutMonthly) SetDiskSpacePayout(diskSpacePrice int64)

SetDiskSpacePayout counts disk space payouts for PayoutMonthly object.

func (*PayoutMonthly) SetEgressBandwidthPayout

func (pm *PayoutMonthly) SetEgressBandwidthPayout(egressPrice int64)

SetEgressBandwidthPayout counts egress bandwidth payouts for PayoutMonthly object.

func (*PayoutMonthly) SetEgressRepairAuditPayout

func (pm *PayoutMonthly) SetEgressRepairAuditPayout(auditRepairPrice int64)

SetEgressRepairAuditPayout counts audit and repair payouts for PayoutMonthly object.

func (*PayoutMonthly) SetHeldAmount

func (pm *PayoutMonthly) SetHeldAmount()

SetHeldAmount counts held amount for PayoutMonthly object.

func (*PayoutMonthly) SetPayout

func (pm *PayoutMonthly) SetPayout()

SetPayout counts payouts amount for PayoutMonthly object.

type Service

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

Service is handling storage node estimation payouts logic.

architecture: Service

func NewService

func NewService(bandwidthDB bandwidth.DB, reputationDB reputation.DB, storageUsageDB storageusage.DB, pricingDB pricing.DB, satelliteDB satellites.DB, trust *trust.Pool) *Service

NewService returns new instance of Service.

func (*Service) GetAllSatellitesEstimatedPayout

func (s *Service) GetAllSatellitesEstimatedPayout(ctx context.Context) (payout EstimatedPayout, err error)

GetAllSatellitesEstimatedPayout returns estimated payouts for current and previous months from all satellites with current level of load.

func (*Service) GetSatelliteEstimatedPayout

func (s *Service) GetSatelliteEstimatedPayout(ctx context.Context, satelliteID storj.NodeID) (payout EstimatedPayout, err error)

GetSatelliteEstimatedPayout returns estimated payouts for current and previous months from specific satellite with current level of load.

Jump to

Keyboard shortcuts

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