Documentation
¶
Index ¶
- Constants
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) Connect() error
- func (c *Connection) ExecuteCommand(cmd string) (string, error)
- func (c *Connection) ExecuteDockerCommand(args []string) (string, error)
- func (c *Connection) GetDockerClient() *client.Client
- func (c *Connection) StreamCommand(cmd string, stdout, stderr io.Writer) error
- func (c *Connection) TestConnection() error
Constants ¶
View Source
const ( // ServiceName is the Container Manager service name in DSM 7.2+ ServiceName = "pkg-ContainerManager-dockerd" // ConfigPath is the path to Container Manager configuration ConfigPath = "/var/packages/ContainerManager/etc/dockerd.json" // DockerBinary is the full path to the Docker binary DockerBinary = "/usr/local/bin/docker" // SocketPath is the path to the Docker socket SocketPath = "/var/run/docker.sock" // RestartCommand is the command to restart Container Manager RestartCommand = "sudo systemctl restart pkg-ContainerManager-dockerd" // DefaultVolume is the default volume path DefaultVolume = "/volume1/docker" // DefaultSSHPort is the default SSH port for Synology DefaultSSHPort = 22 // DefaultSSHUser is the default SSH username DefaultSSHUser = "admin" // DefaultRestartPolicy is the default container restart policy DefaultRestartPolicy = "unless-stopped" // DefaultNetwork is the default Docker network mode DefaultNetwork = "bridge" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents a connection to a Synology NAS
func NewConnection ¶
func NewConnection(cfg *config.Config) *Connection
NewConnection creates a new connection with the given configuration
func (*Connection) Close ¶
func (c *Connection) Close() error
Close closes the connection and cleans up resources
func (*Connection) Connect ¶
func (c *Connection) Connect() error
Connect establishes the SSH connection to the Synology NAS
func (*Connection) ExecuteCommand ¶
func (c *Connection) ExecuteCommand(cmd string) (string, error)
ExecuteCommand executes a command over SSH and returns the output
func (*Connection) ExecuteDockerCommand ¶
func (c *Connection) ExecuteDockerCommand(args []string) (string, error)
ExecuteDockerCommand executes a Docker command with full path
func (*Connection) GetDockerClient ¶
func (c *Connection) GetDockerClient() *client.Client
GetDockerClient returns the Docker client (nil in v0.1.x)
func (*Connection) StreamCommand ¶
func (c *Connection) StreamCommand(cmd string, stdout, stderr io.Writer) error
StreamCommand executes a command and streams output to writers
func (*Connection) TestConnection ¶
func (c *Connection) TestConnection() error
TestConnection tests SSH and Docker connectivity
Click to show internal directories.
Click to hide internal directories.