utils

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultSSHKeyName is the default SSH key filename
	DefaultSSHKeyName = "id_rsa"
	// DefaultSSHPort is the default SSH port
	DefaultSSHPort = 22
)

Variables

This section is empty.

Functions

func FindSSHKey

func FindSSHKey() (string, error)

FindSSHKey finds the first available SSH key in the user's .ssh directory

func NormalizeHost

func NormalizeHost(host string) string

NormalizeHost normalizes a hostname by removing protocols and extra characters

func ParseHostPort

func ParseHostPort(hostPort string) (host string, port int, err error)

ParseHostPort parses a host:port string and returns the host and port

func ValidateContainerName

func ValidateContainerName(name string) error

ValidateContainerName validates a Docker container name format

func ValidateDockerImage

func ValidateDockerImage(image string) error

ValidateDockerImage validates a Docker image name format

func ValidateEnvironmentVariable

func ValidateEnvironmentVariable(envVar string) error

ValidateEnvironmentVariable validates an environment variable (KEY=value format)

func ValidateHostname

func ValidateHostname(hostname string) error

ValidateHostname validates a hostname or IP address format

func ValidatePortMapping

func ValidatePortMapping(portMapping string) error

ValidatePortMapping validates a port mapping string (host:container format)

func ValidateRestartPolicy

func ValidateRestartPolicy(policy string) error

ValidateRestartPolicy validates a Docker restart policy

func ValidateSSHKey

func ValidateSSHKey(keyPath string) error

ValidateSSHKey validates that an SSH key file exists and is parseable

func ValidateSynologyPath

func ValidateSynologyPath(path string) error

ValidateSynologyPath validates that a path is under a valid Synology volume

func ValidateVolumeMapping

func ValidateVolumeMapping(volumeMapping string) error

ValidateVolumeMapping validates a volume mapping string (host:container format)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL