Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AutoCompileAssets = config.AutoCompileAssets
Expose global config.
var AutoLoadFixtures = config.AutoLoadFixtures
var Bitcoin = config.Bitcoin
var Cloudflare = config.Cloudflare
var CookieDomain = config.CookieDomain
var DashboardUrl = config.DashboardUrl
var DatastoreWarn = config.DatastoreWarn
var DemoMode = config.DemoMode
var Email = config.Email
var Env = os.Getenv("ENV")
Env is the current environment (development, test, sandbox, staging, production)
var Ethereum = config.Ethereum
var Facebook = config.Facebook
var Fee = config.Fee
var Google = config.Google
var IsDevelopment = config.IsDevelopment
var IsProduction = config.IsProduction
var IsSandbox = config.IsSandbox
var IsStaging = config.IsStaging
var IsTest = config.IsTest
var Mandrill = config.Mandrill
var Mercury = config.Mercury
var Netlify = config.Netlify
var Paypal = config.Paypal
var Prefixes = config.Prefixes
var Redis = config.Redis
var RootDir = config.RootDir
var SMTPRelay = config.SMTPRelay
var Salesforce = config.Salesforce
var Secret = config.Secret
var SendGrid = config.SendGrid
var SentryDSN = config.SentryDSN
var SessionName = config.SessionName
var SiteTitle = config.SiteTitle
var Square = config.Square
var StaticUrl = config.StaticUrl
var WorkingDir = config.WorkingDir
Functions ¶
func AbsoluteUrlFor ¶
Types ¶
type Config ¶
type Config struct {
AutoCompileAssets bool
AutoLoadFixtures bool
CookieDomain string
DatastoreWarn bool
DemoMode bool
IsDevelopment bool
IsTest bool
IsProduction bool
IsSandbox bool
IsStaging bool
ProjectId string
Protocol string
RootDir string
SentryDSN string
SiteTitle string
StaticUrl string
DashboardUrl string
Email struct {
From email.Email
ReplyTo email.Email
Provider integration.Integration
}
Ethereum struct {
TestPassword string
DepositPassword string
MainNetNodes []string
TestNetNodes []string
WebhookPassword string
}
Bitcoin struct {
TestPassword string
DepositPassword string
MainNetNodes []string
MainNetUsernames []string
MainNetPasswords []string
TestNetNodes []string
TestNetUsernames []string
TestNetPasswords []string
WebhookPassword string
}
Mercury struct {
WebhookSecret string
}
Secret string
SessionName string
Prefixes map[string]string
Hosts map[string]string
Fee float64
Salesforce struct {
ConsumerKey string
ConsumerSecret string
CallbackURL string
}
Paypal struct {
Email string
Api string
IpnUrl string
PaypalIpnUrl string
}
Square struct {
// Application ID from Square Developer Dashboard
ApplicationId string
// Access token for API calls
AccessToken string
// Location ID for transactions
LocationId string
// Webhook signature key
WebhookSignatureKey string
// Environment: sandbox or production
Environment string
// Sandbox credentials (for development/testing)
SandboxApplicationId string
SandboxAccessToken string
SandboxLocationId string
// Production credentials
ProductionApplicationId string
ProductionAccessToken string
ProductionLocationId string
}
Mandrill struct {
APIKey string
FromEmail string
FromName string
}
Facebook struct {
AppId string
AppSecret string
GraphVersion string
}
Google struct {
APIKey string
Bucket struct {
ImageUploads string
}
}
// Netlify
Netlify struct {
BaseUrl string
ClientId string
Secret string
AccessToken string
}
// Cloudflare {
Cloudflare struct {
Email string
Key string
Zone string
}
// Redis
Redis struct {
Url string
Password string
}
// Sendgrid API key
SendGrid struct {
APIKey string
}
// SMTP Relay
SMTPRelay struct {
Endpoint string
Username string
Password string
}
// Current working dir
WorkingDir string
}
func (Config) AbsoluteUrlFor ¶
Return absolute url (including protocol to path)
type ReferralFraudConfig ¶ added in v1.37.0
type ReferralFraudConfig struct {
RequireEmailVerification bool `json:"requireEmailVerification"`
BlockSelfReferral bool `json:"blockSelfReferral"`
CooldownDays int `json:"cooldownDays"`
MaxReferralsPerDay int `json:"maxReferralsPerDay"`
BlacklistSameIP bool `json:"blacklistSameIP"`
}
ReferralFraudConfig holds fraud detection settings.
type ReferralProgram ¶ added in v1.37.0
type ReferralProgram struct {
Id string `json:"id"`
Name string `json:"name"`
Version int `json:"version"`
Active bool `json:"active"`
Tiers []ReferralTier `json:"tiers"`
Fraud ReferralFraudConfig `json:"fraud"`
}
ReferralProgram is the parsed referral-program.json config.
func GetReferralProgram ¶ added in v1.37.0
func GetReferralProgram() *ReferralProgram
GetReferralProgram returns the parsed referral program config. The config is loaded once from the embedded JSON; subsequent calls return the cached value. Returns safe defaults if the embedded JSON fails to parse.
func (*ReferralProgram) TierForCount ¶ added in v1.37.0
func (p *ReferralProgram) TierForCount(count int) ReferralTier
TierForCount returns the tier matching the given referral count. Tiers are ordered by minReferrals ascending; the highest matching tier wins.
type ReferralTier ¶ added in v1.37.0
type ReferralTier struct {
Id string `json:"id"`
Name string `json:"name"`
MinReferrals int `json:"minReferrals"`
MaxReferrals *int `json:"maxReferrals"` // nil means unlimited
Rewards struct {
ReferrerCreditCents int `json:"referrerCreditCents"`
RefereeCreditCents int `json:"refereeCreditCents"`
RevenueSharePercent float64 `json:"revenueSharePercent"`
CreditCurrency string `json:"creditCurrency"`
} `json:"rewards"`
Limits struct {
MaxTotalCreditsCents int `json:"maxTotalCreditsCents"`
CreditExpiryDays int `json:"creditExpiryDays"`
} `json:"limits"`
}
ReferralTier represents a single tier in the referral program.