Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ApplicationName denotes the name of the application. ApplicationName = "fritzctl" // Version defines the version of the application. Version = "unknown" // ConfigFilename defines the filename of the configuration file. ConfigFilename = "fritzctl.json" // ConfigFilenameHidden defines the filename of the configuration file (hidden). ConfigFilenameHidden = "." + ConfigFilename // ConfigDir defines the directory of the configuration file. ConfigDir = "" // DefaultConfigDir is the default directory where the config file resides. DefaultConfigDir = "/etc/fritzctl" )
Functions ¶
func DefaultConfigFileAbsolute ¶
func DefaultConfigFileAbsolute() string
DefaultConfigFileAbsolute returns the absolute path of the default configuration file.
func FindConfigFile ¶
FindConfigFile returns the path to the config file.
Types ¶
type Config ¶
Config stores client configuration of your FRITZ!Box
func (*Config) GetLoginResponseURL ¶
GetLoginResponseURL returns the URL that is queried for the login challenge
func (*Config) GetLoginURL ¶
GetLoginURL returns the URL that is queried for the login challenge
type Configurer ¶
type Configurer interface {
Greet()
ApplyDefaults(cfg ExtendedConfig)
Obtain() ExtendedConfig
Write() error
}
Configurer provides functions to obtain user data from stdin and write the result to a file.
type ExtendedConfig ¶
type ExtendedConfig struct {
// contains filtered or unexported fields
}
ExtendedConfig contains the fritz core config along with other data (like config file location).
func Defaults ¶
func Defaults() ExtendedConfig
Defaults constructs an ExtendedConfig with default values.
type Login ¶
type Login struct {
LoginURL string `json:"loginURL"` // The URL for the login negotiation.
Username string `json:"username"` // Username to log in. In user-agnostic setups this can be left empty.
Password string `json:"password"` // The password corresponding to the Username.
}
Login wraps the login data to be used by the client.
type Net ¶
type Net struct {
Protocol string `json:"protocol"` // The protocol to use when communicating with the FRITZ!Box. "http" or "https".
Host string `json:"host"` // Host name or ip address of the FRITZ!Box. In most home setups "fritz.box" can be used. Other possible formats: "192.168.2.200".
Port string `json:"port"` // Port to use for the HTTP interface. Leave empty for default values.
}
Net wraps the protocol://host:port data to contact the FRITZ!Box.
type Pki ¶
type Pki struct {
SkipTLSVerify bool `json:"skipTlsVerify"` // Skip TLS verification when using https.
CertificateFile string `json:"certificateFile"` // Points to a certificate file (in PEM format) to verify the integrity of the FRITZ!Box.
}
Pki wraps the client-side certificate handling.