isSocket checks if the given address is a Unix-socket (linux), named pipe (Windows), or file-descriptor.
(addr string)
| 141 | // isSocket checks if the given address is a Unix-socket (linux), |
| 142 | // named pipe (Windows), or file-descriptor. |
| 143 | func isSocket(addr string) bool { |
| 144 | switch proto, _, _ := strings.Cut(addr, "://"); proto { |
| 145 | case "unix", "npipe", "fd": |
| 146 | return true |
| 147 | default: |
| 148 | return false |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | // EndpointFromContext parses a context docker endpoint metadata into a typed EndpointMeta structure |
| 153 | func EndpointFromContext(metadata store.Metadata) (EndpointMeta, error) { |
no outgoing calls
no test coverage detected
searching dependent graphs…