(cfg *Config)
| 124 | } |
| 125 | |
| 126 | func collectUnixSocketPaths(cfg *Config) []string { |
| 127 | if cfg == nil { |
| 128 | return nil |
| 129 | } |
| 130 | |
| 131 | seen := make(map[string]struct{}) |
| 132 | paths := make([]string, 0) |
| 133 | |
| 134 | for _, inbound := range cfg.InboundConfigs { |
| 135 | if inbound == nil { |
| 136 | continue |
| 137 | } |
| 138 | |
| 139 | listen := strings.TrimSpace(inbound.Listen) |
| 140 | if listen == "" { |
| 141 | continue |
| 142 | } |
| 143 | |
| 144 | path, _, _ := strings.Cut(listen, ",") |
| 145 | path = strings.TrimSpace(path) |
| 146 | if !strings.HasPrefix(path, "/") { |
| 147 | continue |
| 148 | } |
| 149 | |
| 150 | if _, ok := seen[path]; ok { |
| 151 | continue |
| 152 | } |
| 153 | seen[path] = struct{}{} |
| 154 | paths = append(paths, path) |
| 155 | } |
| 156 | |
| 157 | return paths |
| 158 | } |
| 159 | |
| 160 | func removeUnixSocketFiles(paths []string) { |
| 161 | for _, path := range paths { |
no outgoing calls