Documentation ¶
Index ¶
- Constants
- func AskInterfaceParams(i *Interfaces)
- func SaveHostname(storage map[string]interface{}) error
- func SaveInterface(storage map[string]interface{}) error
- func SaveKeyboard(storage map[string]interface{}) error
- func SaveLocale(storage map[string]interface{}) error
- func SaveSecondaryDNS(storage map[string]interface{}) error
- func SaveWifi(storage map[string]interface{}) error
- func SetHostname(storage map[string]interface{}) error
- func SetInterface(storage map[string]interface{}) error
- func SetKeyboard(storage map[string]interface{}) error
- func SetLocale(storage map[string]interface{}) error
- func SetSecondaryDNS(storage map[string]interface{}) error
- func SetWifi(storage map[string]interface{}) error
- type CallbackFn
- type Configurator
- func (c *Configurator) AddConfigFn(name string, ccf *CallbackFn)
- func (c *Configurator) GetConfigFn(name string) *CallbackFn
- func (c *Configurator) RemoveConfigFn(name string)
- func (c *Configurator) SetConfigFn(name string, ccf *CallbackFn)
- func (c *Configurator) Setup() error
- func (c *Configurator) StoreValue(name string, value interface{})
- func (c *Configurator) Write() error
- type Interfaces
Constants ¶
const ( Locale = "Locale" Keymap = "Keymap" Wifi = "Wifi" Interface = "Interface" DNS = "DNS" SSH = "SSH" Camera = "Camera" MountDir = "/tmp/isaax-sd/" Language = "LANGUAGE=%s\n" LocaleAll = "LC_ALL=%s\n" LocaleLang = "LANG=%s\n" DefaultLocale = "en_US.UTF-8" IsaaxConfDir = "/etc/" TmpDir = "/tmp/" InterfaceWLAN string = "auto wlan0\n" + "iface wlan0 inet static\n" + "address %s\n" + "netmask %s\n" + "gateway %s\n" + "dns-nameservers %s\n" InterfaceETH string = "auto eth0\n" + "iface eth0 inet static\n" + "address %s\n" + "netmask %s\n" + "gateway %s\n" + "dns-nameservers %s\n" + "\n" + "iface default inet dhcp\n" WPAconf = `` /* 140-byte string literal not displayed */ )
Default Configurator constants that are describe a specific configuration option
Variables ¶
This section is empty.
Functions ¶
func AskInterfaceParams ¶
func AskInterfaceParams(i *Interfaces)
AskInterfaceParams is a set of dialog to set user `Interfaces`
func SaveHostname ¶ added in v0.4.0
SaveHostname is a default method to save hostname into the image
func SaveInterface ¶
SaveInterface is a default method to save user Interfaces into the image
func SaveKeyboard ¶
SaveKeyboard is a default method to save KEYMAP into the image
func SaveLocale ¶
SaveLocale is a default method to save locale into the image
func SaveSecondaryDNS ¶
SaveSecondaryDNS is a default method to set 8.8.8.8 as a secondary DNS
func SetHostname ¶ added in v0.4.0
SetHostname is a default method with a dialog to configure device hostname
func SetInterface ¶
SetInterface is a dialog asking to setup user Interfaces for the static ip functionality
func SetKeyboard ¶
SetKeyboard is a default method to with dialog to configure the keymap
func SetSecondaryDNS ¶
SetSecondaryDNS is a dialog asking to set 8.8.8.8 DNS
Types ¶
type CallbackFn ¶
type CallbackFn struct { Config cb Apply cb }
CallbackFn is an entity with Config and Apply function
func NewCallbackFn ¶
func NewCallbackFn(config cb, apply cb) *CallbackFn
NewCallbackFn creates a new CallbackFn with 2 Function parameters
type Configurator ¶
type Configurator struct {
// contains filtered or unexported fields
}
configurator is a container of a mutual storage and order of CallbackFn
func NewDefault ¶
func NewDefault(ssh ssh_helper.Util) *Configurator
NewDefault creates a default Configurator
func (*Configurator) AddConfigFn ¶
func (c *Configurator) AddConfigFn(name string, ccf *CallbackFn)
AddConfigFn
func (*Configurator) GetConfigFn ¶
func (c *Configurator) GetConfigFn(name string) *CallbackFn
GetConfigFn returns configuration function by it's name
func (*Configurator) RemoveConfigFn ¶
func (c *Configurator) RemoveConfigFn(name string)
RemoveConfigFn removes CallbackFn from order
func (*Configurator) SetConfigFn ¶
func (c *Configurator) SetConfigFn(name string, ccf *CallbackFn)
SetConfigFn sets CallbackFn of the specified name
func (*Configurator) Setup ¶
func (c *Configurator) Setup() error
Setup triggers all CallbackFn Config functions
func (*Configurator) StoreValue ¶
func (c *Configurator) StoreValue(name string, value interface{})
StoreValue stores value in storage
func (*Configurator) Write ¶
func (c *Configurator) Write() error
Write triggers all CallbackFn Apply functions