jrmccluskey commented on a change in pull request #16995:
URL: https://github.com/apache/beam/pull/16995#discussion_r818054111



##########
File path: sdks/go/pkg/beam/core/runtime/xlangx/expansionx/download.go
##########
@@ -50,13 +50,49 @@ func newJarGetter() *jarGetter {
        return &jarGetter{repository: apacheRepository, groupID: beamGroupID, 
jarCache: cacheDir}
 }
 
+// GetRepositoryURL returns the current target URL for the defaultJarGetter,
+// indicating what repository will be connected to when getting a Beam JAR.
+func GetDefaultRepositoryURL() string {
+       return defaultJarGetter.GetRepositoryURL()
+}
+
+// SetRepositoryURL updates the target URL for the defaultJarGetter, changing
+// which Maven repository will be connected to when getting a Beam JAR. Also
+// validates that it has been passed a URL and returns an error if not.
+//
+// When changing the target repository, make sure that the value is the prefix
+// up to "org/apache/beam" and that the organization of the repository matches
+// that of the default from that point on to ensure that the conversion of the
+// Gradle target to the JAR name is correct.
+func SetDefaultRepositoryURL(repoURL string) error {
+       return defaultJarGetter.SetRepositoryURL(repoURL)
+}
+
 // GetBeamJar checks a temporary directory for the desired Beam JAR, downloads 
the
 // appropriate JAR from Maven if not present, then returns the file path to the
 // JAR.
 func GetBeamJar(gradleTarget, version string) (string, error) {
        return defaultJarGetter.getJar(gradleTarget, version)
 }
 
+// GetRepositoryURL returns the current target URL for the jarGetter,
+// indicating what repository will be connected to when getting a Beam JAR.
+func (j *jarGetter) GetRepositoryURL() string {
+       return string(j.repository)
+}
+
+// SetRepositoryURL updates the target URL for the jarGetter, changing
+// which Maven repository will be connected to when getting a Beam JAR. Also
+// does some minor validation that it has been passed a URL and returns an
+// error if not.
+func (j *jarGetter) SetRepositoryURL(repoURL string) error {

Review comment:
       I plan on adding more URL validation and adding more test cases but I 
wanted to get the core mechanic out for review first




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to