Documentation
¶
Index ¶
- func Compose(conn *synology.Connection, opts *ComposeOptions) error
- func ConnectContainerToNetwork(conn *synology.Connection, networkName, containerName string, ...) error
- func Container(conn *synology.Connection, opts *ContainerOptions) (string, error)
- func CreateNetwork(conn *synology.Connection, networkName string, opts *NetworkCreateOptions) (string, error)
- func CreateVolume(conn *synology.Connection, volumeName string, opts *VolumeCreateOptions) (string, error)
- func DisconnectContainerFromNetwork(conn *synology.Connection, networkName, containerName string, ...) error
- func ExecCommand(conn *synology.Connection, nameOrID string, command []string, ...) (string, error)
- func ExecInteractive(conn *synology.Connection, nameOrID string, command []string, ...) error
- func ExportContainer(conn *synology.Connection, containerName string, opts *ExportOptions) error
- func FollowContainerLogs(conn *synology.Connection, nameOrID, tail, since string, timestamps bool, ...) error
- func GenerateProjectName(composePath string) string
- func GetContainerLogs(conn *synology.Connection, nameOrID, tail, since string, timestamps bool) (string, error)
- func GetDockerClient() (*client.Client, error)
- func GetSystemInfo(conn *synology.Connection, opts *SystemInfoOptions) (string, error)
- func ImportImage(conn *synology.Connection, source, repository string, opts *ImportOptions) (string, error)
- func InspectNetwork(conn *synology.Connection, networkName string, opts *NetworkInspectOptions) (string, error)
- func InspectObject(conn *synology.Connection, objectName string, opts *InspectOptions) (string, error)
- func InspectVolume(conn *synology.Connection, volumeName string, opts *VolumeInspectOptions) (string, error)
- func ListImageIDs(conn *synology.Connection, repository string, opts *ImagesOptions) ([]string, error)
- func ListNetworkIDs(conn *synology.Connection, opts *NetworkListOptions) ([]string, error)
- func ListVolumeNames(conn *synology.Connection, opts *VolumeListOptions) ([]string, error)
- func PullImage(conn *synology.Connection, imageName string, opts *PullOptions) error
- func RemoveContainer(conn *synology.Connection, nameOrID string, force bool) error
- func RemoveImage(conn *synology.Connection, imageName string, opts *RmiOptions) error
- func RemoveNetwork(conn *synology.Connection, networkName string) error
- func RemoveVolume(conn *synology.Connection, volumeName string, opts *VolumeRemoveOptions) error
- func RestartContainer(conn *synology.Connection, nameOrID string, timeout int) error
- func ShowContainerStats(conn *synology.Connection, containers []string, opts *StatsOptions) error
- func StartContainer(conn *synology.Connection, nameOrID string) error
- func StopContainer(conn *synology.Connection, nameOrID string, timeout int) error
- func TestDockerConnection(conn *synology.Connection) error
- type ComposeFile
- type ComposeOptions
- type ComposeService
- type ContainerInfo
- type ContainerOptions
- type ExecOptions
- type ExportOptions
- type ImageInfo
- type ImagesOptions
- type ImportOptions
- type InspectOptions
- type NetworkConnectOptions
- type NetworkCreateOptions
- type NetworkDisconnectOptions
- type NetworkInfo
- type NetworkInspectOptions
- type NetworkListOptions
- type NetworkPruneOptions
- type NetworkPruneResult
- type PullOptions
- type RmiOptions
- type StatsOptions
- type SystemDfItem
- type SystemDfOptions
- type SystemInfoOptions
- type SystemPruneOptions
- type SystemPruneResult
- type VolumeCreateOptions
- type VolumeInfo
- type VolumeInspectOptions
- type VolumeListOptions
- type VolumePruneOptions
- type VolumePruneResult
- type VolumeRemoveOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compose ¶
func Compose(conn *synology.Connection, opts *ComposeOptions) error
Compose deploys a docker-compose file to the Synology NAS
func ConnectContainerToNetwork ¶ added in v0.2.1
func ConnectContainerToNetwork(conn *synology.Connection, networkName, containerName string, opts *NetworkConnectOptions) error
ConnectContainerToNetwork connects a container to a network
func Container ¶
func Container(conn *synology.Connection, opts *ContainerOptions) (string, error)
Container deploys a container using direct Docker commands over SSH
func CreateNetwork ¶ added in v0.2.1
func CreateNetwork(conn *synology.Connection, networkName string, opts *NetworkCreateOptions) (string, error)
CreateNetwork creates a Docker network
func CreateVolume ¶ added in v0.2.0
func CreateVolume(conn *synology.Connection, volumeName string, opts *VolumeCreateOptions) (string, error)
CreateVolume creates a Docker volume
func DisconnectContainerFromNetwork ¶ added in v0.2.1
func DisconnectContainerFromNetwork(conn *synology.Connection, networkName, containerName string, opts *NetworkDisconnectOptions) error
DisconnectContainerFromNetwork disconnects a container from a network
func ExecCommand ¶ added in v0.2.0
func ExecCommand(conn *synology.Connection, nameOrID string, command []string, opts *ExecOptions) (string, error)
ExecCommand executes a command in a container and returns output
func ExecInteractive ¶ added in v0.2.0
func ExecInteractive(conn *synology.Connection, nameOrID string, command []string, opts *ExecOptions) error
ExecInteractive executes an interactive command in a container
func ExportContainer ¶ added in v0.2.0
func ExportContainer(conn *synology.Connection, containerName string, opts *ExportOptions) error
ExportContainer exports a container's filesystem as a tar archive
func FollowContainerLogs ¶ added in v0.2.0
func FollowContainerLogs(conn *synology.Connection, nameOrID, tail, since string, timestamps bool, stdout, stderr io.Writer) error
FollowContainerLogs follows container logs in real-time
func GenerateProjectName ¶
GenerateProjectName generates a project name from a compose file path
func GetContainerLogs ¶ added in v0.2.0
func GetContainerLogs(conn *synology.Connection, nameOrID, tail, since string, timestamps bool) (string, error)
GetContainerLogs retrieves container logs
func GetDockerClient ¶
GetDockerClient returns a placeholder - not used in simple implementation
func GetSystemInfo ¶ added in v0.2.0
func GetSystemInfo(conn *synology.Connection, opts *SystemInfoOptions) (string, error)
GetSystemInfo gets Docker system information
func ImportImage ¶ added in v0.2.0
func ImportImage(conn *synology.Connection, source, repository string, opts *ImportOptions) (string, error)
ImportImage imports the contents from a tarball to create a filesystem image
func InspectNetwork ¶ added in v0.2.1
func InspectNetwork(conn *synology.Connection, networkName string, opts *NetworkInspectOptions) (string, error)
InspectNetwork inspects a Docker network
func InspectObject ¶ added in v0.2.0
func InspectObject(conn *synology.Connection, objectName string, opts *InspectOptions) (string, error)
InspectObject inspects a Docker object (container, image, volume, network)
func InspectVolume ¶ added in v0.2.0
func InspectVolume(conn *synology.Connection, volumeName string, opts *VolumeInspectOptions) (string, error)
InspectVolume inspects a Docker volume
func ListImageIDs ¶ added in v0.2.0
func ListImageIDs(conn *synology.Connection, repository string, opts *ImagesOptions) ([]string, error)
ListImageIDs lists Docker image IDs only
func ListNetworkIDs ¶ added in v0.2.1
func ListNetworkIDs(conn *synology.Connection, opts *NetworkListOptions) ([]string, error)
ListNetworkIDs lists Docker network IDs only
func ListVolumeNames ¶ added in v0.2.0
func ListVolumeNames(conn *synology.Connection, opts *VolumeListOptions) ([]string, error)
ListVolumeNames lists Docker volume names only
func PullImage ¶ added in v0.2.0
func PullImage(conn *synology.Connection, imageName string, opts *PullOptions) error
PullImage pulls a Docker image
func RemoveContainer ¶
func RemoveContainer(conn *synology.Connection, nameOrID string, force bool) error
RemoveContainer removes a container using direct Docker commands
func RemoveImage ¶ added in v0.2.0
func RemoveImage(conn *synology.Connection, imageName string, opts *RmiOptions) error
RemoveImage removes a Docker image
func RemoveNetwork ¶ added in v0.2.1
func RemoveNetwork(conn *synology.Connection, networkName string) error
RemoveNetwork removes a Docker network
func RemoveVolume ¶ added in v0.2.0
func RemoveVolume(conn *synology.Connection, volumeName string, opts *VolumeRemoveOptions) error
RemoveVolume removes a Docker volume
func RestartContainer ¶ added in v0.2.0
func RestartContainer(conn *synology.Connection, nameOrID string, timeout int) error
RestartContainer restarts a container
func ShowContainerStats ¶ added in v0.2.0
func ShowContainerStats(conn *synology.Connection, containers []string, opts *StatsOptions) error
ShowContainerStats displays container resource usage statistics
func StartContainer ¶ added in v0.2.0
func StartContainer(conn *synology.Connection, nameOrID string) error
StartContainer starts a stopped container
func StopContainer ¶ added in v0.2.0
func StopContainer(conn *synology.Connection, nameOrID string, timeout int) error
StopContainer stops a running container
func TestDockerConnection ¶
func TestDockerConnection(conn *synology.Connection) error
TestDockerConnection tests Docker availability over SSH
Types ¶
type ComposeFile ¶
type ComposeFile struct {
Version string `yaml:"version,omitempty"`
Services map[string]ComposeService `yaml:"services"`
Networks map[string]interface{} `yaml:"networks,omitempty"`
Volumes map[string]interface{} `yaml:"volumes,omitempty"`
}
ComposeFile represents a complete docker-compose file structure
type ComposeOptions ¶
ComposeOptions represents options for deploying a compose file
type ComposeService ¶
type ComposeService struct {
Image string `yaml:"image,omitempty"`
Build interface{} `yaml:"build,omitempty"`
Ports []string `yaml:"ports,omitempty"`
Volumes []string `yaml:"volumes,omitempty"`
Environment interface{} `yaml:"environment,omitempty"`
Restart string `yaml:"restart,omitempty"`
Networks interface{} `yaml:"networks,omitempty"`
DependsOn interface{} `yaml:"depends_on,omitempty"`
Command interface{} `yaml:"command,omitempty"`
WorkingDir string `yaml:"working_dir,omitempty"`
User string `yaml:"user,omitempty"`
Hostname string `yaml:"hostname,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
}
ComposeService represents a service in a docker-compose file
type ContainerInfo ¶
ContainerInfo represents container information
func ListContainers ¶
func ListContainers(conn *synology.Connection, all bool) ([]ContainerInfo, error)
ListContainers lists containers using direct Docker commands
type ContainerOptions ¶
type ContainerOptions struct {
Image string
Name string
Ports []string // ["8080:80", "443:443"]
Volumes []string // ["/volume1/data:/app/data"]
Env []string // ["KEY=value"]
Restart string // "unless-stopped"
NetworkMode string
WorkingDir string
Command []string
User string
}
ContainerOptions defines options for container deployment
func NewContainerOptions ¶
func NewContainerOptions(image string) *ContainerOptions
NewContainerOptions creates new container options with defaults
type ExecOptions ¶ added in v0.2.0
ExecOptions defines options for executing commands in containers
type ExportOptions ¶ added in v0.2.0
type ExportOptions struct {
Output string
}
ExportOptions defines options for exporting containers
type ImageInfo ¶ added in v0.2.0
type ImageInfo struct {
Repository string
Tag string
Digest string
ID string
Created string
Size string
}
ImageInfo represents Docker image information
func ListImages ¶ added in v0.2.0
func ListImages(conn *synology.Connection, repository string, opts *ImagesOptions) ([]ImageInfo, error)
ListImages lists Docker images
type ImagesOptions ¶ added in v0.2.0
type ImagesOptions struct {
All bool
Dangling bool
Digests bool
Format string
NoTrunc bool
Quiet bool
}
ImagesOptions defines options for listing images
type ImportOptions ¶ added in v0.2.0
ImportOptions defines options for importing images
type InspectOptions ¶ added in v0.2.0
InspectOptions defines options for inspecting objects
type NetworkConnectOptions ¶ added in v0.2.1
NetworkConnectOptions defines options for connecting containers to networks
type NetworkCreateOptions ¶ added in v0.2.1
type NetworkCreateOptions struct {
Driver string
DriverOpts []string
Gateway []string
IPRange []string
IPAM []string
Subnet []string
Labels []string
Attachable bool
Ingress bool
Internal bool
IPv6 bool
}
NetworkCreateOptions defines options for creating networks
type NetworkDisconnectOptions ¶ added in v0.2.1
type NetworkDisconnectOptions struct {
Force bool
}
NetworkDisconnectOptions defines options for disconnecting containers from networks
type NetworkInfo ¶ added in v0.2.1
NetworkInfo represents Docker network information
func ListNetworks ¶ added in v0.2.1
func ListNetworks(conn *synology.Connection, opts *NetworkListOptions) ([]NetworkInfo, error)
ListNetworks lists Docker networks
type NetworkInspectOptions ¶ added in v0.2.1
type NetworkInspectOptions struct {
Format string
}
NetworkInspectOptions defines options for inspecting networks
type NetworkListOptions ¶ added in v0.2.1
NetworkListOptions defines options for listing networks
type NetworkPruneOptions ¶ added in v0.2.1
NetworkPruneOptions defines options for pruning networks
type NetworkPruneResult ¶ added in v0.2.1
NetworkPruneResult represents the result of network prune
func PruneNetworks ¶ added in v0.2.1
func PruneNetworks(conn *synology.Connection, opts *NetworkPruneOptions) (*NetworkPruneResult, error)
PruneNetworks removes unused Docker networks
type PullOptions ¶ added in v0.2.0
PullOptions defines options for pulling images
type RmiOptions ¶ added in v0.2.0
RmiOptions defines options for removing images
type StatsOptions ¶ added in v0.2.0
StatsOptions defines options for container stats
type SystemDfItem ¶ added in v0.2.0
SystemDfItem represents disk usage information
func GetSystemDf ¶ added in v0.2.0
func GetSystemDf(conn *synology.Connection, opts *SystemDfOptions) ([]SystemDfItem, error)
GetSystemDf gets Docker system disk usage
type SystemDfOptions ¶ added in v0.2.0
SystemDfOptions defines options for system df
type SystemInfoOptions ¶ added in v0.2.0
type SystemInfoOptions struct {
Format string
}
SystemInfoOptions defines options for system info
type SystemPruneOptions ¶ added in v0.2.0
SystemPruneOptions defines options for system prune
type SystemPruneResult ¶ added in v0.2.0
type SystemPruneResult struct {
ContainersDeleted int
ImagesDeleted int
NetworksDeleted int
VolumesDeleted int
SpaceReclaimed string
}
SystemPruneResult represents the result of system prune
func SystemPrune ¶ added in v0.2.0
func SystemPrune(conn *synology.Connection, opts *SystemPruneOptions) (*SystemPruneResult, error)
SystemPrune removes unused Docker data
type VolumeCreateOptions ¶ added in v0.2.0
VolumeCreateOptions defines options for creating volumes
type VolumeInfo ¶ added in v0.2.0
VolumeInfo represents Docker volume information
func ListVolumes ¶ added in v0.2.0
func ListVolumes(conn *synology.Connection, opts *VolumeListOptions) ([]VolumeInfo, error)
ListVolumes lists Docker volumes
type VolumeInspectOptions ¶ added in v0.2.0
type VolumeInspectOptions struct {
Format string
}
VolumeInspectOptions defines options for inspecting volumes
type VolumeListOptions ¶ added in v0.2.0
VolumeListOptions defines options for listing volumes
type VolumePruneOptions ¶ added in v0.2.0
VolumePruneOptions defines options for pruning volumes
type VolumePruneResult ¶ added in v0.2.0
VolumePruneResult represents the result of volume prune
func PruneVolumes ¶ added in v0.2.0
func PruneVolumes(conn *synology.Connection, opts *VolumePruneOptions) (*VolumePruneResult, error)
PruneVolumes removes unused Docker volumes
type VolumeRemoveOptions ¶ added in v0.2.0
type VolumeRemoveOptions struct {
Force bool
}
VolumeRemoveOptions defines options for removing volumes