Documentation
¶
Overview ¶
Package file watches a file for changes and updates the in memory DHCP data.
Index ¶
- type Watcher
- func (w *Watcher) GetByIP(ctx context.Context, ip net.IP) (*data.DHCP, *data.Netboot, error)
- func (w *Watcher) GetByMac(ctx context.Context, mac net.HardwareAddr) (*data.DHCP, *data.Netboot, error)
- func (w *Watcher) RegisterHw(ctx context.Context, hwObject v1alpha1.Hardware) error
- func (w *Watcher) Start(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct { // FilePath is the path to the file to watch. FilePath string // Log is the logger to be used in the File backend. Log logr.Logger // contains filtered or unexported fields }
Watcher represents the backend for watching a file for changes and updating the in memory DHCP data.
func NewWatcher ¶
NewWatcher creates a new file watcher.
func (*Watcher) GetByIP ¶
GetByIP is the implementation of the Backend interface. It reads a given file from the in memory data (w.data).
func (*Watcher) GetByMac ¶
func (w *Watcher) GetByMac(ctx context.Context, mac net.HardwareAddr) (*data.DHCP, *data.Netboot, error)
GetByMac is the implementation of the Backend interface. It reads a given file from the in memory data (w.data).
func (*Watcher) RegisterHw ¶
RegisterHw is the implementation of the Backend interface. It reads a given file from the in memory data (w.data).
Click to show internal directories.
Click to hide internal directories.