config

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AutoCompileAssets = config.AutoCompileAssets

Expose global config.

View Source
var AutoLoadFixtures = config.AutoLoadFixtures
View Source
var Bitcoin = config.Bitcoin
View Source
var Cloudflare = config.Cloudflare
View Source
var CookieDomain = config.CookieDomain
View Source
var DashboardUrl = config.DashboardUrl
View Source
var DatastoreWarn = config.DatastoreWarn
View Source
var DemoMode = config.DemoMode
View Source
var Email = config.Email
View Source
var Env = os.Getenv("ENV")

Env is the current environment (development, test, sandbox, staging, production)

View Source
var Ethereum = config.Ethereum
View Source
var Facebook = config.Facebook
View Source
var Fee = config.Fee
View Source
var Google = config.Google
View Source
var IsDevelopment = config.IsDevelopment
View Source
var IsProduction = config.IsProduction
View Source
var IsSandbox = config.IsSandbox
View Source
var IsStaging = config.IsStaging
View Source
var IsTest = config.IsTest
View Source
var Mandrill = config.Mandrill
View Source
var Netlify = config.Netlify
View Source
var Paypal = config.Paypal
View Source
var Prefixes = config.Prefixes
View Source
var Redis = config.Redis
View Source
var RootDir = config.RootDir
View Source
var SMTPRelay = config.SMTPRelay
View Source
var Salesforce = config.Salesforce
View Source
var Secret = config.Secret
View Source
var SendGrid = config.SendGrid
View Source
var SentryDSN = config.SentryDSN
View Source
var SessionName = config.SessionName
View Source
var SiteTitle = config.SiteTitle
View Source
var Square = config.Square
View Source
var StaticUrl = config.StaticUrl
View Source
var Stripe = config.Stripe
View Source
var WorkingDir = config.WorkingDir

Functions

func AbsoluteUrlFor

func AbsoluteUrlFor(moduleName string, args ...string) string

func UrlFor

func UrlFor(moduleName string, args ...string) string

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
	}

	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
	}

	Stripe struct {
		BankAccount string

		// Current id/keys based on development mode
		ClientId       string
		SecretKey      string
		PublishableKey string

		DevelopmentClientId string
		ProductionClientId  string

		TestSecretKey      string
		TestPublishableKey string
		LiveSecretKey      string
		LivePublishablKey  string

		RedirectURL string
		WebhookURL  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 Defaults

func Defaults() *Config

Default settings

func Development

func Development() *Config

Development settings

func Get

func Get() *Config

Get current config object

func Production

func Production() *Config

Production Settings

func Sandbox

func Sandbox() *Config

Sandbox Settings

func Staging

func Staging() *Config

Staging Settings

func Test

func Test() *Config

Development settings

func (Config) AbsoluteUrlFor

func (c Config) AbsoluteUrlFor(moduleName string, args ...string) (url string)

Return absolute url (including protocol to path)

func (*Config) Load

func (c *Config) Load(fileName string)

Load configuration from JSON file

func (Config) UrlFor

func (c Config) UrlFor(moduleName string, args ...string) (url string)

Return url to static file, module or path rooted in a module

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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