// optionsFromEnvConfig builds the main binary's configuration
// options from provided environmental variables
optionsFromEnvConfig builds the main binary's configuration
options from provided environmental variables
// optionsFromEnvConfig builds the main binary ' s configuration // options from provided environmental variables
func optionsFromEnvConfig() (*Options, error) {
	o := defaultOptions
	if err := envconfig.Process("", o); err != nil {
		return nil, err
	}
	if !isValidService(o.Services) {
		return nil, fmt.Errorf("%s is an invalid service type", o.Services)
	}
	if o.SharedKey == "" {
		return nil, errors.New("shared-key cannot be empty")
	}
	return o, nil
}
func optionsFromEnvConfig ( ) ( * Options , error ) { o := defaultOptions if err := envconfig . Process ( " " , o ) ; err != nil { return nil , err } if ! isValidService ( o . Services ) { return nil , fmt . Errorf ( " " , o . Services ) } if o . SharedKey == " " { return nil , errors . New ( " " ) } return o , nil }
optionsFromEnvConfig builds the main binary's configuration
options from provided environmental variables
optionsFromEnvConfig builds the main binary ' s configuration options from provided environmental variables