config

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
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

func SaveHostname(storage map[string]interface{}) error

SaveHostname is a default method to save hostname into the image

func SaveInterface

func SaveInterface(storage map[string]interface{}) error

SaveInterface is a default method to save user Interfaces into the image

func SaveKeyboard

func SaveKeyboard(storage map[string]interface{}) error

SaveKeyboard is a default method to save KEYMAP into the image

func SaveLocale

func SaveLocale(storage map[string]interface{}) error

SaveLocale is a default method to save locale into the image

func SaveSecondaryDNS

func SaveSecondaryDNS(storage map[string]interface{}) error

SaveSecondaryDNS is a default method to set 8.8.8.8 as a secondary DNS

func SaveWifi

func SaveWifi(storage map[string]interface{}) error

SaveWifi is a default method to save wpa_supplicant for the wifi connection

func SetHostname added in v0.4.0

func SetHostname(storage map[string]interface{}) error

SetHostname is a default method with a dialog to configure device hostname

func SetInterface

func SetInterface(storage map[string]interface{}) error

SetInterface is a dialog asking to setup user Interfaces for the static ip functionality

func SetKeyboard

func SetKeyboard(storage map[string]interface{}) error

SetKeyboard is a default method to with dialog to configure the keymap

func SetLocale

func SetLocale(storage map[string]interface{}) error

SetLocale is a default method to with dialog to configure the locale

func SetSecondaryDNS

func SetSecondaryDNS(storage map[string]interface{}) error

SetSecondaryDNS is a dialog asking to set 8.8.8.8 DNS

func SetWifi

func SetWifi(storage map[string]interface{}) error

SetWifi is a dialog asking to configure wpa supplicant

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 New

func New(ssh ssh_helper.Util) *Configurator

New creates an empty Configurator

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

type Interfaces

type Interfaces struct {
	Address string
	Gateway string
	Netmask string
	DNS     string
}

Interfaces represents network interfaces used to setup devices

Jump to

Keyboard shortcuts

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