Documentation ¶
Index ¶
- Variables
- type Config
- type PackagePlans
- type ProjectUsagePrice
- type ProjectUsagePriceOverrides
- func (p *ProjectUsagePriceOverrides) Set(s string) error
- func (p *ProjectUsagePriceOverrides) SetMap(overrides map[string]ProjectUsagePrice)
- func (p *ProjectUsagePriceOverrides) String() string
- func (p ProjectUsagePriceOverrides) ToModels() (map[string]payments.ProjectUsagePriceModel, error)
- func (ProjectUsagePriceOverrides) Type() string
Constants ¶
This section is empty.
Variables ¶
var Error = errs.Class("payments config")
Error is payments config err class.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Provider string `help:"payments provider to use" default:""` MockProvider stripe.Client `internal:"true"` BillingConfig billing.Config StripeCoinPayments stripe.Config Storjscan storjscan.Config UsagePrice ProjectUsagePrice BonusRate int64 `help:"amount of percents that user will earn as bonus credits by depositing in STORJ tokens" default:"10"` NodeEgressBandwidthPrice int64 `help:"price node receive for storing TB of egress in cents" default:"2000"` NodeRepairBandwidthPrice int64 `help:"price node receive for storing TB of repair in cents" default:"1000"` NodeAuditBandwidthPrice int64 `help:"price node receive for storing TB of audit in cents" default:"1000"` NodeDiskSpacePrice int64 `help:"price node receive for storing disk space in cents/TB" default:"150"` UsagePriceOverrides ProjectUsagePriceOverrides `` /* 196-byte string literal not displayed */ PackagePlans PackagePlans `help:"semicolon-separated partner package plans in the format partner:price,credit. Price and credit are in cents USD."` }
Config defines global payments config.
type PackagePlans ¶ added in v1.72.2
type PackagePlans struct {
Packages map[string]payments.PackagePlan
}
PackagePlans contains one time prices for partners.
func (*PackagePlans) Get ¶ added in v1.72.2
func (p *PackagePlans) Get(userAgent []byte) (pkg payments.PackagePlan, err error)
Get a package plan by user agent.
func (*PackagePlans) Set ¶ added in v1.72.2
func (p *PackagePlans) Set(s string) error
Set sets the list of pricing plans to the parsed string.
func (*PackagePlans) String ¶ added in v1.72.2
func (p *PackagePlans) String() string
String returns the string representation of the package plans.
func (PackagePlans) Type ¶ added in v1.72.2
func (PackagePlans) Type() string
Type returns the type of the pflag.Value.
type ProjectUsagePrice ¶ added in v1.70.1
type ProjectUsagePrice struct { StorageTB string `help:"price user should pay for storage per month in dollars/TB" default:"4" testDefault:"10"` EgressTB string `help:"price user should pay for egress in dollars/TB" default:"7" testDefault:"45"` Segment string `` /* 132-byte string literal not displayed */ EgressDiscountRatio float64 `internal:"true"` }
ProjectUsagePrice holds the configuration for the satellite's project usage price model.
func (ProjectUsagePrice) ToModel ¶ added in v1.70.1
func (p ProjectUsagePrice) ToModel() (model payments.ProjectUsagePriceModel, err error)
ToModel returns the payments.ProjectUsagePriceModel representation of the project usage price.
type ProjectUsagePriceOverrides ¶ added in v1.70.1
type ProjectUsagePriceOverrides struct {
// contains filtered or unexported fields
}
ProjectUsagePriceOverrides represents a mapping between partners and project usage price overrides.
func (*ProjectUsagePriceOverrides) Set ¶ added in v1.70.1
func (p *ProjectUsagePriceOverrides) Set(s string) error
Set sets the list of price overrides to the parsed string.
func (*ProjectUsagePriceOverrides) SetMap ¶ added in v1.71.1
func (p *ProjectUsagePriceOverrides) SetMap(overrides map[string]ProjectUsagePrice)
SetMap sets the internal mapping between partners and project usage prices.
func (*ProjectUsagePriceOverrides) String ¶ added in v1.70.1
func (p *ProjectUsagePriceOverrides) String() string
String returns the string representation of the price overrides.
func (ProjectUsagePriceOverrides) ToModels ¶ added in v1.70.1
func (p ProjectUsagePriceOverrides) ToModels() (map[string]payments.ProjectUsagePriceModel, error)
ToModels returns the price overrides represented as a mapping between partners and project usage price models.
func (ProjectUsagePriceOverrides) Type ¶ added in v1.70.1
func (ProjectUsagePriceOverrides) Type() string
Type returns the type of the pflag.Value.