mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 18:42:58 +00:00
34 lines
806 B
Go
34 lines
806 B
Go
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
package proxmoxtf
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/bpg/terraform-provider-proxmox/proxmox"
|
|
)
|
|
|
|
type ProviderConfiguration struct {
|
|
veClient *proxmox.VirtualEnvironmentClient
|
|
}
|
|
|
|
func NewProviderConfiguration(veClient *proxmox.VirtualEnvironmentClient) ProviderConfiguration {
|
|
return ProviderConfiguration{
|
|
veClient: veClient,
|
|
}
|
|
}
|
|
|
|
func (c *ProviderConfiguration) GetVEClient() (*proxmox.VirtualEnvironmentClient, error) {
|
|
if c.veClient == nil {
|
|
return nil, errors.New(
|
|
"you must specify the virtual environment details in the provider configuration",
|
|
)
|
|
}
|
|
|
|
return c.veClient, nil
|
|
}
|