Documentation ¶
Overview ¶
Package config provides configuration information of the Yordle application and helper methods for loading and saving configuration parameters.
Index ¶
Constants ¶
const InstanceKey = "DYNAMIC_CONFIG_INSTANCE"
InstanceKey is the key we use to store the unique DynamicConfig instance in memcache
const KindName = "DynamicConfig"
KindName is the datastore kind name
Variables ¶
var B buildinfo.BuildInfo
B is the build information instance
var DefaultInstance = DynamicConfig{
AppName: "Yordle URL Shortener",
}
DefaultInstance is the default configuration with sensible default values
var Locales []string
Locales contains all supported locals
var ProjectName string
ProjectName is used for identifying of the project to the runtime.
Functions ¶
func MustGetAsync ¶
func MustGetAsync(ctx context.Context) <-chan *DynamicConfig
MustGetAsync is the same as MustGet except it returns a channel. This allows this method to be more easily ultilized asynchronously.
Types ¶
type DynamicConfig ¶
type DynamicConfig struct { AppName string GoogleAnalytics GoogleAnalyticsConfig }
DynamicConfig represents dynamic configuration that can be changed at run time through the configuration screen.
func Get ¶
func Get(ctx context.Context) (*DynamicConfig, error)
Get returns the instance of the DynamicConfig.
func MustGet ¶
func MustGet(ctx context.Context) *DynamicConfig
MustGet returns the dynamic config instance. This function calls Get and if an error is returned, it will then return DefaultInstance.
type GoogleAnalyticsConfig ¶
GoogleAnalyticsConfig represents the configuration for google analytics