func convoxClient() (*client.Client, error) { if !viper.IsSet("convox.host") || !viper.IsSet("convox.password") { return nil, fmt.Errorf("must set 'convox.host' and 'convox.password' in $HOME/.ranch.yaml") } host := viper.GetString("convox.host") password := viper.GetString("convox.password") version := "20151211151200" return client.New(host, password, version), nil }
func ecruClient() (*gorequest.SuperAgent, error) { if !viper.IsSet("convox.password") { return nil, fmt.Errorf("must set 'convox.password' in $HOME/.ranch.yaml") } request := jsonClient(). SetBasicAuth(viper.GetString("convox.password"), "x-auth-token") return request, nil }