MCPcopy Create free account
hub / github.com/apecloud/myduckserver / parseProviderAndPath

Function parseProviderAndPath

storage/object_storage.go:158–170  ·  view source on GitHub ↗
(uri string)

Source from the content-addressed store, hash-verified

156}
157
158func parseProviderAndPath(uri string) (string, string, error) {
159 parsedUri, err := url.Parse(uri)
160 if err != nil {
161 return "", "", fmt.Errorf("failed to parse remote path: %w", err)
162 }
163
164 provider := strings.ToLower(parsedUri.Scheme)
165 if _, ok := supportedProvider[provider]; !ok {
166 return "", "", fmt.Errorf("unsopported Provider, please use s3 or s3c: %w", err)
167 }
168
169 return provider, parsedUri.Host + parsedUri.Path, nil
170}
171
172func parseRegionFromEndpoint(provider, endpoint string) (string, error) {
173 region := ""

Callers 1

ConstructStorageConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected