mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 01:38:50 +02:00
fix(lint): improve styling and fix lint errors
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
type Client struct {
|
||||
*proxmox.Client
|
||||
*proxmox.Cluster
|
||||
|
||||
Version *proxmox.Version
|
||||
BaseURL *url.URL
|
||||
// id -> resource; id: lxc/<vmid> or qemu/<vmid>
|
||||
@@ -29,6 +30,7 @@ type Client struct {
|
||||
|
||||
type VMResource struct {
|
||||
*proxmox.ClusterResource
|
||||
|
||||
IPs []net.IP
|
||||
}
|
||||
|
||||
@@ -37,9 +39,9 @@ var (
|
||||
ErrNoResources = errors.New("no resources")
|
||||
)
|
||||
|
||||
func NewClient(baseUrl string, opts ...proxmox.Option) *Client {
|
||||
func NewClient(baseURL string, opts ...proxmox.Option) *Client {
|
||||
return &Client{
|
||||
Client: proxmox.NewClient(baseUrl, opts...),
|
||||
Client: proxmox.NewClient(baseURL, opts...),
|
||||
resources: make(map[string]*VMResource),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ func (n *Node) LXCIsStopped(ctx context.Context, vmid uint64) (bool, error) {
|
||||
}
|
||||
|
||||
func (n *Node) LXCSetShutdownTimeout(ctx context.Context, vmid uint64, timeout time.Duration) error {
|
||||
return n.client.Put(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/config", n.name, vmid), map[string]interface{}{
|
||||
return n.client.Put(ctx, fmt.Sprintf("/nodes/%s/lxc/%d/config", n.name, vmid), map[string]any{
|
||||
"startup": fmt.Sprintf("down=%.0f", timeout.Seconds()),
|
||||
}, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user