Documentation ¶
Overview ¶
Package expansionx contains utilities for starting expansion services for cross-language transforms. All code in this package is currently experimental.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBeamJar ¶
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 GetDefaultRepositoryURL ¶ added in v2.38.0
func GetDefaultRepositoryURL() string
GetDefaultRepositoryURL returns the current target URL for the defaultJarGetter, indicating what repository will be connected to when getting a Beam JAR.
func MakeJar ¶ added in v2.39.0
MakeJar fetches additional classpath JARs and adds it to the classpath of main JAR file and compiles a fresh JAR.
func SetDefaultRepositoryURL ¶ added in v2.38.0
SetDefaultRepositoryURL 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.
Types ¶
type ExpansionServiceRunner ¶
type ExpansionServiceRunner struct {
// contains filtered or unexported fields
}
ExpansionServiceRunner is a type that holds information required to start up a Beam Expansion Service JAR and maintain a handle on the process running the service to enable shutdown as well.
func NewExpansionServiceRunner ¶
func NewExpansionServiceRunner(jarPath, servicePort string) (*ExpansionServiceRunner, error)
NewExpansionServiceRunner builds an ExpansionServiceRunner struct for a given gradle target and Beam version and returns a pointer to it. Passing an empty string as servicePort will request an open port to be assigned to the service.
func (*ExpansionServiceRunner) Endpoint ¶
func (e *ExpansionServiceRunner) Endpoint() string
Endpoint returns the formatted endpoint the ExpansionServiceRunner is set to start the expansion service on.
func (*ExpansionServiceRunner) StartService ¶
func (e *ExpansionServiceRunner) StartService() error
StartService starts the expansion service for a given ExpansionServiceRunner. If this is called and does not return an error, the expansion service will be running in the background until StopService is called. This will leak resources if not addressed.
func (*ExpansionServiceRunner) StopService ¶
func (e *ExpansionServiceRunner) StopService() error
StopService stops the expansion service for a given ExpansionServiceRunner. Returns an error if the command hasn't been run or if the process has already exited.
func (*ExpansionServiceRunner) String ¶
func (e *ExpansionServiceRunner) String() string