Documentation
¶
Index ¶
- Variables
- func GetDefaultConfigDirPath() (string, error)
- type Config
- func (c *Config) AddDomain(domain string) error
- func (c *Config) AddNginxConfig(name string, domain string, port int64) error
- func (c *Config) GetConfigDir() string
- func (c *Config) GetDatabasePath() string
- func (c *Config) GetHostsBackupDir() string
- func (c *Config) GetHostsFile() string
- func (c *Config) GetNginxConfigDir() string
- func (c *Config) InitHosts() error
- func (c *Config) InitNginx() error
- func (c *Config) IsTesting() bool
- func (c *Config) NginxAddDomainAlias(name string, domainAlias string) error
- func (c *Config) NginxRemoveDomainAlias(name string, domainAlias string) error
- func (c *Config) RemoveDomain(domain string) error
- func (c *Config) RemoveNginxConfig(name string) error
- func (c *Config) RenameNginxConfig(oldName string, newName string) error
- func (c *Config) UpdateHost(oldDomain string, newDomain string) error
- func (c *Config) UpdateNginxConfig(name string, domain string, port int64) error
Constants ¶
This section is empty.
Variables ¶
var HostsBeginMarker = fmt.Sprintf("### BEGIN_%s_HOSTS", strings.ToUpper(common.ProgramName))
Markers that indicate the beginning and end of the custom hosts section.
var HostsEndMarker = fmt.Sprintf("\n### END_%s_HOSTS", strings.ToUpper(common.ProgramName))
Functions ¶
func GetDefaultConfigDirPath ¶ added in v0.9.0
Returns the path to the configuration directory.
Types ¶
type Config ¶ added in v0.4.0
type Config struct {
// contains filtered or unexported fields
}
Config contains all configuration options for the application.
func NewTesting ¶ added in v0.4.0
Create a new Config instance with the given configuration directory. Used for testing purposes.
func (*Config) AddNginxConfig ¶ added in v0.4.0
Add a new Nginx configuration file with the given name, domain and port.
func (*Config) GetConfigDir ¶ added in v0.4.0
Returns the path to the configuration directory.
func (*Config) GetDatabasePath ¶ added in v0.9.0
Returns the path of the sqlite3 database file.
func (*Config) GetHostsBackupDir ¶ added in v0.4.0
Returns the path to the hosts backup directory.
func (*Config) GetHostsFile ¶ added in v0.4.0
Returns the path to the hosts file.
func (*Config) GetNginxConfigDir ¶ added in v0.4.0
Returns the path to the nginx configuration directory.
func (*Config) InitHosts ¶ added in v0.4.0
Initialize the custom hosts section in the hosts file so domains can be added without overwriting the other contents of the file.
func (*Config) NginxAddDomainAlias ¶ added in v0.7.0
Add a domain alias to a Nginx configuration file.
func (*Config) NginxRemoveDomainAlias ¶ added in v0.7.0
Remove a domain alias from a Nginx configuration file.
func (*Config) RemoveDomain ¶ added in v0.7.0
Remove a domain from the custom hosts section.
func (*Config) RemoveNginxConfig ¶ added in v0.4.0
Remove a Nginx configuration file with the given name.
func (*Config) RenameNginxConfig ¶ added in v0.6.0
Rename a Nginx configuration file with the given old and new name.
func (*Config) UpdateHost ¶ added in v0.6.0
Update a domain in the custom hosts section.