Skip to content

Instantly share code, notes, and snippets.

@mrtc0
Last active May 2, 2017 05:33
Show Gist options
  • Select an option

  • Save mrtc0/0c4853e96463fc042412ebb24bfb8dc2 to your computer and use it in GitHub Desktop.

Select an option

Save mrtc0/0c4853e96463fc042412ebb24bfb8dc2 to your computer and use it in GitHub Desktop.

Revisions

  1. mrtc0 revised this gist May 2, 2017. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions test.go
    Original 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)


    }
  2. mrtc0 created this gist May 2, 2017.
    17 changes: 17 additions & 0 deletions test.go
    Original 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)


    }