Documentation ¶
Overview ¶
config helper for cache, mq, and worker
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Presets = map[string]Settings{ "worker": Settings{ Scheme: "https", Port: 443, ApiVersion: "2", Host: "worker-aws-us-east-1.iron.io", UserAgent: "iron_go3/worker 2.0 (Go " + goVersion + ")", }, "mq": Settings{ Scheme: "https", Port: 443, ApiVersion: "3", Host: "mq-aws-us-east-1-1.iron.io", UserAgent: "iron_go3/mq 3.0 (Go " + goVersion + ")", }, "cache": Settings{ Scheme: "https", Port: 443, ApiVersion: "1", Host: "cache-aws-us-east-1.iron.io", UserAgent: "iron_go3/cache 1.0 (Go " + goVersion + ")", }, } )
Functions ¶
This section is empty.
Types ¶
type Settings ¶
type Settings struct { Token string `json:"token,omitempty"` ProjectId string `json:"project_id,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` Port uint16 `json:"port,omitempty"` ApiVersion string `json:"api_version,omitempty"` UserAgent string `json:"user_agent,omitempty"` }
Contains the configuration for an iron.io service. An empty instance is not usable
func Config ¶
Config gathers configuration from env variables and json config files. Examples of fullProduct are "iron_worker", "iron_cache", "iron_mq".
func ConfigWithEnv ¶
Like Config, but useful for keeping multiple dev environment information in one iron.json config file. If env="", works same as Config.
e.g.
{ "production": { "token": ..., "project_id": ... }, "test": { ... } }
func ManualConfig ¶
ManualConfig gathers configuration from env variables, json config files and finally overwrites it with specified instance of Settings. Examples of fullProduct are "iron_worker", "iron_cache", "iron_mq" and
func (*Settings) UseConfigFile ¶
Load and merge the given JSON config file.
func (*Settings) UseConfigMap ¶
Merge the given data into the settings.
func (*Settings) UseSettings ¶
Merge the given instance into the settings.