1
0
mirror of https://gitlab.com/psuapp/psu.git synced 2024-08-30 18:12:34 +00:00

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
client
common

View File

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

View File

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