Last active
May 2, 2017 05:33
-
-
Save mrtc0/0c4853e96463fc042412ebb24bfb8dc2 to your computer and use it in GitHub Desktop.
Revisions
-
mrtc0 revised this gist
May 2, 2017 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package main import ( "fmt" "os" "io" "github.com/lxc/lxd" ) @@ -12,6 +14,15 @@ func main() { // 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) } -
mrtc0 created this gist
May 2, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ package main import ( "fmt" "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) }