Documentation
¶
Index ¶
- func MakeHost(h rt.Hosts, d string, cdir, imgdir string) *bytes.Buffer
- type Cfg
- func (c *Cfg) APIResponder(cachesend chan rt.Envelope, fname string, wg *sync.WaitGroup) (recvch chan rt.Envelope, finish chan struct{})
- func (c Cfg) CreateDHCPd() (string, error)
- func (c Cfg) CreateIfaceSetting() (string, error)
- func (c Cfg) MakeSubnet() *bytes.Buffer
- func (c *Cfg) Parse(cfgfile string) error
- func (c *Cfg) Save(cfgfile string) error
- func (c *Cfg) String(send chan rt.Envelope) (string, error)
- type CoreCfg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cfg ¶
Cfg type holds core DHCP ISC configuration
func (*Cfg) APIResponder ¶
func (c *Cfg) APIResponder(cachesend chan rt.Envelope, fname string, wg *sync.WaitGroup) (recvch chan rt.Envelope, finish chan struct{})
APIResponder is a GR that responds to REST API calls Note, the cache doesn't need to be locked. If we try, we'll get deadlocked.
func (Cfg) CreateDHCPd ¶
CreateDHCPd is a func that returns a stringified version of the cache for the DHCPd configuration
func (Cfg) CreateIfaceSetting ¶
CreateIfaceSetting is a func that returns a stringified version of the cache for the DHCPd configuration func (c Cfg) CreateIfaceSetting(send chan rt.Envelope) (string, error) {
type CoreCfg ¶
type CoreCfg struct {
HTTPUser string `json:"httpuser"`
HTTPPasswd string `json:"httppasswd"`
ServerURL string `json:"serverurl"`
ServerPort int `json:"srverport"`
HTTPConfigsLocation string `json:"-"` // Directory for serving configurations "configs"
HTTPImagesLocation string `json:"-"` // Directory for serving configurations "images"
FileConfigsLocation string `json:"-"` // Directory for generating configurations "./configs"
FileImagesLocation string `json:"-"` // Directory for generating configurations "./configs"
DHCPDPath string `json:"-"` // /etc/dhcpd/dhcpd.conf
DHCPPath string `json:"-"` // /etc/default/isc-dhcp-server
DHCPIface string `json:"dhcpiface" dhcpd:"INTERFACESv4"`
DomainName string `json:"domainname" dhcpd:"option domain-name "`
DNSServers []string `json:"dnservers" dhcpd:"option domain-name-servers"`
DefaultLease int `json:"defaultlease" dhcpd:"default-lease-time "`
MaxLease int `json:"maxlease" dhcpd:"max-lease-time "`
Subnet string `json:"subnet" dhcpd:"subnet"`
SubnetMask string `json:"subnetmask" dhcpd:"netmask"`
NonCfgRangeLow string `json:"noncfgrangelow"`
NonCfgRangeHigh string `json:"noncfgrangehigh"`
SubnetRouter string `json:"subnetrouter" dhcpd:"option routers"`
TransferMode string `toml:"-" json:"transfermode" dhcpd:"option ezjunosztp.transfer-mode"`
FileServer string `json:"fileserver" dhcpd:"option ezjunosztp-file-server"`
NTPServers []string `json:"ntpservers" dhcpd:"option ntp-servers"`
}
CoreCfg holds core info
Click to show internal directories.
Click to hide internal directories.