Move clientConfig declaration to the top

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-02 13:26:51 -04:00
parent 8d0fb72034
commit 04a05fad86

View File

@ -17,6 +17,15 @@ import (
var client *PortainerClient
type clientConfig struct {
Url string
User string
Password string
Token string
Insecure bool
Timeout time.Duration
}
type PortainerClient struct {
http.Client
url *url.URL
@ -238,15 +247,6 @@ func (n *PortainerClient) GetStatus() (status Status, err error) {
return
}
type clientConfig struct {
Url string
User string
Password string
Token string
Insecure bool
Timeout time.Duration
}
// Create a new client
func newClient(config clientConfig) (c *PortainerClient, err error) {
apiUrl, err := url.Parse(config.Url + "/api/")