net.go 414 B

1234567891011121314151617181920212223242526
  1. package wrap
  2. import (
  3. "net"
  4. )
  5. type (
  6. Net interface {
  7. InterfaceByName(name string) (*net.Interface, error)
  8. Interfaces() ([]net.Interface, error)
  9. }
  10. netImpl struct{}
  11. )
  12. func NewNet() Net {
  13. return &netImpl{}
  14. }
  15. func (_ *netImpl) InterfaceByName(name string) (*net.Interface, error) {
  16. return net.InterfaceByName(name)
  17. }
  18. func (_ *netImpl) Interfaces() ([]net.Interface, error) {
  19. return net.Interfaces()
  20. }