File: helper.go

package info (click to toggle)
golang-github-areyoulazy-libhosty 1.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 176 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 873 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package libhosty

//RestoreDefaultWindowsHostsFile loads the default windows hosts file
func (h *HostsFile) RestoreDefaultWindowsHostsFile() {
	hfl, _ := ParseHostsFileAsString(windowsHostsTemplate)
	h.HostsFileLines = hfl
}

//RestoreDefaultLinuxHostsFile loads the default linux hosts file
func (h *HostsFile) RestoreDefaultLinuxHostsFile() {
	hfl, _ := ParseHostsFileAsString(linuxHostsTemplate)
	h.HostsFileLines = hfl
}

//RestoreDefaultDarwinHostsFile loads the default darwin hosts file
func (h *HostsFile) RestoreDefaultDarwinHostsFile() {
	hfl, _ := ParseHostsFileAsString(darwinHostsTemplate)
	h.HostsFileLines = hfl
}

//AddDockerDesktopTemplate adds the dockerDesktopTemplate to the actual hostsFile
func (h *HostsFile) AddDockerDesktopTemplate() {
	hfl, _ := ParseHostsFileAsString(dockerDesktopTemplate)
	h.HostsFileLines = append(h.HostsFileLines, hfl...)
}