Documentation ¶
Index ¶
- func CheckIfPortAvailable(port int) error
- func Contains[T comparable](vs []T, x T) bool
- func CreateContainerName(serviceContainerName string, dockerNetwork string) string
- func CreateDirectory(dir string) error
- func FindFileInDir(dirPath, fileName string) (string, error)
- func GetAbsPath(baseDir, path string) string
- func GetContainerRuntimeCmd(containerRuntime string) string
- func GetDefaultRegistry(githubContainerRegistryName, dockerContainerRegistryName string) (string, error)
- func GetEnv(envName string, defaultValue string) string
- func GetSocket(path, appID, protocol string) string
- func GetVariantVersion(version, imageVariant string) string
- func GetVersionAndImageVariant(imageTag string) (string, string)
- func IsAddressLegal(address string) bool
- func IsDaprListeningOnPort(port int, timeout time.Duration) error
- func IsDaprListeningOnSocket(socket string, timeout time.Duration) error
- func IsDockerInstalled() bool
- func IsPodmanInstalled() bool
- func IsValidContainerRuntime(containerRuntime string) bool
- func MarshalAndWriteTable(writer io.Writer, in interface{}) error
- func PrintDetail(writer io.Writer, outputFormat string, list interface{}) error
- func PrintTable(csvContent string)
- func ReadFile(filePath string) ([]byte, error)
- func RunCmdAndWait(name string, args ...string) (string, error)
- func TruncateString(str string, maxLength int) string
- func ValidateFilePath(filePath string) error
- func ValidateImageVariant(imageVariant string) error
- func WriteTable(writer io.Writer, csvContent string)
- type ContainerRuntime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfPortAvailable ¶ added in v1.10.0
CheckIfPortAvailable returns an error if the port is not available else returns nil.
func Contains ¶ added in v1.9.0
func Contains[T comparable](vs []T, x T) bool
Contains returns true if vs contains x.
func CreateContainerName ¶ added in v0.2.0
func CreateDirectory ¶ added in v0.3.0
func FindFileInDir ¶ added in v1.10.0
FindFileInDir finds and returns the path of the given file name in the given directory.
func GetAbsPath ¶ added in v1.10.0
GetAbsPath returns the absolute path of the given file path and base directory.
func GetContainerRuntimeCmd ¶ added in v1.9.0
GetContainerRuntimeCmd returns a valid container runtime to be used by CLI operations. If the input is a valid container runtime, it is returned as is. Otherwise the default container runtime, docker, is returned.
func GetDefaultRegistry ¶ added in v1.7.0
func GetVariantVersion ¶ added in v1.9.0
func GetVersionAndImageVariant ¶ added in v1.10.0
Returns image version and variant. Expected imageTag format: <version>-<variant>, i.e. 1.0.0-mariner or 1.0.0-rc.1-mariner.
func IsAddressLegal ¶ added in v1.4.0
func IsDaprListeningOnPort ¶ added in v0.11.0
IsDaprListeningOnPort checks if Dapr is litening to a given port.
func IsDaprListeningOnSocket ¶ added in v1.5.0
func IsDockerInstalled ¶ added in v0.8.0
func IsDockerInstalled() bool
IsDockerInstalled checks whether docker is installed/running.
func IsPodmanInstalled ¶ added in v1.9.0
func IsPodmanInstalled() bool
func IsValidContainerRuntime ¶ added in v1.9.0
IsValidContainerRuntime checks if the input is a valid container runtime. Valid container runtimes are docker and podman.
func MarshalAndWriteTable ¶ added in v1.0.0
func PrintDetail ¶ added in v1.0.0
func TruncateString ¶
func ValidateFilePath ¶ added in v1.10.0
Returns true if the given file path is valid.
func ValidateImageVariant ¶ added in v1.9.0
func WriteTable ¶ added in v1.0.0
WriteTable writes the csv table to writer.
Types ¶
type ContainerRuntime ¶ added in v1.9.0
type ContainerRuntime string
const ( DOCKER ContainerRuntime = "docker" PODMAN ContainerRuntime = "podman" )