Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProfilePath ¶
GetProfilePath returns the path to the profile file in the user's home directory
func LoadEnvVarsFromFile ¶
LoadEnvVarsFromFile reads environment variables from the specified file and returns them as a map
func SaveProfile ¶
SaveProfile saves the profile to the specified path
Types ¶
type AppService ¶
type CloudResource ¶
type CloudResource struct {
AppService *AppService `toml:"app_service,omitempty"`
ContainerInstance *ContainerInstance `toml:"container_instance,omitempty"`
}
type Config ¶
type Config struct {
Registry struct {
Port int `mapstructure:"port" default:"5000"`
Tag string `mapstructure:"tag" default:"2"`
Name string `mapstructure:"name" default:"locreg-registry"`
Image string `mapstructure:"image" default:"registry"`
Username string `mapstructure:"username"` // Set separately as should be unique each time
Password string `mapstructure:"password"` // Set separately as should be unique each time
} `mapstructure:"registry"`
Image struct {
Name string `mapstructure:"name" default:"locreg-built-image"`
Tag string `mapstructure:"tag"` // Set a git SHA if not peresent default to latest
} `mapstructure:"image"`
Tunnel struct {
Provider struct {
Ngrok struct {
Name string `mapstructure:"name" default:"locreg-ngrok"`
Image string `mapstructure:"image" default:"ngrok/ngrok"`
Tag string `mapstructure:"tag" default:"latest"`
Port int `mapstructure:"port" default:"4040"`
NetworkName string `mapstructure:"networkName" default:"locreg-ngrok"`
} `mapstructure:"ngrok"`
} `mapstructure:"provider"`
} `mapstructure:"tunnel"`
Deploy struct {
Provider struct {
Azure struct {
Location string `mapstructure:"location" default:"eastus"`
ResourceGroup string `mapstructure:"resourceGroup" default:"LocregResourceGroup"`
AppServicePlan struct {
Name string `mapstructure:"name" default:"LocregAppServicePlan"`
Sku struct {
Name string `mapstructure:"name" default:"F1"`
Capacity int `mapstructure:"capacity" default:"1"`
} `mapstructure:"sku"`
PlanProperties struct {
Reserved bool `mapstructure:"reserved" default:"true"`
} `mapstructure:"planProperties"`
} `mapstructure:"appServicePlan"`
AppService struct {
Name string `mapstructure:"name"` // Generated with random suffix
SiteConfig struct {
AlwaysOn bool `mapstructure:"alwaysOn" default:"false"`
} `mapstructure:"siteConfig"`
} `mapstructure:"appService"`
ContainerInstance struct {
Name string `mapstructure:"name" default:"locreg-container"`
OsType string `mapstructure:"osType" default:"Linux"`
RestartPolicy string `mapstructure:"restartPolicy" default:"Always"`
IpAddress struct {
Type string `mapstructure:"type" default:"Public"`
Ports []struct {
Port int `mapstructure:"port"`
Protocol string `mapstructure:"protocol"`
} `mapstructure:"ports"`
} `mapstructure:"ipAddress"`
Resources struct {
Requests struct {
Cpu float64 `mapstructure:"cpu" default:"1.0"`
Memory float64 `mapstructure:"memory" default:"1.5"`
} `mapstructure:"requests"`
} `mapstructure:"resources"`
} `mapstructure:"containerInstance"`
} `mapstructure:"azure"`
} `mapstructure:"provider"`
} `mapstructure:"deploy"`
Tags map[string]*string `mapstructure:"tags"`
}
func LoadConfig ¶
func (*Config) IsAppServiceSet ¶
IsAppServiceSet checks if the App Service configuration is set in the config. If it is set returns true if not returns false
func (*Config) IsContainerInstanceSet ¶
IsContainerInstanceSet checks if the Container Instance configuration is set in the config. If it is set returns true if not returns false
func (*Config) IsNgrokConfigured ¶
type ContainerInstance ¶
type LocalRegistry ¶
type Profile ¶
type Profile struct {
LocalRegistry *LocalRegistry `toml:"local_registry,omitempty"`
Tunnel *Tunnel `toml:"tunnel,omitempty"`
CloudResource *CloudResource `toml:"cloud_resource,omitempty"`
}
func LoadOrCreateProfile ¶
LoadOrCreateProfile loads an existing profile or creates a new one if it doesn't exist
func LoadProfileData ¶
Click to show internal directories.
Click to hide internal directories.