Documentation ¶
Index ¶
- func AttachJobObjectToProcess(pid string, proc *os.Process)
- 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 GetJobObjectNameFromPID(pid 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 IsContainerRuntimeInstalled(containerRuntime string) bool
- func IsDaprListeningOnPort(port int, timeout time.Duration) error
- func IsDaprListeningOnSocket(socket string, timeout time.Duration) error
- 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 ResolveHomeDir(filePath string) (string, error)
- func RunCmdAndWait(name string, args ...string) (string, error)
- func SanitizeDir(destDir string) string
- 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 AttachJobObjectToProcess ¶
Attach Job object to App Process.
func CheckIfPortAvailable ¶
CheckIfPortAvailable returns an error if the port is not available else returns nil.
func Contains ¶
func Contains[T comparable](vs []T, x T) bool
Contains returns true if vs contains x.
func CreateContainerName ¶
func CreateDirectory ¶
func FindFileInDir ¶
FindFileInDir finds and returns the path of the given file name in the given directory.
func GetAbsPath ¶
GetAbsPath returns the absolute path of the given file path and base directory.
func GetContainerRuntimeCmd ¶
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 ¶
func GetJobObjectNameFromPID ¶
GetJobObjectNameFromPID returns the name of the Windows job object that is used to manage the Daprized app's processes on windows.
func GetVariantVersion ¶
func GetVersionAndImageVariant ¶
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 ¶
func IsContainerRuntimeInstalled ¶
IsContainerRuntimeInstalled checks whether the given container runtime is installed. If the container runtime is unsupported, false is returned.
func IsDaprListeningOnPort ¶
IsDaprListeningOnPort checks if Dapr is litening to a given port.
func IsDaprListeningOnSocket ¶
func IsValidContainerRuntime ¶
IsValidContainerRuntime checks if the input is a valid container runtime. Valid container runtimes are docker and podman.
func MarshalAndWriteTable ¶
func ResolveHomeDir ¶
ResolveHomeDir resolves prefix of the given path, if present, to the user's home directory and returns it.
func SanitizeDir ¶
SanitizeDir sanitizes the input string to make it a valid directory.
func TruncateString ¶
func ValidateFilePath ¶
Returns true if the given file path is valid.
func ValidateImageVariant ¶
func WriteTable ¶
WriteTable writes the csv table to writer.
Types ¶
type ContainerRuntime ¶
type ContainerRuntime string
const ( DOCKER ContainerRuntime = "docker" PODMAN ContainerRuntime = "podman" // DefaultAppChannelAddress is the default local network address that user application listen on. DefaultAppChannelAddress = "127.0.0.1" )