[PR #387] [MERGED] feat: context for all api related calls #433

Closed
opened 2026-02-28 00:42:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/387
Author: @Tinyblargon
Created: 12/5/2024
Status: Merged
Merged: 12/5/2024
Merged by: @Tinyblargon

Base: masterHead: #383


📝 Commits (1)

  • ddfc5fb feat: context for all api related calls

📊 Changes

105 files changed (+1188 additions, -1086 deletions)

View changed files

📝 cli/cobra.go (+25 -4)
📝 cli/command/content/iso/download.go (+1 -1)
📝 cli/command/content/template/download.go (+1 -1)
📝 cli/command/content/template/list.go (+1 -1)
📝 cli/command/create/create-acmeaccount.go (+1 -1)
📝 cli/command/create/create-pool.go (+1 -1)
📝 cli/command/create/create-snapshot.go (+2 -2)
📝 cli/command/create/create-storage.go (+1 -1)
📝 cli/command/create/guest/create-guest-lxc.go (+2 -1)
📝 cli/command/create/guest/create-guest-qemu.go (+2 -1)
📝 cli/command/create/guest/create-guest.go (+4 -3)
📝 cli/command/delete/delete-acmeaccount.go (+2 -1)
📝 cli/command/delete/delete-file.go (+1 -1)
📝 cli/command/delete/delete-group.go (+2 -1)
📝 cli/command/delete/delete-guest.go (+2 -2)
📝 cli/command/delete/delete-metricserver.go (+2 -1)
📝 cli/command/delete/delete-pool.go (+2 -1)
📝 cli/command/delete/delete-snapshot.go (+1 -1)
📝 cli/command/delete/delete-storage.go (+2 -1)
📝 cli/command/delete/delete-user.go (+2 -1)

...and 80 more files

📄 Description

Add context.Context to every part of the call stack that leads up to *Session.NewRequest()
This change allows users to specify their own context, making it possible to gracefully exit the application with ^c.

Used a background context in the old cli to keep the same behavior.

Used a cancel-able context in the new cli, Context().

Closes #383


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/387 **Author:** [@Tinyblargon](https://github.com/Tinyblargon) **Created:** 12/5/2024 **Status:** ✅ Merged **Merged:** 12/5/2024 **Merged by:** [@Tinyblargon](https://github.com/Tinyblargon) **Base:** `master` ← **Head:** `#383` --- ### 📝 Commits (1) - [`ddfc5fb`](https://github.com/Telmate/proxmox-api-go/commit/ddfc5fbe8906beeafe423b27d2c31edc99f13cbf) feat: `context` for all api related calls ### 📊 Changes **105 files changed** (+1188 additions, -1086 deletions) <details> <summary>View changed files</summary> 📝 `cli/cobra.go` (+25 -4) 📝 `cli/command/content/iso/download.go` (+1 -1) 📝 `cli/command/content/template/download.go` (+1 -1) 📝 `cli/command/content/template/list.go` (+1 -1) 📝 `cli/command/create/create-acmeaccount.go` (+1 -1) 📝 `cli/command/create/create-pool.go` (+1 -1) 📝 `cli/command/create/create-snapshot.go` (+2 -2) 📝 `cli/command/create/create-storage.go` (+1 -1) 📝 `cli/command/create/guest/create-guest-lxc.go` (+2 -1) 📝 `cli/command/create/guest/create-guest-qemu.go` (+2 -1) 📝 `cli/command/create/guest/create-guest.go` (+4 -3) 📝 `cli/command/delete/delete-acmeaccount.go` (+2 -1) 📝 `cli/command/delete/delete-file.go` (+1 -1) 📝 `cli/command/delete/delete-group.go` (+2 -1) 📝 `cli/command/delete/delete-guest.go` (+2 -2) 📝 `cli/command/delete/delete-metricserver.go` (+2 -1) 📝 `cli/command/delete/delete-pool.go` (+2 -1) 📝 `cli/command/delete/delete-snapshot.go` (+1 -1) 📝 `cli/command/delete/delete-storage.go` (+2 -1) 📝 `cli/command/delete/delete-user.go` (+2 -1) _...and 80 more files_ </details> ### 📄 Description Add `context.Context` to every part of the call stack that leads up to `*Session.NewRequest()` This change allows users to specify their own context, making it possible to gracefully exit the application with `^c`. Used a background context in the old cli to keep the same behavior. Used a cancel-able context in the new cli, `Context()`. Closes #383 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:42:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#433
No description provided.