Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Environment ¶
func Environment() string
Environment returns the current environment for the application;
it could be: development, testing, production
func IsEnvironment ¶
IsEnvironment checks if the current environment for the application
is the same as defined in `env`
func LoadConfig ¶ added in v0.1.10
func LoadConfig()
LoadConfig loads the globalConfig structure from a JSON-based stream:
- it attempts to load it from the .config.local.json file;
- it checks for the .config.yml file and loads it from Vault; or
- it fails without any configuration option available
Types ¶
type Config ¶ added in v0.1.10
type Config struct {
ApplicationKey string `json:"application_key"`
DatastoreHost string `json:"datastore_host"`
DatastoreNamePrefix string `json:"datastore_name_prefix"`
DatastorePassword string `json:"datastore_password"`
DatastoreSslMode string `json:"datastore_ssl_mode"`
DatastoreUser string `json:"datastore_user"`
MailFrom string `json:"mail_from"`
MailerAccess string `json:"mailer_access"`
MemorystoreHost string `json:"memory_store_host"`
MemorystoreIndex int `json:"memory_store_index"`
MemorystorePassword string `json:"memory_store_password"`
MemorystorePort int `json:"memory_store_port"`
SessionSecret string `json:"session_secret"`
SessionSecure bool `json:"session_secure"`
StorageSecret string `json:"storage_secret"`
}
Config struct with configuration data for the application
func GetGlobalConfig ¶ added in v0.1.10
func GetGlobalConfig() Config
GetGlobalConfig returns the global configuration struct for the application
type Service ¶ added in v0.1.10
type Service struct {
Space struct {
ConfigurationStore struct {
Addr string `yaml:"addr"`
Token string `yaml:"token"`
Path string `yaml:"path"`
} `yaml:"configuration_store"`
} `yaml:"space"`
}
Service struct with data to retrieve a Vault secret
func (*Service) LoadService ¶ added in v0.1.10
LoadService loads a Vault secret
Click to show internal directories.
Click to hide internal directories.