util_unsupported.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // +build !freebsd,!linux,!windows,!darwin
  2. /*
  3. Copyright 2017 The Kubernetes Authors.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. */
  14. package util
  15. import (
  16. "fmt"
  17. "net"
  18. "time"
  19. )
  20. // CreateListener creates a listener on the specified endpoint.
  21. func CreateListener(endpoint string) (net.Listener, error) {
  22. return nil, fmt.Errorf("CreateListener is unsupported in this build")
  23. }
  24. // GetAddressAndDialer returns the address parsed from the given endpoint and a dialer.
  25. func GetAddressAndDialer(endpoint string) (string, func(addr string, timeout time.Duration) (net.Conn, error), error) {
  26. return "", nil, fmt.Errorf("GetAddressAndDialer is unsupported in this build")
  27. }
  28. // LockAndCheckSubPath empty implementation
  29. func LockAndCheckSubPath(volumePath, subPath string) ([]uintptr, error) {
  30. return []uintptr{}, nil
  31. }
  32. // UnlockPath empty implementation
  33. func UnlockPath(fileHandles []uintptr) {
  34. }
  35. // LocalEndpoint empty implementation
  36. func LocalEndpoint(path, file string) (string, error) {
  37. return "", fmt.Errorf("LocalEndpoints are unsupported in this build")
  38. }
  39. // GetBootTime empty implementation
  40. func GetBootTime() (time.Time, error) {
  41. return time.Time{}, fmt.Errorf("GetBootTime is unsupported in this build")
  42. }