noop.go 587 B

12345678910111213141516171819202122
  1. // Package noop is a macAndIPXE handler that does nothing.
  2. package reservation
  3. import (
  4. "context"
  5. "dhcp/data"
  6. "errors"
  7. "net"
  8. )
  9. // Handler is a noop macAndIPXE.
  10. type noop struct{}
  11. // GetByMac returns an error.
  12. func (h noop) GetByMac(_ context.Context, _ net.HardwareAddr, _ string) (*data.DHCP, error) {
  13. return nil, errors.New("no macAndIPXE specified, please specify a macAndIPXE")
  14. }
  15. // GetByIP returns an error.
  16. func (h noop) GetByIP(_ context.Context, _ net.IP, _ string) (*data.DHCP, error) {
  17. return nil, errors.New("no macAndIPXE specified, please specify a macAndIPXE")
  18. }