Module com.github.alexdlaird.ngrok
Package com.github.alexdlaird.ngrok.conf
Class JavaNgrokConfig.Builder
- java.lang.Object
-
- com.github.alexdlaird.ngrok.conf.JavaNgrokConfig.Builder
-
- Enclosing class:
- JavaNgrokConfig
public static class JavaNgrokConfig.Builder extends java.lang.ObjectBuilder for aJavaNgrokConfig, see docs for that class for example usage.
-
-
Constructor Summary
Constructors Constructor Description Builder()Construct a JavaNgrokConfig Builder.Builder(JavaNgrokConfig javaNgrokConfig)Copy aJavaNgrokConfigin to a new Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaNgrokConfigbuild()Build theJavaNgrokConfig.JavaNgrokConfig.BuilderwithApiKey(java.lang.String apiKey)AngrokAPI key.JavaNgrokConfig.BuilderwithAuthToken(java.lang.String authToken)Angrokauthtoken to pass to commands (overrides what is in the config).JavaNgrokConfig.BuilderwithConfigPath(java.nio.file.Path configPath)The path to thengrokconfig file, defaults tongrok'sdefault config location.JavaNgrokConfig.BuilderwithConfigVersion(ConfigVersion configVersion)Thengrokconfig version.JavaNgrokConfig.BuilderwithLogEventCallback(java.util.function.Function<NgrokLog,java.lang.Void> logEventCallback)A callback that will be invoked each timengrokemits a log.JavaNgrokConfig.BuilderwithMaxLogs(int maxLogs)The maximum number ofngroklogs to retain in the monitoring thread.JavaNgrokConfig.BuilderwithNgrokPath(java.nio.file.Path ngrokPath)The path to thengrokbinary, defaults to being placed in the same directory asngrok'sconfigs.JavaNgrokConfig.BuilderwithNgrokVersion(NgrokVersion ngrokVersion)The major version ofngrokto be used.JavaNgrokConfig.BuilderwithoutMonitoring()Don't keep monitoringngrok(for logs, etc.) after startup is complete.JavaNgrokConfig.BuilderwithRegion(Region region)The region in whichngrokshould start.JavaNgrokConfig.BuilderwithStartupTimeout(int startupTimeout)The max timeout, in seconds, to wait forngrokto start.
-
-
-
Constructor Detail
-
Builder
public Builder()
Construct a JavaNgrokConfig Builder.
-
Builder
public Builder(JavaNgrokConfig javaNgrokConfig)
Copy aJavaNgrokConfigin to a new Builder.- Parameters:
javaNgrokConfig- The JavaNgrokConfig to copy.
-
-
Method Detail
-
withNgrokVersion
public JavaNgrokConfig.Builder withNgrokVersion(NgrokVersion ngrokVersion)
The major version ofngrokto be used.
-
withMaxLogs
public JavaNgrokConfig.Builder withMaxLogs(int maxLogs)
The maximum number ofngroklogs to retain in the monitoring thread.- Throws:
java.lang.IllegalArgumentException- The argument was invalid.
-
withStartupTimeout
public JavaNgrokConfig.Builder withStartupTimeout(int startupTimeout)
The max timeout, in seconds, to wait forngrokto start.- Throws:
java.lang.IllegalArgumentException- The argument was invalid.
-
withoutMonitoring
public JavaNgrokConfig.Builder withoutMonitoring()
Don't keep monitoringngrok(for logs, etc.) after startup is complete.
-
withNgrokPath
public JavaNgrokConfig.Builder withNgrokPath(java.nio.file.Path ngrokPath)
The path to thengrokbinary, defaults to being placed in the same directory asngrok'sconfigs.
-
withConfigPath
public JavaNgrokConfig.Builder withConfigPath(java.nio.file.Path configPath)
The path to thengrokconfig file, defaults tongrok'sdefault config location.
-
withAuthToken
public JavaNgrokConfig.Builder withAuthToken(java.lang.String authToken)
Angrokauthtoken to pass to commands (overrides what is in the config). If not set here, theJavaNgrokConfig.Builderwill attempt to use the environment variableNGROK_AUTHTOKENif it is set.
-
withRegion
public JavaNgrokConfig.Builder withRegion(Region region)
The region in whichngrokshould start.
-
withLogEventCallback
public JavaNgrokConfig.Builder withLogEventCallback(java.util.function.Function<NgrokLog,java.lang.Void> logEventCallback)
A callback that will be invoked each timengrokemits a log.keepMonitoringmust be set totrueor the function will stop being called afterngrokfinishes starting. SeeJavaNgrokConfigfor example usage.
-
withApiKey
public JavaNgrokConfig.Builder withApiKey(java.lang.String apiKey)
AngrokAPI key. If not set here, theJavaNgrokConfig.Builderwill attempt to use the environment variableNGROK_API_KEYif it is set.
-
withConfigVersion
public JavaNgrokConfig.Builder withConfigVersion(ConfigVersion configVersion)
Thengrokconfig version.
-
build
public JavaNgrokConfig build()
Build theJavaNgrokConfig.
-
-