feat(api): add GetContainer endpoint and Docker host ID mapping

- Implemented GetContainer function to retrieve container details by ID.
- Introduced idDockerHostMap for mapping container IDs to Docker hosts.
- Updated Container struct to allow omitting the State field in JSON responses.
This commit is contained in:
yusing
2025-09-04 06:36:02 +08:00
parent 90738a6809
commit 20105534c7
3 changed files with 81 additions and 1 deletions

View File

@@ -16,7 +16,7 @@ type Container struct {
Name string `json:"name"`
ID string `json:"id"`
Image string `json:"image"`
State ContainerState `json:"state"`
State ContainerState `json:"state,omitempty" extensions:"x-nullable"`
} // @name ContainerResponse
// @x-id "containers"