feat: add RunPod client

- Add a new RunPod client to the project.
- This client allows users to interact with the RunPod API to create and manage pods.
- Includes example usage and configuration options.
This commit is contained in:
Mahmoud Emad
2025-01-19 22:20:47 +02:00
parent 03e5a56d62
commit 0d2307acc8
7 changed files with 495 additions and 0 deletions

View File

@@ -12,6 +12,20 @@ pub fn (mut h HTTPConnection) post_json_generic[T](req Request) !T {
return json.decode(T, data) or { return error("couldn't decode json for ${req} for ${data}") }
}
// TODO
pub fn (mut h HTTPConnection) put_json_generic[T](req Request) !T {
// data := h.put_json_str(req)!
// return json.decode(T, data) or { return error("couldn't decode json for ${req} for ${data}") }
return T{}
}
// TODO
pub fn (mut h HTTPConnection) delete_json_generic[T](req Request) !T {
// data := h.delete_json_str(req)!
// return json.decode(T, data) or { return error("couldn't decode json for ${req} for ${data}") }
return T{}
}
pub fn (mut h HTTPConnection) get_json_list_generic[T](req Request) ![]T {
mut r := []T{}
for item in h.get_json_list(req)! {