Created
March 23, 2015 23:17
-
-
Save crosbymichael/36c156e3552650fb9a4c to your computer and use it in GitHub Desktop.
libmachine test API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
type Config struct { | |
Common string | |
DriverOpts interface{} | |
} | |
func main() { | |
var provider libmachine.Provider | |
switch driver { | |
case "do": | |
// returns a digitalocean provider | |
provider = digitalocean.New(token) | |
} | |
var config libmachine.Config | |
// fill out common options | |
switch driver { | |
case "do": | |
config.ProviderConfig = &digitalocean.Config{} | |
} | |
machine, err := provider.Create(config) | |
err := machine.Start() | |
ip, err := machine.IP() | |
err := machine.Stop() | |
err := provider.Destroy(machine) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment