Rename client.ClientConfig to client.Config

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-02 20:28:48 -04:00
parent 9c79379191
commit 27b418cb3c
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ type StackListFilter struct {
EndpointId uint32 `json:",omitempty"`
}
type ClientConfig struct {
type Config struct {
Url string
User string
Password string
@ -277,7 +277,7 @@ func (n *PortainerClientImp) GetStatus() (status Status, err error) {
}
// Create a new client
func NewClient(httpClient *http.Client, config ClientConfig) (c PortainerClient, err error) {
func NewClient(httpClient *http.Client, config Config) (c PortainerClient, err error) {
apiUrl, err := url.Parse(strings.TrimRight(config.Url, "/") + "/api/")
if err != nil {
return

View File

@ -28,8 +28,8 @@ func GetDefaultClient() (c client.PortainerClient, err error) {
}
// Get the default config for a client
func GetDefaultClientConfig() client.ClientConfig {
return client.ClientConfig{
func GetDefaultClientConfig() client.Config {
return client.Config{
Url: viper.GetString("url"),
User: viper.GetString("user"),
Password: viper.GetString("password"),