Documentation
¶
Index ¶
- func CurrencyLabel(currency string) string
- func CurrencyTotalsUnavailableReason(metricLabel string, comparisons []CurrencyComparison) string
- func EnrichSalesScopeFromRows(scope salesScope, rows [][]string, appleIdentifierIdx, skuIdx int) salesScope
- func NewInsightsCommand(d *shared.Deps) *ffcli.Command
- func ParseSalesReportMetrics(reader io.Reader, scope salesScope, byCurrency bool) (salesWeekMetrics, error)
- func RowMatchesSalesScope(scope salesScope, appleIdentifier, parentIdentifier string) (isAppRow bool, isMonetizedRow bool, include bool)
- type CurrencyAmount
- type CurrencyAmounts
- type CurrencyComparison
- type SalesMetrics
- type SalesMoney
- type SalesScope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrencyLabel ¶
CurrencyLabel names a currency code for people, including the empty code.
func CurrencyTotalsUnavailableReason ¶
func CurrencyTotalsUnavailableReason(metricLabel string, comparisons []CurrencyComparison) string
CurrencyTotalsUnavailableReason explains why a monetary metric has no single total.
func EnrichSalesScopeFromRows ¶ added in v1.260325.0
func EnrichSalesScopeFromRows(scope salesScope, rows [][]string, appleIdentifierIdx, skuIdx int) salesScope
EnrichSalesScopeFromRows resolves the app SKU from report data when it is not already set on scope.
func NewInsightsCommand ¶
NewInsightsCommand returns the insights command group built on d.
func ParseSalesReportMetrics ¶ added in v1.260325.0
func ParseSalesReportMetrics(reader io.Reader, scope salesScope, byCurrency bool) (salesWeekMetrics, error)
ParseSalesReportMetrics reads a gzip-compressed sales TSV from reader and returns aggregated metrics scoped to the given app.
func RowMatchesSalesScope ¶ added in v1.260325.0
func RowMatchesSalesScope(scope salesScope, appleIdentifier, parentIdentifier string) (isAppRow bool, isMonetizedRow bool, include bool)
RowMatchesSalesScope determines whether a report row belongs to the app, represents a monetized product, or should be included in aggregation.
Types ¶
type CurrencyAmount ¶
type CurrencyAmounts ¶
type CurrencyAmounts map[string]CurrencyAmount
type CurrencyComparison ¶
type CurrencyComparison struct {
Currency string
Current *float64
Previous *float64
Delta *float64
DeltaPercent *float64
Reason string
}
CurrencyComparison pairs one currency's totals across two compared periods.
func CompareCurrencyAmounts ¶
func CompareCurrencyAmounts(current, previous CurrencyAmounts) []CurrencyComparison
CompareCurrencyAmounts pairs the per-currency totals of two periods, sorted by currency code. A currency absent from a complete period has a zero total.
type SalesMetrics ¶ added in v1.260325.0
type SalesMetrics struct {
RowCount int
UnitsColumnPresent bool
DownloadUnitsAvailable bool
DeveloperProceedsColumnPresent bool
CustomerPriceColumnPresent bool
SubscriptionColumnPresent bool
UnitsTotal float64
DownloadUnitsTotal float64
MonetizedUnitsTotal float64
DeveloperProceeds SalesMoney
CustomerPrice SalesMoney
SubscriptionRows int
SubscriptionUnitsTotal float64
SubscriptionDeveloperProceeds SalesMoney
RenewalRows int
RenewalUnitsTotal float64
RenewalDeveloperProceeds SalesMoney
}
SalesMetrics holds aggregated metrics from a parsed sales report.
type SalesMoney ¶
type SalesMoney struct {
LegacyTotal float64
ByCurrency CurrencyAmounts
}
func (SalesMoney) Plus ¶
func (m SalesMoney) Plus(other SalesMoney) SalesMoney
type SalesScope ¶ added in v1.260325.0
SalesScope identifies an app for scoping sales report row filtering.