Add debug tool to image
This commit is contained in:
parent
5c4854b537
commit
9534f8bc43
7 changed files with 412 additions and 1 deletions
|
|
@ -22,6 +22,7 @@ import (
|
|||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/tv42/httpunix"
|
||||
|
|
@ -87,6 +88,21 @@ func NewPostStatusRequest(path, contentType string, data interface{}) (int, []by
|
|||
return res.StatusCode, body, nil
|
||||
}
|
||||
|
||||
// ReadNginxConf reads the nginx configuration file into a string
|
||||
func ReadNginxConf() (string, error) {
|
||||
confFile, err := os.Open("/etc/nginx/nginx.conf")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer confFile.Close()
|
||||
|
||||
contents, err := ioutil.ReadAll(confFile)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(contents), nil
|
||||
}
|
||||
|
||||
func buildUnixSocketClient() *http.Client {
|
||||
u := &httpunix.Transport{
|
||||
DialTimeout: 1 * time.Second,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue