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:
parent
9c79379191
commit
27b418cb3c
@ -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
|
||||
|
@ -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"),
|
||||
|
Loading…
Reference in New Issue
Block a user