mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-22 08:18:29 +02:00
feat(api): add GetContainer endpoint for Docker container retrieval
- Implemented GetContainer function to retrieve container details by ID. - Added error handling for missing ID, container not found, and client creation failures. - Enhanced Container struct to support omitempty for state field in JSON responses. - Updated API documentation with Swagger annotations for the new endpoint.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user