Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Port that the Pi-Hole API is defaulted to DefaultPort = 80 // The default refresh rate of the data in seconds DefaultRefreshS = 1 // The name of the configuration file ConfigFileName = "picli-config.json" )
Constant values required by Pi-CLI
Variables ¶
View Source
var LivePiCLIData = NewPiCLIData()
live updating config data used at runtime
View Source
var PICLISettings = NewSettings()
Store PiCLI settings
Functions ¶
Types ¶
type PiCLIData ¶
type PiCLIData struct { // An instance of settings.Settings Settings *Settings // Remote address of the Pi-Hole FormattedAPIAddress string // The API key used to authenticate with the Pi-Hole APIKey string // The time that the last data poll was sent out to the Pi-Hole LastUpdated time.Time // If the keybinds screen is being shown or not ShowKeybindsScreen bool // String used to display the keybindings Keybinds []string }
Stores the data needed by Pi-CLI during runtime
func NewPiCLIData ¶
func NewPiCLIData() *PiCLIData
type Settings ¶
type Settings struct { // The Pi-Hole's address PiHoleAddress string `json:"pi_hole_address"` // The port the Pi-Hole exposes that can be used for HTTP/S traffic PiHolePort int `json:"pi_hole_port"` // The number of seconds to wait between each data refresh RefreshS int `json:"refresh_s"` // API key used to authenticate with the Pi-Hole instance APIKey string `json:"api_key"` }
Settings contains the current configuration options being used by Pi-CLI
func (*Settings) APIKeyIsInFile ¶
Is API key stored in the config file? If not, off to the system keyring you go!
func (*Settings) LoadFromFile ¶
func (settings *Settings) LoadFromFile()
Attempts to create a settings instance from a config file
func (*Settings) SaveToFile ¶
Saves the current settings to a config file
Click to show internal directories.
Click to hide internal directories.