Documentation ¶
Overview ¶
Package config provides a system-wide configuration facility
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Payment config Payment struct { // Prime for obfuscating payment IDs PaymentIDEncPrime int64 // XOR value to be applied to obfuscated primes PaymentIDEncXOR int64 } // Database config Database struct { // Maximum number of retries on transaction lock errors TransactionMaxRetries int // Maximum number of database connections MaxOpenConns int // Maximum number of idle connections in the connection pool MaxIdleConns int // Principal database Principal struct { Write DatabaseConfig ReadOnly DatabaseConfig } // Payment database Payment struct { Write DatabaseConfig ReadOnly DatabaseConfig } } // API server config API struct { // Should the API server be activated? Active bool // API service config Service ServiceConfig // Service timeout Timeout Duration // Should the API server provide administrative endpoints? ServeAdmin bool // SSL? Secure bool // Cookie-based authentication settings Cookie struct { // Should the API allow cookie-based authentication? AllowCookieAuth bool HTTPOnly bool } // serve the adminpanel gui files (fullfill same origin policy) AdminGUIPubWWWDir string AuthKeys []string } // Web server config Web struct { // Whether the WWW-service should be active Active bool // The URL under which the WWW-service is served URL string // WWW service config Service ServiceConfig // Service timeout Timeout Duration // Public WWW directory PubWWWDir string // Template (base-)directory TemplateDir string // Whether the WWW-service is served securely Secure bool // Cookie config Cookie struct { // Whether so serve cookies as HTTPOnly HTTPOnly bool } // Web auth keys for encrypting cookie auth containers AuthKeys []string } Provider struct { URL string ProviderTemplateDir string } }
Config represents a full configuration for any paymentd related applications
func ReadConfig ¶
ReadConfig reads the JSON from the given reader into a new Config
type DatabaseConfig ¶
DatabaseConfig represents a single database DSN It is a map, so the JSON representation can include the backend type and the DSN, e.g.
{ "mysql": "paymentd@tcp(localhost:3306)/fritzpay" }
func NewDatabaseConfig ¶
func NewDatabaseConfig() DatabaseConfig
NewDatabaseConfig creates a new DatabaseConfig
Click to show internal directories.
Click to hide internal directories.