hsync

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package hsync synchronizes /etc/hosts with pairs of peer hostname and their respective IP addresses

Index

Constants

This section is empty.

Variables

View Source
var Get = daemon.RegisterFeature(New, 200) //nolint:gochecknoglobals

Functions

This section is empty.

Types

type Host

type Host struct {
	IP      net.IP
	Names   []string
	Comment string
}

func ParseHost

func ParseHost(line string) (Host, error)

func (*Host) Line

func (h *Host) Line() (string, error)

type Interface

type Interface struct {
	*daemon.Interface
	// contains filtered or unexported fields
}

func New

func New(i *daemon.Interface) (*Interface, error)

func (*Interface) Close

func (i *Interface) Close() error

func (*Interface) Hosts

func (i *Interface) Hosts() []Host

func (*Interface) OnPeerAdded

func (i *Interface) OnPeerAdded(p *daemon.Peer)

func (*Interface) OnPeerModified

func (i *Interface) OnPeerModified(_ *daemon.Peer, _ *wgtypes.Peer, m daemon.PeerModifier, _, _ []net.IPNet)

func (*Interface) OnPeerRemoved

func (i *Interface) OnPeerRemoved(_ *daemon.Peer)

func (*Interface) Start

func (i *Interface) Start() error

func (*Interface) Sync

func (i *Interface) Sync() error

func (*Interface) Update

func (i *Interface) Update(hosts []Host) error

Jump to

Keyboard shortcuts

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