Add JSON config file for Ratel

Moved from GitHub ratel/57

Posted by tr37ion:

Please add a --config=/path/file.json option to ratel for more consistancy. Consider renaming -addr to something more descriptive eg. --host. Mind the --, please.

Btw. is telemetry missing in --help option or no more valid?

danielmai commented :

Zero and Alpha both use the option --my=addr:port. Ratel can do the same for consistency.

paulftw commented :

Here’s the flags that Ratel currently recognizes:

	portPtr := flag.Int("port", defaultPort, "Port on which the ratel server will run.")
	addrPtr := flag.String("addr", defaultAddr, "Address of the Dgraph server.")
	versionFlagPtr := flag.Bool("version", false, "Prints the version of ratel.")

IIRC --my is used to tell alphas and zeros what is their own network host/port. In Ratel addr is the name of the server it’d connect to.

JSON config sounds like a cool feature

danielmai commented :

With #182 merged, you should be able to use config files in JSON, TOML, YAML, HCL, envfile orJava properties config files with the integration of Viper/Cobra.