Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // EstimationServiceErr defines sno service error. EstimationServiceErr = errs.Class("storage node estimation payout service error") )
Functions ¶
func RoundFloat ¶ added in v1.15.1
RoundFloat rounds float value till 2 signs after dot.
Types ¶
type EstimatedPayout ¶
type EstimatedPayout struct { CurrentMonth PayoutMonthly `json:"currentMonth"` PreviousMonth PayoutMonthly `json:"previousMonth"` }
EstimatedPayout contains usage and estimated payout 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 int64 `json:"heldRate"` Payout float64 `json:"payout"` Held float64 `json:"held"` }
PayoutMonthly contains usage and estimated payout date.
func (*PayoutMonthly) SetDiskSpacePayout ¶
func (pm *PayoutMonthly) SetDiskSpacePayout(diskSpacePrice int64)
SetDiskSpacePayout counts disk space payout for PayoutMonthly object.
func (*PayoutMonthly) SetEgressBandwidthPayout ¶
func (pm *PayoutMonthly) SetEgressBandwidthPayout(egressPrice int64)
SetEgressBandwidthPayout counts egress bandwidth payout for PayoutMonthly object.
func (*PayoutMonthly) SetEgressRepairAuditPayout ¶
func (pm *PayoutMonthly) SetEgressRepairAuditPayout(auditRepairPrice int64)
SetEgressRepairAuditPayout counts audit and repair payout 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 payout amount for PayoutMonthly object.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is handling storage node estimation payout 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 payout 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 payout for current and previous months from specific satellite with current level of load.