Documentation
¶
Overview ¶
Copyright © 2021 Antoine Martin <antoine@openance.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func AddIpAddress(iface string, address net.IP) error
- func AddIpMapping(hostConfig *txeh.HostsConfig, ip net.IP, domainName string, toRemove []net.IP) error
- func CheckIpExists(ip net.IP) (bool, error)
- func DisableService(serviceName string) error
- func EnableService(serviceName string) error
- func EnsureMachineID() error
- func EnsureNetFilter() error
- func EnsureOpenRC(level string) error
- func EnsureOpenRCDirectory() error
- func ExecuteIfServiceNotStarted(serviceName string, fn func() error) error
- func ExecuteIfServiceStarted(serviceName string, fn func() error) error
- func IpMappingForHost(hosts *txeh.Hosts, domainName string) (net.IP, error)
- func IsHostMapped(ctx context.Context, ip net.IP, domainName string) (bool, []net.IP)
- func IsServiceStarted(serviceName string) (bool, error)
- func PretendServiceStarted(serviceName string) error
- func StartOpenRC() error
- func StartService(serviceName string) error
- func StopService(serviceName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddIpAddress ¶ added in v0.2.0
AddIpAddress adds the IP address to the interface iface.
It uses the default mask of the IP address class as the mask, and the default broadcast address as the broadcast address.
func AddIpMapping ¶ added in v0.2.0
func DisableService ¶ added in v0.1.17
DisableService disables the service named serviceName.
func EnableService ¶
EnableService enables the service named serviceName.
func EnsureMachineID ¶ added in v0.3.0
func EnsureMachineID() error
func EnsureNetFilter ¶ added in v0.1.5
func EnsureNetFilter() error
EnsureNetFilter ensures net filtering is available. It does so by checking The availability of the /proc/sys/net/bridge directory. On Windows 11, WSL2 includes br_netfilter in the kernel and modprobe is not available. On other linuxes, netfilter is provided as a module.
func EnsureOpenRC ¶ added in v0.5.0
func EnsureOpenRCDirectory ¶ added in v0.3.0
func EnsureOpenRCDirectory() error
func ExecuteIfServiceNotStarted ¶
ExecuteIfServiceNotStarted executes the function fn if the service serviceName is not started.
func ExecuteIfServiceStarted ¶
ExecuteIfServiceStarted executes the fn function if the service serviceName is started.
func IpMappingForHost ¶ added in v0.3.3
func IsHostMapped ¶ added in v0.2.2
func IsServiceStarted ¶
func PretendServiceStarted ¶
func StartOpenRC ¶
func StartOpenRC() error
StartOpenRC starts the openrc services in the default runlevel. If one of the services is already started, it is not restarted. It one is not started, it is started.
func StartService ¶
StartService start the serviceName service if it is not already started.
func StopService ¶
StopService stops the serviceName service if it is started.
Types ¶
This section is empty.