localapi

package
v5.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfImageBuildPathsOnRunningMachine

func CheckIfImageBuildPathsOnRunningMachine(ctx context.Context, containerFiles []string, options entities.BuildOptions) ([]string, entities.BuildOptions, bool)

CheckIfImageBuildPathsOnRunningMachine checks if the build context directory and all specified Containerfiles are available on the running machine. If they are, it translates their paths to the corresponding remote paths and returns them along with a flag indicating success.

func FindMachineByPort

func FindMachineByPort(connectionURI string, parsedConnection *url.URL) (*vmconfigs.MachineConfig, vmconfigs.VMProvider, error)

FindMachineByPort finds a running machine that matches the given connection port. It returns the machine configuration and provider, or an error if not found.

func IsHyperVProvider

func IsHyperVProvider(ctx context.Context) (bool, error)

IsHyperVProvider checks if the current machine provider is Hyper-V. It returns true if the provider is Hyper-V, false otherwise, or an error if the check fails.

func ValidatePathForLocalAPI

func ValidatePathForLocalAPI(path string) error

ValidatePathForLocalAPI checks if the provided path satisfies requirements for local API usage. It returns an error if the path is not absolute or does not exist on the filesystem.

Types

type LocalAPIMap

type LocalAPIMap struct {
	ClientPath string `json:"ClientPath,omitempty"`
	RemotePath string `json:"RemotePath,omitempty"`
}

LocalAPIMap is a map of local paths to their target paths in the VM

func CheckPathOnRunningMachine

func CheckPathOnRunningMachine(ctx context.Context, path string) (*LocalAPIMap, bool)

CheckPathOnRunningMachine is a convenience function that checks if a path is available on any currently running machine. It combines machine inspection and path checking.

Jump to

Keyboard shortcuts

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