resolv

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolv

type Resolv struct {
	Data    string `yaml:"contents"`
	Enabled bool   `yaml:"enable"`
	File    string `yaml:"file"`
	Folder  string `yaml:"folder"`
	Name    string `yaml:"name"`
}

Resolv is a struct of properties which are translates to a local resolv for dnsmasq to redirect a given domain suffix to the local docker daemon. Windows has a custom solution, however this will be used on both Mac and Linux.

func (Resolv) Clean

func (resolv Resolv) Clean()

Clean will cleanup the resolv file configured to the system and run some cleanup commands which were ran at the end of resolv.Configure on MacOS.

func (Resolv) Configure

func (resolv Resolv) Configure(c *model.Params)

Configure will ensure the given Resolv type a method that can setup a file with the contents of Data at File in Folder. This file will route traffic on a configured namespace to the localhost and dnsmasq will accept this traffic and route it to the docker container. It will remove the file and/or rewrite the contents for both MacOS and Linux - Linux will however result in removing the string from the file, where MacOS will contain a file with only the contents of Data. MacOS will also run the following upon completion of this function: * sudo ifconfig lo0 alias 172.16.172.16 * sudo killall mDNSResponder

func (Resolv) Status

func (resolv Resolv) Status(c *model.Params) bool

Status is an exported state function which will check the file contents matches Data on Linux, or return the result of three independent checks on MacOS including the file, network and data checks.

Jump to

Keyboard shortcuts

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