(path string)
| 189 | } |
| 190 | |
| 191 | func ParseNormalProtocol(path string) (string, error) { |
| 192 | parts := strings.Split(path, "://") |
| 193 | |
| 194 | if len(parts) == 0 { |
| 195 | return "", fmt.Errorf("failed to parse URL %s", path) |
| 196 | } |
| 197 | protocol := strings.ToLower(parts[0]) |
| 198 | |
| 199 | if slices.Contains(protocols, protocol) { |
| 200 | return protocol, nil |
| 201 | } |
| 202 | return "", fmt.Errorf("failed to parse URL %s", path) |
| 203 | } |
| 204 | |
| 205 | func (r *Remote) Fetch(path string, cacheDirOpt ...string) (string, error) { |
| 206 | u, err := Parse(path) |