MCPcopy Index your code
hub / github.com/peak/s5cmd / checkVersioningWithGoogleEndpoint

Function checkVersioningWithGoogleEndpoint

command/validation.go:40–56  ·  view source on GitHub ↗

checkVersioningWithGoogleEndpoint checks if the versioning flags are used with the Google Endpoint. Because the s3 versioning operations are not compatible with GCS's versioning API.

(ctx *cli.Context)

Source from the content-addressed store, hash-verified

38// the Google Endpoint. Because the s3 versioning operations are not compatible with
39// GCS's versioning API.
40func checkVersioningWithGoogleEndpoint(ctx *cli.Context) error {
41 endpoint := ctx.String("endpoint-url")
42 if endpoint == "" {
43 return nil
44 }
45
46 u, err := urlpkg.Parse(endpoint)
47 if err != nil {
48 return err
49 }
50
51 if storage.IsGoogleEndpoint(*u) && (ctx.Bool(allVersionsFlagName) || ctx.String(versionIDFlagName) != "") {
52 return fmt.Errorf(versioningNotSupportedWarning, endpoint)
53 }
54
55 return nil
56}
57
58// checkNumberOfArguments checks if the number of the arguments is valid.
59// if the max is negative then there is no upper limit of arguments.

Callers 7

validateCopyCommandFunction · 0.85
validatePresignCommandFunction · 0.85
validateHeadCommandFunction · 0.85
validateCatCommandFunction · 0.85
validateRMCommandFunction · 0.85
validateLSCommandFunction · 0.85
validateSelectCommandFunction · 0.85

Calls 2

IsGoogleEndpointFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected