Documentation
¶
Index ¶
- Constants
- func CheckForLegacyKey()
- func GetAPIKey() (string, error)
- func GetClientOptions() ([]option.RequestOption, error)
- func GetConfigPath() (string, error)
- func GetOrCreateSSHKey(vmID string, client *vers.Client, apiCtx context.Context) (string, error)
- func GetVersUrl() (*url.URL, error)
- func HasAPIKey() (bool, error)
- func PromptForLogin() error
- func SaveAPIKey(apiKey string) error
- func SaveConfig(config *Config) error
- type Config
Constants ¶
const DEFAULT_VERS_URL_STR = "https://api.vers.sh"
const LEGACY_VERS_HOST = "13.219.19.157" // Keep for reference during migration
TODO: Remove backward compatibility after migration period (target: later this week will probably be fine tbh) During migration: support both old IP and new domain
Variables ¶
This section is empty.
Functions ¶
func CheckForLegacyKey ¶
func CheckForLegacyKey()
CheckForLegacyKey shows a deprecation notice for legacy keys TODO: Remove after migration period
func GetClientOptions ¶
func GetClientOptions() ([]option.RequestOption, error)
GetClientOptions returns the options for the SDK client TODO: Simplify after migration period - remove protocol detection logic
func GetConfigPath ¶
GetConfigPath returns the path to the .versrc file in the user's home directory
func GetOrCreateSSHKey ¶
GetOrCreateSSHKey retrieves the path to an SSH key, fetching and saving it if necessary. It returns the path to the key file and an error if any occurred.
func GetVersUrl ¶
GetVersUrl returns the full URL with protocol validation
func PromptForLogin ¶
func PromptForLogin() error
PromptForLogin creates a helper function that checks for API key and prompts for login if not found
func SaveAPIKey ¶
SaveAPIKey saves the API key to the config file
func SaveConfig ¶
SaveConfig saves the configuration to the .versrc file