Documentation
¶
Index ¶
Constants ¶
const ( // Running means the router advertisement is running Running = "Running" // Reloading means the router advertisement is reloading the configuration Reloading = "Reloading" // Failing means the router advertisement is failing with an error Failing = "Failing" // Stopped means the router advertisement is stopped Stopped = "Stopped" )
Possible interface status
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Interface-specific configuration parameters. The Name field must be // unique within the slice. The slice itself and elements must not be // nil. Interfaces []*InterfaceConfig `yaml:"interfaces" json:"interfaces" validate:"required,non_nil_and_unique_name,dive,required"` }
Config represents the configuration of the daemon
func ParseConfigJSON ¶
ParseConfigJSON parses the JSON-encoded configuration from the reader. This function doesn't validate the configuration. The configuration is validated when you pass it to the Daemon.
func ParseConfigYAML ¶
ParseConfigYAML parses the YAML-encoded configuration from the reader. This function doesn't validate the configuration. The configuration is validated when you pass it to the Daemon.
func ParseConfigYAMLFile ¶
ParseConfigYAMLFile parses the YAML-encoded configuration from the file at the given path. This function doesn't validate the configuration. The configuration is validated when you pass it to the Daemon.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is the main struct for the radv daemon
func NewDaemon ¶
func NewDaemon(config *Config, opts ...DaemonOption) (*Daemon, error)
NewDaemon creates a new Daemon instance with the provided configuration and options. It returns ValidationErrors if the configuration is invalid.
func (*Daemon) Reload ¶
Reload reloads the configuration of the daemon. The context passed to this function is used to cancel the potentially long-running operations during the reload process. Currently, the result of the unsucecssful or cancelled reload is undefined and the daemon may be running with either the old or the new configuration or both. It returns ValidationErrors if the configuration is invalid.
type DaemonOption ¶
type DaemonOption func(*Daemon)
DaemonOption is an optional parameter for the Daemon constructor
func WithLogger ¶
func WithLogger(l *slog.Logger) DaemonOption
WithLogger overrides the default logger with the provided one.
type InterfaceConfig ¶
type InterfaceConfig struct { // Required: Network interface name. Must be unique within the configuration. Name string `yaml:"name" json:"name" validate:"required"` // Interval between sending unsolicited RA. Must be >= 70 and <= 1800000. Default is 600000. // The upper bound is chosen to be compliant with RFC4861. The lower bound is intentionally // chosen to be lower than RFC4861 for faster convergence. If you don't wish to overwhelm the // network, and wish to be compliant with RFC4861, set to higher than 3000 as RFC4861 suggests. RAIntervalMilliseconds int `yaml:"raIntervalMilliseconds" json:"raIntervalMilliseconds" validate:"required,gte=70,lte=1800000" default:"600000"` }
InterfaceConfig represents the interface-specific configuration parameters
func (*InterfaceConfig) DeepCopy ¶
func (o *InterfaceConfig) DeepCopy() *InterfaceConfig
DeepCopy generates a deep copy of *InterfaceConfig
type InterfaceStatus ¶
type InterfaceStatus struct { // Interface name Name string `yaml:"name" json:"name"` // Status of the router advertisement on the interface State string `yaml:"state" json:"state"` // Error message maybe set when the state is Failing or Stopped Message string `yaml:"message,omitempty" json:"message,omitempty"` // Last configuration update time in Unix time LastUpdate int64 `yaml:"lastUpdate" json:"lastUpdate"` // Number of sent solicited router advertisements TxSolicitedRA int `yaml:"txSolicitedRA" json:"txSolicitedRA"` // Number of sent unsolicited router advertisements TxUnsolicitedRA int `yaml:"txUnsolicitedRA" json:"txUnsolicitedRA"` }
InterfaceStatus represents the interface-specific status of the Daemon
func (*InterfaceStatus) DeepCopy ¶
func (o *InterfaceStatus) DeepCopy() *InterfaceStatus
DeepCopy generates a deep copy of *InterfaceStatus
type Status ¶
type Status struct { // Interfaces-specific status Interfaces []*InterfaceStatus `yaml:"interfaces" json:"interfaces"` }
Status is the status of the Daemon
type ValidationErrors ¶
type ValidationErrors = validator.ValidationErrors
ValidationErrors is a type alias for the validator.ValidationErrors