Documentation
¶
Overview ¶
Package net contains code to apply changes to network interfaces and FRR (Free Range Routing).
Index ¶
- type Applier
- type DBusReloader
- type DBusStartReloader
- type DBusTemplateValidator
- type NetworkApplier
- func (n *NetworkApplier) Apply(tpl template.Template, tmpFile, destFile string, reload bool) (bool, error)
- func (n *NetworkApplier) Compare(source, target string) bool
- func (n *NetworkApplier) Reload() error
- func (n *NetworkApplier) Render(w io.Writer, tpl template.Template) error
- func (n *NetworkApplier) Validate() error
- type Reloader
- type Renderer
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Applier ¶
type Applier interface {
Apply(tpl template.Template, tmpFile, destFile string, reload bool) (bool, error)
Render(writer io.Writer, tpl template.Template) error
Reload() error
Validate() error
Compare(tmpFile, destFile string) bool
}
Applier is an interface to render changes and reload services to apply them.
func NewNetworkApplier ¶
NewNetworkApplier creates a new NewNetworkApplier.
type DBusReloader ¶
type DBusReloader struct {
ServiceFilename string
}
DBusReloader applies a systemd unit reload to apply reloading.
func NewDBusReloader ¶
func NewDBusReloader(service string) DBusReloader
NewDBusReloader is a reloader for systemd units with dbus.
type DBusStartReloader ¶
type DBusStartReloader struct {
ServiceFilename string
}
DBusStartReloader applies the strategy of starting a systemd unit that applies the reload.
func (DBusStartReloader) Reload ¶
func (r DBusStartReloader) Reload() error
Reload starts a systemd unit.
type DBusTemplateValidator ¶
type DBusTemplateValidator struct {
TemplateName, InstanceName string
}
DBusTemplateValidator starts a dbus template (templatename@instancename.service) to apply validation.
func (DBusTemplateValidator) Validate ¶
func (v DBusTemplateValidator) Validate() error
Validate applies validation by starting a dbus templated instance.
type NetworkApplier ¶
NetworkApplier holds the toolset for applying network configuration changes.
func (*NetworkApplier) Apply ¶
func (n *NetworkApplier) Apply(tpl template.Template, tmpFile, destFile string, reload bool) (bool, error)
Apply applies the current configuration with the given template.
func (*NetworkApplier) Compare ¶
func (n *NetworkApplier) Compare(source, target string) bool
Compare compare source and target for hash equality.
func (*NetworkApplier) Reload ¶
func (n *NetworkApplier) Reload() error
Reload reloads the necessary services when the network interfaces configuration was changed.
func (*NetworkApplier) Render ¶
Render renders the network interfaces to the given writer using the given template.
func (*NetworkApplier) Validate ¶
func (n *NetworkApplier) Validate() error
Validate applies the given validator to validate current changes.
type Reloader ¶
type Reloader interface {
Reload() error
}
Reloader triggers the reload to carry out the changes of an applier.