Documentation
¶
Index ¶
- Constants
- Variables
- type APIClient
- func (c *APIClient) BuildImage(ctx context.Context, options *models.ImageBuildRequest) (string, error)
- func (c *APIClient) ChangePassword(ctx context.Context, oldPassword, newPassword string) error
- func (c *APIClient) CloneVolume(ctx context.Context, sourceName, targetName string, labels map[string]string) (*models.Volume, error)
- func (c *APIClient) ComposeDown(ctx context.Context, id string, options *models.ComposeDownOptions) error
- func (c *APIClient) ComposeUp(ctx context.Context, files []io.Reader, options *models.ComposeUpOptions) (string, error)
- func (c *APIClient) ConnectContainerToNetwork(ctx context.Context, networkID, containerID string, ...) error
- func (c *APIClient) CopyFromContainer(ctx context.Context, containerID, path string) (io.ReadCloser, error)
- func (c *APIClient) CopyToContainer(ctx context.Context, containerID, path string, content io.Reader) error
- func (c *APIClient) CreateContainer(ctx context.Context, req *models.ContainerCreateRequest) (*models.Container, error)
- func (c *APIClient) CreateMacvlan(ctx context.Context, name, parent string, subnet, gateway string) (*models.Network, error)
- func (c *APIClient) CreateNetwork(ctx context.Context, options *models.NetworkCreateRequest) (*models.Network, error)
- func (c *APIClient) CreateOverlay(ctx context.Context, name string, attachable bool, subnet, gateway string) (*models.Network, error)
- func (c *APIClient) CreateVolume(ctx context.Context, options *models.VolumeCreateRequest) (*models.Volume, error)
- func (c *APIClient) DisconnectContainerFromNetwork(ctx context.Context, networkID, containerID string, force bool) error
- func (c *APIClient) Do(ctx context.Context, req *http.Request) (*http.Response, error)
- func (c *APIClient) ExecCreate(ctx context.Context, containerID string, ...) (string, error)
- func (c *APIClient) ExecResize(ctx context.Context, execID string, height, width uint) error
- func (c *APIClient) ExecStart(ctx context.Context, execID string, interactive bool) (io.ReadWriteCloser, error)
- func (c *APIClient) GetComposeLogs(ctx context.Context, id string, service string, tail int) (io.ReadCloser, error)
- func (c *APIClient) GetComposeStatus(ctx context.Context, id string) (*models.ComposeStatus, error)
- func (c *APIClient) GetContainer(ctx context.Context, id string) (*models.Container, error)
- func (c *APIClient) GetContainerLogs(ctx context.Context, id string, options map[string]string) (io.ReadCloser, error)
- func (c *APIClient) GetContainerNetworks(ctx context.Context, containerID string) ([]models.Network, error)
- func (c *APIClient) GetContainerProcesses(ctx context.Context, id string) ([][]string, error)
- func (c *APIClient) GetContainerStats(ctx context.Context, id string) (*models.ContainerStats, error)
- func (c *APIClient) GetCurrentUser(ctx context.Context) (*models.UserResponse, error)
- func (c *APIClient) GetImage(ctx context.Context, id string) (*models.Image, error)
- func (c *APIClient) GetImageHistory(ctx context.Context, id string) ([]models.ImageHistoryResponse, error)
- func (c *APIClient) GetNetwork(ctx context.Context, id string) (*models.Network, error)
- func (c *APIClient) GetToken() (accessToken, refreshToken string, expiresAt time.Time)
- func (c *APIClient) GetVolume(ctx context.Context, name string) (*models.Volume, error)
- func (c *APIClient) HasValidToken() bool
- func (c *APIClient) Health(ctx context.Context) (map[string]interface{}, error)
- func (c *APIClient) InspectNetwork(ctx context.Context, id string) (*models.Network, error)
- func (c *APIClient) InspectVolume(ctx context.Context, name string) (*models.Volume, error)
- func (c *APIClient) IsNetworkExist(ctx context.Context, idOrName string) (bool, error)
- func (c *APIClient) ListComposeDeployments(ctx context.Context) ([]models.ComposeDeploymentResponse, error)
- func (c *APIClient) ListContainers(ctx context.Context, filters map[string]string) ([]models.Container, error)
- func (c *APIClient) ListImages(ctx context.Context, filters map[string]string) ([]models.Image, error)
- func (c *APIClient) ListNetworks(ctx context.Context, filters map[string]string) ([]models.Network, error)
- func (c *APIClient) ListVolumes(ctx context.Context, filters map[string]string) ([]models.Volume, error)
- func (c *APIClient) Login(ctx context.Context, username, password string) (*AuthResponse, error)
- func (c *APIClient) Logout(ctx context.Context) error
- func (c *APIClient) MountVolume(ctx context.Context, volumeName, mountPoint string) error
- func (c *APIClient) PauseContainer(ctx context.Context, id string) error
- func (c *APIClient) PruneNetworks(ctx context.Context, filters map[string]string) (uint64, error)
- func (c *APIClient) PruneVolumes(ctx context.Context, filters map[string]string) (uint64, error)
- func (c *APIClient) PullComposeImages(ctx context.Context, id string) error
- func (c *APIClient) PullImage(ctx context.Context, ref string, auth *registry.AuthConfig) error
- func (c *APIClient) PushImage(ctx context.Context, ref string, auth *registry.AuthConfig) error
- func (c *APIClient) RefreshToken(ctx context.Context) (*AuthResponse, error)
- func (c *APIClient) Register(ctx context.Context, username, password, email string) (*AuthResponse, error)
- func (c *APIClient) RemoveContainer(ctx context.Context, id string, force bool) error
- func (c *APIClient) RemoveImage(ctx context.Context, id string, force bool) error
- func (c *APIClient) RemoveNetwork(ctx context.Context, id string) error
- func (c *APIClient) RemoveVolume(ctx context.Context, name string, force bool) error
- func (c *APIClient) RenameContainer(ctx context.Context, id string, newName string) error
- func (c *APIClient) ResizeContainerTTY(ctx context.Context, id string, height, width uint) error
- func (c *APIClient) RestartComposeService(ctx context.Context, id string, service string) error
- func (c *APIClient) RestartContainer(ctx context.Context, id string, timeout *int) error
- func (c *APIClient) ScaleComposeService(ctx context.Context, id string, service string, replicas int) error
- func (c *APIClient) SearchImages(ctx context.Context, term string, limit int) ([]registry.SearchResult, error)
- func (c *APIClient) SetToken(accessToken, refreshToken string, expiresAt time.Time)
- func (c *APIClient) StartContainer(ctx context.Context, id string) error
- func (c *APIClient) StopContainer(ctx context.Context, id string, timeout *int) error
- func (c *APIClient) TagImage(ctx context.Context, id, repo, tag string) error
- func (c *APIClient) UnmountVolume(ctx context.Context, volumeName string) error
- func (c *APIClient) UnpauseContainer(ctx context.Context, id string) error
- func (c *APIClient) UpdateContainer(ctx context.Context, id string, updateConfig *container.UpdateConfig) (*models.Container, error)
- func (c *APIClient) UpdateCurrentUser(ctx context.Context, user *models.User) (*models.User, error)
- func (c *APIClient) UpdateNetwork(ctx context.Context, id string, options *models.NetworkUpdateOptions) error
- func (c *APIClient) UpdateVolume(ctx context.Context, name string, labels map[string]string) error
- func (c *APIClient) UploadComposeFile(ctx context.Context, content io.Reader, filename string) (string, error)
- func (c *APIClient) ValidateComposeFile(ctx context.Context, fileID string) ([]string, error)
- func (c *APIClient) WaitContainer(ctx context.Context, id string, condition string) (int, error)
- func (c *APIClient) WatchComposeDeployment(ctx context.Context, id string, interval time.Duration) (<-chan *models.ComposeStatus, <-chan error)
- type AuthResponse
- type Client
- type ClientConfig
- type ClientOption
- func WithAccessToken(token string) ClientOption
- func WithAutoRefresh(autoRefresh bool) ClientOption
- func WithBaseURL(baseURL string) ClientOption
- func WithHTTPClient(client *http.Client) ClientOption
- func WithHeader(key, value string) ClientOption
- func WithRefreshToken(token string) ClientOption
- func WithRetryOptions(maxRetries int, retryDelay time.Duration) ClientOption
- func WithTLSInsecureSkipVerify(skip bool) ClientOption
- func WithTimeout(timeout time.Duration) ClientOption
- func WithUserAgent(userAgent string) ClientOption
- type ContainerListOptions
- type ContainerLogOptions
- type ExecStartOptions
- type ImageBuildOptions
- type ImageListOptions
- type ImagePullOptions
- type LoginRequest
- type NetworkListOptions
- type PasswordChangeRequest
- type RegisterRequest
- type VolumeListOptions
Constants ¶
const ( APIBasePath = "/api/v1" APIPathHealth = "/health" APIPathAuth = "/auth" APIPathAuthLogin = "/auth/login" APIPathAuthRegister = "/auth/register" APIPathAuthRefresh = "/auth/refresh" APIPathAuthLogout = "/auth/logout" APIPathUser = "/user" APIPathUserMe = "/user/me" APIPathContainers = "/containers" APIPathImages = "/images" APIPathVolumes = "/volumes" APIPathNetworks = "/networks" APIPathCompose = "/compose" APIPathSystem = "/system" APIPathSystemInfo = "/system/info" APIPathSystemPing = "/system/ping" APIPathSystemEvents = "/system/events" )
API paths
Variables ¶
var ( ErrNotFound = fmt.Errorf("resource not found") ErrForbidden = fmt.Errorf("forbidden") ErrBadRequest = fmt.Errorf("bad request") ErrServerError = fmt.Errorf("server error") ErrTimeout = fmt.Errorf("request timeout") ErrConnectionFailed = fmt.Errorf("connection failed") ErrAlreadyExists = fmt.Errorf("resource already exists") ErrConflict = fmt.Errorf("conflict") ErrNotImplemented = fmt.Errorf("not implemented") )
Common errors
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient implements the Client interface
func NewClient ¶
func NewClient(opts ...ClientOption) (*APIClient, error)
NewClient creates a new API client
func (*APIClient) BuildImage ¶
func (c *APIClient) BuildImage(ctx context.Context, options *models.ImageBuildRequest) (string, error)
BuildImage builds an image from a context
func (*APIClient) ChangePassword ¶
ChangePassword changes the current user's password
func (*APIClient) CloneVolume ¶
func (c *APIClient) CloneVolume(ctx context.Context, sourceName, targetName string, labels map[string]string) (*models.Volume, error)
CloneVolume creates a new volume by cloning an existing one
func (*APIClient) ComposeDown ¶
func (c *APIClient) ComposeDown(ctx context.Context, id string, options *models.ComposeDownOptions) error
ComposeDown shuts down a Compose deployment
func (*APIClient) ComposeUp ¶
func (c *APIClient) ComposeUp(ctx context.Context, files []io.Reader, options *models.ComposeUpOptions) (string, error)
ComposeUp deploys services defined in Compose files
func (*APIClient) ConnectContainerToNetwork ¶
func (c *APIClient) ConnectContainerToNetwork(ctx context.Context, networkID, containerID string, config *networktypes.EndpointSettings) error
ConnectContainerToNetwork connects a container to a network
func (*APIClient) CopyFromContainer ¶
func (c *APIClient) CopyFromContainer(ctx context.Context, containerID, path string) (io.ReadCloser, error)
CopyFromContainer copies files/folders from a container
func (*APIClient) CopyToContainer ¶
func (c *APIClient) CopyToContainer(ctx context.Context, containerID, path string, content io.Reader) error
CopyToContainer copies files/folders to a container
func (*APIClient) CreateContainer ¶
func (c *APIClient) CreateContainer(ctx context.Context, req *models.ContainerCreateRequest) (*models.Container, error)
CreateContainer creates a new container
func (*APIClient) CreateMacvlan ¶
func (c *APIClient) CreateMacvlan(ctx context.Context, name, parent string, subnet, gateway string) (*models.Network, error)
CreateMacvlan creates a new Macvlan network
func (*APIClient) CreateNetwork ¶
func (c *APIClient) CreateNetwork(ctx context.Context, options *models.NetworkCreateRequest) (*models.Network, error)
CreateNetwork creates a new network
func (*APIClient) CreateOverlay ¶
func (c *APIClient) CreateOverlay(ctx context.Context, name string, attachable bool, subnet, gateway string) (*models.Network, error)
CreateOverlay creates a new overlay network
func (*APIClient) CreateVolume ¶
func (c *APIClient) CreateVolume(ctx context.Context, options *models.VolumeCreateRequest) (*models.Volume, error)
CreateVolume creates a new volume
func (*APIClient) DisconnectContainerFromNetwork ¶
func (c *APIClient) DisconnectContainerFromNetwork(ctx context.Context, networkID, containerID string, force bool) error
DisconnectContainerFromNetwork disconnects a container from a network
func (*APIClient) ExecCreate ¶
func (c *APIClient) ExecCreate(ctx context.Context, containerID string, req *models.ContainerExecCreateRequest) (string, error)
ExecCreate creates an exec instance in a container
func (*APIClient) ExecResize ¶
ExecResize resizes the TTY session of an exec instance
func (*APIClient) ExecStart ¶
func (c *APIClient) ExecStart(ctx context.Context, execID string, interactive bool) (io.ReadWriteCloser, error)
ExecStart starts an exec instance
func (*APIClient) GetComposeLogs ¶
func (c *APIClient) GetComposeLogs(ctx context.Context, id string, service string, tail int) (io.ReadCloser, error)
GetComposeLogs gets logs for a service in a Compose deployment
func (*APIClient) GetComposeStatus ¶
GetComposeStatus gets the status of a Compose deployment
func (*APIClient) GetContainer ¶
GetContainer gets detailed information about a container
func (*APIClient) GetContainerLogs ¶
func (c *APIClient) GetContainerLogs(ctx context.Context, id string, options map[string]string) (io.ReadCloser, error)
GetContainerLogs gets logs from a container
func (*APIClient) GetContainerNetworks ¶
func (c *APIClient) GetContainerNetworks(ctx context.Context, containerID string) ([]models.Network, error)
GetContainerNetworks gets all networks a container is connected to
func (*APIClient) GetContainerProcesses ¶
GetContainerProcesses gets processes running in a container
func (*APIClient) GetContainerStats ¶
func (c *APIClient) GetContainerStats(ctx context.Context, id string) (*models.ContainerStats, error)
GetContainerStats gets stats from a container
func (*APIClient) GetCurrentUser ¶
GetCurrentUser returns the current authenticated user
func (*APIClient) GetImageHistory ¶
func (c *APIClient) GetImageHistory(ctx context.Context, id string) ([]models.ImageHistoryResponse, error)
GetImageHistory gets the history of an image
func (*APIClient) GetNetwork ¶
GetNetwork gets detailed information about a network
func (*APIClient) HasValidToken ¶
HasValidToken checks if the client has a valid access token
func (*APIClient) InspectNetwork ¶
InspectNetwork gets detailed information about a network This is an alias for GetNetwork for Docker CLI compatibility
func (*APIClient) InspectVolume ¶
InspectVolume gets detailed information about a volume This is an alias for GetVolume for Docker CLI compatibility
func (*APIClient) IsNetworkExist ¶
IsNetworkExist checks if a network with the given ID or name exists
func (*APIClient) ListComposeDeployments ¶
func (c *APIClient) ListComposeDeployments(ctx context.Context) ([]models.ComposeDeploymentResponse, error)
ListComposeDeployments lists Compose deployments
func (*APIClient) ListContainers ¶
func (c *APIClient) ListContainers(ctx context.Context, filters map[string]string) ([]models.Container, error)
ListContainers lists containers with optional filters
func (*APIClient) ListImages ¶
func (c *APIClient) ListImages(ctx context.Context, filters map[string]string) ([]models.Image, error)
ListImages lists images with optional filters
func (*APIClient) ListNetworks ¶
func (c *APIClient) ListNetworks(ctx context.Context, filters map[string]string) ([]models.Network, error)
ListNetworks lists networks with optional filters
func (*APIClient) ListVolumes ¶
func (c *APIClient) ListVolumes(ctx context.Context, filters map[string]string) ([]models.Volume, error)
ListVolumes lists volumes with optional filters
func (*APIClient) MountVolume ¶
MountVolume mounts a volume to a path on the host Note: This is a higher-level operation that is not directly supported by the Docker API It requires creating a temporary container to mount the volume
func (*APIClient) PauseContainer ¶
PauseContainer pauses a container
func (*APIClient) PruneNetworks ¶
PruneNetworks removes unused networks
func (*APIClient) PruneVolumes ¶
PruneVolumes removes unused volumes
func (*APIClient) PullComposeImages ¶
PullComposeImages pulls images for a Compose deployment
func (*APIClient) RefreshToken ¶
func (c *APIClient) RefreshToken(ctx context.Context) (*AuthResponse, error)
RefreshToken refreshes the access token using the refresh token
func (*APIClient) Register ¶
func (c *APIClient) Register(ctx context.Context, username, password, email string) (*AuthResponse, error)
Register registers a new user and returns an authentication response
func (*APIClient) RemoveContainer ¶
RemoveContainer removes a container with optional force flag
func (*APIClient) RemoveImage ¶
RemoveImage removes an image with optional force flag
func (*APIClient) RemoveNetwork ¶
RemoveNetwork removes a network
func (*APIClient) RemoveVolume ¶
RemoveVolume removes a volume with optional force flag
func (*APIClient) RenameContainer ¶
RenameContainer renames a container
func (*APIClient) ResizeContainerTTY ¶
ResizeContainerTTY resizes the TTY of a running container
func (*APIClient) RestartComposeService ¶
RestartComposeService restarts a service in a Compose deployment
func (*APIClient) RestartContainer ¶
RestartContainer restarts a container with optional timeout
func (*APIClient) ScaleComposeService ¶
func (c *APIClient) ScaleComposeService(ctx context.Context, id string, service string, replicas int) error
ScaleComposeService scales a service in a Compose deployment
func (*APIClient) SearchImages ¶
func (c *APIClient) SearchImages(ctx context.Context, term string, limit int) ([]registry.SearchResult, error)
SearchImages searches for images in registries
func (*APIClient) StartContainer ¶
StartContainer starts a container
func (*APIClient) StopContainer ¶
StopContainer stops a container with optional timeout
func (*APIClient) UnmountVolume ¶
UnmountVolume unmounts a volume Note: This is a higher-level operation that is not directly supported by the Docker API It stops and removes any containers using the volume
func (*APIClient) UnpauseContainer ¶
UnpauseContainer unpauses a container
func (*APIClient) UpdateContainer ¶
func (c *APIClient) UpdateContainer(ctx context.Context, id string, updateConfig *container.UpdateConfig) (*models.Container, error)
UpdateContainer updates the configuration of a container
func (*APIClient) UpdateCurrentUser ¶
UpdateCurrentUser updates the current user's profile
func (*APIClient) UpdateNetwork ¶
func (c *APIClient) UpdateNetwork(ctx context.Context, id string, options *models.NetworkUpdateOptions) error
UpdateNetwork updates a network's configuration
func (*APIClient) UpdateVolume ¶
UpdateVolume updates a volume's metadata
func (*APIClient) UploadComposeFile ¶
func (c *APIClient) UploadComposeFile(ctx context.Context, content io.Reader, filename string) (string, error)
UploadComposeFile uploads a Compose file to the server
func (*APIClient) ValidateComposeFile ¶
ValidateComposeFile validates a Compose file
func (*APIClient) WaitContainer ¶
WaitContainer waits for a container to reach a certain condition
type AuthResponse ¶
type AuthResponse = models.TokenResponse
AuthResponse represents the response from authentication endpoints Using models.TokenResponse structure now
type Client ¶
type Client interface {
// Authentication
Login(ctx context.Context, username, password string) (*AuthResponse, error) // Uses models.TokenResponse via alias
Register(ctx context.Context, username, password, email string) (*AuthResponse, error) // Uses models.TokenResponse via alias
RefreshToken(ctx context.Context) (*AuthResponse, error) // Uses models.TokenResponse via alias
Logout(ctx context.Context) error
// Health check
Health(ctx context.Context) (map[string]interface{}, error)
// User management
GetCurrentUser(ctx context.Context) (*models.UserResponse, error) // Return UserResponse
UpdateCurrentUser(ctx context.Context, user *models.User) (*models.User, error)
ChangePassword(ctx context.Context, oldPassword, newPassword string) error
// Containers
ListContainers(ctx context.Context, filters map[string]string) ([]models.Container, error)
GetContainer(ctx context.Context, id string) (*models.Container, error)
CreateContainer(ctx context.Context, req *models.ContainerCreateRequest) (*models.Container, error)
StartContainer(ctx context.Context, id string) error
StopContainer(ctx context.Context, id string, timeout *int) error
RestartContainer(ctx context.Context, id string, timeout *int) error
PauseContainer(ctx context.Context, id string) error
UnpauseContainer(ctx context.Context, id string) error
RemoveContainer(ctx context.Context, id string, force bool) error
// Container operations
GetContainerLogs(ctx context.Context, id string, options map[string]string) (io.ReadCloser, error)
GetContainerStats(ctx context.Context, id string) (*models.ContainerStats, error)
GetContainerProcesses(ctx context.Context, id string) ([][]string, error)
// Exec
ExecCreate(ctx context.Context, containerID string, req *models.ContainerExecCreateRequest) (string, error)
ExecStart(ctx context.Context, execID string, interactive bool) (io.ReadWriteCloser, error)
ExecResize(ctx context.Context, execID string, height, width uint) error
// Images
ListImages(ctx context.Context, filters map[string]string) ([]models.Image, error)
GetImage(ctx context.Context, id string) (*models.Image, error)
PullImage(ctx context.Context, ref string, auth *registrytypes.AuthConfig) error
BuildImage(ctx context.Context, options *models.ImageBuildRequest) (string, error)
RemoveImage(ctx context.Context, id string, force bool) error
TagImage(ctx context.Context, id, repo, tag string) error
// Volumes
ListVolumes(ctx context.Context, filters map[string]string) ([]models.Volume, error)
GetVolume(ctx context.Context, name string) (*models.Volume, error)
CreateVolume(ctx context.Context, options *models.VolumeCreateRequest) (*models.Volume, error)
RemoveVolume(ctx context.Context, name string, force bool) error
// Networks
ListNetworks(ctx context.Context, filters map[string]string) ([]models.Network, error)
GetNetwork(ctx context.Context, id string) (*models.Network, error)
CreateNetwork(ctx context.Context, options *models.NetworkCreateRequest) (*models.Network, error)
RemoveNetwork(ctx context.Context, id string) error
ConnectContainerToNetwork(ctx context.Context, networkID, containerID string, config *networktypes.EndpointSettings) error
DisconnectContainerFromNetwork(ctx context.Context, networkID, containerID string, force bool) error
// Compose
ComposeUp(ctx context.Context, files []io.Reader, options interface{}) (string, error) // Placeholder type
ComposeDown(ctx context.Context, id string, options interface{}) error // Placeholder type
GetComposeStatus(ctx context.Context, id string) (*models.ComposeDeploymentResponse, error) // Use models type
ListComposeDeployments(ctx context.Context) ([]models.ComposeDeployment, error) // Use models type
// System
GetSystemInfo(ctx context.Context) (*models.SystemInfoResponse, error) // Use models type
GetEvents(ctx context.Context, since, until time.Time, filters map[string]string) (<-chan models.DockerEvent, <-chan error) // Use models.DockerEvent
// Raw HTTP
Do(ctx context.Context, req *http.Request) (*http.Response, error)
}
Client defines the interface for the Docker Server Manager API client Uses types from internal/models
type ClientConfig ¶
type ClientConfig struct {
BaseURL string
Timeout time.Duration
MaxRetries int
RetryDelay time.Duration
UserAgent string
AccessToken string
RefreshToken string
HTTPClient *http.Client
Headers map[string]string
AutoRefresh bool
TLSInsecureSkipVerify bool
}
ClientConfig represents the configuration for the client
func DefaultClientConfig ¶
func DefaultClientConfig() ClientConfig
DefaultClientConfig returns the default client configuration
type ClientOption ¶
type ClientOption func(*ClientConfig) error
ClientOption represents a functional option for configuring the client
func WithAccessToken ¶
func WithAccessToken(token string) ClientOption
WithAccessToken sets the initial access token
func WithAutoRefresh ¶
func WithAutoRefresh(autoRefresh bool) ClientOption
WithAutoRefresh sets the auto refresh option
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient sets a custom HTTP client
func WithRefreshToken ¶
func WithRefreshToken(token string) ClientOption
WithRefreshToken sets the initial refresh token
func WithRetryOptions ¶
func WithRetryOptions(maxRetries int, retryDelay time.Duration) ClientOption
WithRetryOptions sets the retry options
func WithTLSInsecureSkipVerify ¶
func WithTLSInsecureSkipVerify(skip bool) ClientOption
WithTLSInsecureSkipVerify sets the TLS insecure skip verify option
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout sets the timeout
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
WithUserAgent sets the user agent
type ContainerListOptions ¶
ContainerListOptions represents options for listing containers
type ContainerLogOptions ¶
type ContainerLogOptions struct {
ShowStdout bool
ShowStderr bool
Since string
Until string
Timestamps bool
Follow bool
Tail string
Details bool
}
ContainerLogOptions represents options for getting container logs
type ExecStartOptions ¶
ExecStartOptions represents options for starting an exec instance
type ImageBuildOptions ¶
type ImageBuildOptions struct {
Repository string `json:"repository"`
Tag string `json:"tag"`
Dockerfile string `json:"dockerfile"`
Context io.Reader `json:"-"` // Build context stream
BuildArgs map[string]string `json:"build_args"`
Labels map[string]string `json:"labels"`
NoCache bool `json:"no_cache"`
Pull bool `json:"pull"`
RemoveAfter bool `json:"remove_after"` // Corresponds to 'rm' in Docker API
ForceRemove bool `json:"force_remove"` // Corresponds to 'forcerm' in Docker API
Target string `json:"target"`
Platform string `json:"platform"`
ExtraHosts []string `json:"extra_hosts"`
NetworkMode string `json:"network_mode"`
CgroupParent string `json:"cgroup_parent"`
ShmSize int64 `json:"shm_size"`
Memory int64 `json:"memory"`
MemorySwap int64 `json:"memory_swap"`
CPUSetCPUs string `json:"cpuset_cpus"`
CPUSetMems string `json:"cpuset_mems"`
CPUPeriod int64 `json:"cpu_period"`
CPUQuota int64 `json:"cpu_quota"`
BuildID string `json:"build_id"`
Secrets []map[string]string `json:"secrets"`
CacheFrom []string `json:"cache_from"`
SecurityOpt []string `json:"security_opt"`
NetworkConfig map[string]string `json:"network_config"`
Squash bool `json:"squash"`
AuthConfigs map[string]registry.AuthConfig `json:"auth_configs"` // Use registry.AuthConfig
OutputFormat string `json:"output_format"`
BuildContextID string `json:"build_context_id"`
}
ImageBuildOptions represents options for building images Note: This mirrors models.ImageBuildRequest but includes io.Reader for context
type ImageListOptions ¶
ImageListOptions represents options for listing images
type ImagePullOptions ¶
type ImagePullOptions struct {
Registry string
Repository string
Tag string
Platform string
Auth *registry.AuthConfig // Use registry.AuthConfig
RegistryAuth interface{}
}
ImagePullOptions represents options for pulling images
type LoginRequest ¶
LoginRequest represents the request body for a login request
type NetworkListOptions ¶
NetworkListOptions represents options for listing networks
type PasswordChangeRequest ¶
type PasswordChangeRequest struct {
OldPassword string `json:"oldPassword"`
NewPassword string `json:"newPassword"`
}
PasswordChangeRequest represents the request body for a password change
type RegisterRequest ¶
type RegisterRequest struct {
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
}
RegisterRequest represents the request body for a register request
type VolumeListOptions ¶
VolumeListOptions represents options for listing volumes