config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultOwner is the default owner
	DefaultOwner = "NO OWNER SET"

	// DefaultOrganization is the default organization
	DefaultOrganization = "NO ORGANIZATION SET"

	// DefaultEmail is the default email
	DefaultEmail = "NO EMAIL SET"
)

Owner related constants

View Source
const (
	// ToolName is the name of the tool, used for directory names and logging
	ToolName = "storctl"

	// DefaultConfigDir is the default directory for all tool-related files
	DefaultConfigDir = ".storctl"

	// DefaultTemplateDir is the default directory for lab templates
	DefaultTemplateDir = "templates"

	// DefaultKeysDir is the default directory for storing SSH keys
	DefaultKeysDir = "keys"

	// ConfigFileName is the name of the configuration file
	ConfigFileName = "config.yaml"

	// DefaultAdminUser is the default admin user
	DefaultAdminUser = "ansible"

	// DefaultLabBucket is the default bucket for storing labs
	DefaultLabBucket = "labs"

	// DefaultLabStorageFile is the default file for storing labs
	DefaultLabStorageFile = "labs.db"

	// DefaultAnsibleDir is the default directory for storing ansible files
	DefaultAnsibleDir = "ansible"

	// DefaultAnsibleConfigFile is the default ansible config file
	DefaultAnsibleConfigFile = "ansible.cfg"

	// DefaultAnsibleInventoryFile is the default ansible inventory file
	DefaultAnsibleInventoryFile = "inventory"

	// DefaultAnsiblePlaybookFile is the default ansible playbook file
	DefaultAnsiblePlaybookFile = "site.yml"

	// DefaultAnsibleExtraVarsFile is the default ansible extra vars file
	DefaultAnsibleExtraVarsFile = "extra_vars.yml"

	// DefaultLimaDir is the default directory for storing lima VM configs
	DefaultLimaDir = "lima"
)
View Source
const (
	// DefaultProvider is the default provider
	DefaultProvider = "lima"

	// DefaultDomain is the default domain
	DefaultDomain = "aistorlabs.com"

	// DefaultLocation is the default location
	DefaultLocation = "nbg1"

	// DefaultAdminKeyName is the default SSH key name
	DefaultAdminKeyName = "aistor-admin"

	// DefaultImage is the default image
	DefaultImage = "ubuntu-24.04"

	// DefaultServerType is the default server type
	DefaultServerType = "cx22"

	// DefaultToken is the default token
	DefaultToken = "NO TOKEN SET"

	// DefaultCredentials is the default credentials
	DefaultCredentials = "NOT USED WITH THIS PROVIDER"
)

Provider related constants

View Source
const (
	// DefaultDNSProvider is the default DNS provider
	DefaultDNSProvider = "cloudflare"

	// DefaultDNSZoneID is the default DNS zone ID
	DefaultDNSZoneID = "NO ZONE ID SET"

	// DefaultDNSToken is the default DNS token
	DefaultDNSToken = "NO TOKEN SET"
)

DNS related constants

View Source
const (
	// DefaultTimeout is the default timeout for operations
	DefaultTimeout = "30s"

	// DefaultKeyTTL is the default time-to-live for SSH keys
	DefaultTTL = "1h"
)

Time related constants

View Source
const (
	// DefaultVolumeSize is the default size for volumes
	DefaultVolumeSize = 100

	// DefaultVolumeFormat is the default format for volumes
	DefaultVolumeFormat = "xfs"

	// DefaultVolumeAutomount is the default automount for volumes
	DefaultVolumeAutomount = false
)

Volume related constants

View Source
const (
	// DefaultCloudInitUserData is the default user data for cloud-init
	DefaultCloudInitUserData = `` /* 335-byte string literal not displayed */

)

cloud-init

View Source
const (
	// DefaultLabTemplate is the default lab template
	DefaultLabTemplate = `` /* 633-byte string literal not displayed */

)

Lab template related constants

Variables

This section is empty.

Functions

This section is empty.

Types

type AnsibleConfig added in v0.1.2

type AnsibleConfig struct {
	ConfigFile string `mapstructure:"config_file"`
}

type Config

type Config struct {
	Providers    []ProviderConfig `mapstructure:"providers"`
	DNS          DNSConfig        `mapstructure:"dns"`
	Storage      StorageConfig    `mapstructure:"storage"`
	Email        string           `mapstructure:"email" yaml:"email"`
	Organization string           `mapstructure:"organization" yaml:"organization"`
	Owner        string           `mapstructure:"owner" yaml:"owner"`
	OutputFormat string           `mapstructure:"output_format" yaml:"output_format"`
	LogLevel     string           `mapstructure:"log_level" yaml:"log_level"`
	Ansible      AnsibleConfig    `mapstructure:"ansible" yaml:"ansible"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig reads configuration from file and environment variables

type DNSConfig

type DNSConfig struct {
	Provider string `mapstructure:"provider"`
	Domain   string `mapstructure:"domain"`
	Token    string `mapstructure:"token"`
	ZoneID   string `mapstructure:"zone_id"`
}

type ProviderConfig

type ProviderConfig struct {
	Name        string            `mapstructure:"name"`
	Location    string            `mapstructure:"location"`
	Token       string            `mapstructure:"token"`
	Credentials map[string]string `mapstructure:"credentials"`
}

type StorageConfig added in v0.1.2

type StorageConfig struct {
	Path   string `mapstructure:"path" yaml:"path"`
	Bucket string `mapstructure:"bucket" yaml:"bucket"`
}

Jump to

Keyboard shortcuts

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