Last active
May 2, 2017 05:33
-
-
Save mrtc0/0c4853e96463fc042412ebb24bfb8dc2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
import ( | |
"fmt" | |
"os" | |
"io" | |
"github.com/lxc/lxd" | |
) | |
func main() { | |
var config *lxd.Config | |
config = &lxd.DefaultConfig | |
client, _ := lxd.NewClient(config, "local") | |
// fmt.Println(client, err) | |
// info, _ := client.ContainerInfo("test1") | |
// fmt.Println(info) | |
var stdin io.ReadCloser | |
var stdout io.WriteCloser | |
var stderr io.WriteCloser | |
stdin = os.Stdin | |
stdout = os.Stdout | |
stderr = os.Stdout | |
var cmd = []string{"ls", "-al"} | |
ret_code, _ := client.Exec("test1", cmd, nil, stdin, stdout, stderr, nil, 0, 0) | |
fmt.Println(ret_code) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment