utils

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandPath added in v0.3.0

func ExpandPath(path string) (string, error)

ExpandPath expands a leading ~ to the user's home directory. Non-tilde paths are returned unchanged.

func GetIPAddress added in v0.2.14

func GetIPAddress() (string, error)

GetIPAddress gets the IP address of the user with timeout and fallback services

func GetIPAddressWithServices added in v0.3.0

func GetIPAddressWithServices(services []IPService) (string, error)

GetIPAddressWithServices gets the IP address using the provided list of services. This allows for testing with mock services.

func GetKubeConfig

func GetKubeConfig(log *logger.FunLogger, cfg *v1alpha1.Environment, hostUrl string, dest string, desiredServerURL string) error

GetKubeConfig downloads the kubeconfig file from the remote host

func RewriteKubeConfigServer added in v0.3.0

func RewriteKubeConfigServer(path string, serverURL string) error

RewriteKubeConfigServer rewrites the server URL in a kubeconfig file. If serverURL is empty, this is a no-op.

Types

type IPService added in v0.3.0

type IPService struct {
	URL     string
	Timeout time.Duration
}

IPService represents an IP lookup service configuration.

func DefaultIPServices added in v0.3.0

func DefaultIPServices() []IPService

DefaultIPServices returns the default list of IP lookup services.

Jump to

Keyboard shortcuts

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