estimatedpayout

package
v1.13.0-rc Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: AGPL-3.0 Imports: 14 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 payout service error")
)

Functions

This section is empty.

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   int64   `json:"egressBandwidthPayout"`
	EgressRepairAudit       int64   `json:"egressRepairAudit"`
	EgressRepairAuditPayout int64   `json:"egressRepairAuditPayout"`
	DiskSpace               float64 `json:"diskSpace"`
	DiskSpacePayout         int64   `json:"diskSpacePayout"`
	HeldRate                int64   `json:"heldRate"`
	Payout                  int64   `json:"payout"`
	Held                    int64   `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.

Jump to

Keyboard shortcuts

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