public static class JavaNgrokConfig.Builder
extends java.lang.Object
JavaNgrokConfig, see docs for that class for example usage.| Constructor and Description |
|---|
Builder()
Construct a JavaNgrokConfig Builder.
|
Builder(JavaNgrokConfig javaNgrokConfig)
Copy a
JavaNgrokConfig in to a new Builder. |
| Modifier and Type | Method and Description |
|---|---|
JavaNgrokConfig |
build()
Build the
JavaNgrokConfig. |
JavaNgrokConfig.Builder |
withApiKey(java.lang.String apiKey)
A
ngrok API key. |
JavaNgrokConfig.Builder |
withAuthToken(java.lang.String authToken)
A
ngrok authtoken to pass to commands (overrides what is in the config). |
JavaNgrokConfig.Builder |
withConfigPath(java.nio.file.Path configPath)
The path to the
ngrok config file, defaults to ngrok's default config
location. |
JavaNgrokConfig.Builder |
withConfigVersion(ConfigVersion configVersion)
The
ngrok config version. |
JavaNgrokConfig.Builder |
withLogEventCallback(java.util.function.Function<NgrokLog,java.lang.Void> logEventCallback)
A callback that will be invoked each time
ngrok emits a log. |
JavaNgrokConfig.Builder |
withMaxLogs(int maxLogs)
The maximum number of
ngrok logs to retain in the monitoring thread. |
JavaNgrokConfig.Builder |
withNgrokPath(java.nio.file.Path ngrokPath)
The path to the
ngrok binary, defaults to being placed in the same directory as
ngrok's configs. |
JavaNgrokConfig.Builder |
withNgrokVersion(NgrokVersion ngrokVersion)
The major version of
ngrok to be used. |
JavaNgrokConfig.Builder |
withoutMonitoring()
Don't keep monitoring
ngrok (for logs, etc.) after startup is complete. |
JavaNgrokConfig.Builder |
withRegion(Region region)
The region in which
ngrok should start. |
JavaNgrokConfig.Builder |
withStartupTimeout(int startupTimeout)
The max timeout, in seconds, to wait for
ngrok to start. |
public Builder()
public Builder(JavaNgrokConfig javaNgrokConfig)
JavaNgrokConfig in to a new Builder.javaNgrokConfig - The JavaNgrokConfig to copy.public JavaNgrokConfig.Builder withNgrokVersion(NgrokVersion ngrokVersion)
ngrok to be used.public JavaNgrokConfig.Builder withMaxLogs(int maxLogs)
ngrok logs to retain in the monitoring thread.java.lang.IllegalArgumentException - The argument was invalid.public JavaNgrokConfig.Builder withStartupTimeout(int startupTimeout)
ngrok to start.java.lang.IllegalArgumentException - The argument was invalid.public JavaNgrokConfig.Builder withoutMonitoring()
ngrok (for logs, etc.) after startup is complete.public JavaNgrokConfig.Builder withNgrokPath(java.nio.file.Path ngrokPath)
ngrok binary, defaults to being placed in the same directory as
ngrok's configs.public JavaNgrokConfig.Builder withConfigPath(java.nio.file.Path configPath)
ngrok config file, defaults to ngrok's default config
location.public JavaNgrokConfig.Builder withAuthToken(java.lang.String authToken)
ngrok authtoken to pass to commands (overrides what is in the config). If not set here, the
JavaNgrokConfig.Builder will attempt to use the environment variable NGROK_AUTHTOKEN if it is set.public JavaNgrokConfig.Builder withRegion(Region region)
ngrok should start.public JavaNgrokConfig.Builder withLogEventCallback(java.util.function.Function<NgrokLog,java.lang.Void> logEventCallback)
ngrok emits a log. keepMonitoring must be set
to true or the function will stop being called after ngrok finishes starting.
See JavaNgrokConfig for example usage.public JavaNgrokConfig.Builder withApiKey(java.lang.String apiKey)
ngrok API key. If not set here, the JavaNgrokConfig.Builder will attempt to use the environment
variable NGROK_API_KEY if it is set.public JavaNgrokConfig.Builder withConfigVersion(ConfigVersion configVersion)
ngrok config version.public JavaNgrokConfig build()
JavaNgrokConfig.