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.Object
Builder for aJavaNgrokConfig
, see docs for that class for example usage.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(JavaNgrokConfig javaNgrokConfig)
Copy aJavaNgrokConfig
in to a new Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaNgrokConfig
build()
Build theJavaNgrokConfig
.JavaNgrokConfig.Builder
withApiKey(java.lang.String apiKey)
Angrok
API key.JavaNgrokConfig.Builder
withAuthToken(java.lang.String authToken)
Angrok
authtoken to pass to commands (overrides what is in the config).JavaNgrokConfig.Builder
withConfigPath(java.nio.file.Path configPath)
The path to thengrok
config file, defaults tongrok's
default config location.JavaNgrokConfig.Builder
withLogEventCallback(java.util.function.Function<NgrokLog,java.lang.Void> logEventCallback)
A callback that will be invoked each timengrok
emits a log.JavaNgrokConfig.Builder
withMaxLogs(int maxLogs)
The maximum number ofngrok
logs to retain in the monitoring thread.JavaNgrokConfig.Builder
withNgrokPath(java.nio.file.Path ngrokPath)
The path to thengrok
binary, defaults to being placed in the same directory asngrok's
configs.JavaNgrokConfig.Builder
withNgrokVersion(NgrokVersion ngrokVersion)
The major version ofngrok
to be used.JavaNgrokConfig.Builder
withoutMonitoring()
Don't keep monitoringngrok
(for logs, etc.) after startup is complete.JavaNgrokConfig.Builder
withRegion(Region region)
The region in whichngrok
should start.JavaNgrokConfig.Builder
withStartupTimeout(int startupTimeout)
The max number of seconds to wait forngrok
to start before timing out.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(JavaNgrokConfig javaNgrokConfig)
Copy aJavaNgrokConfig
in to a new Builder.- Parameters:
javaNgrokConfig
- The JavaNgrokConfig to copy.
-
-
Method Detail
-
withNgrokPath
public JavaNgrokConfig.Builder withNgrokPath(java.nio.file.Path ngrokPath)
The path to thengrok
binary, defaults to being placed in the same directory asngrok's
configs.
-
withConfigPath
public JavaNgrokConfig.Builder withConfigPath(java.nio.file.Path configPath)
The path to thengrok
config file, defaults tongrok's
default config location.
-
withAuthToken
public JavaNgrokConfig.Builder withAuthToken(java.lang.String authToken)
Angrok
authtoken to pass to commands (overrides what is in the config). If not set here, theJavaNgrokConfig.Builder
will attempt to use the environment variableNGROK_AUTHTOKEN
if it is set.
-
withRegion
public JavaNgrokConfig.Builder withRegion(Region region)
The region in whichngrok
should start.
-
withoutMonitoring
public JavaNgrokConfig.Builder withoutMonitoring()
Don't keep monitoringngrok
(for logs, etc.) after startup is complete.
-
withMaxLogs
public JavaNgrokConfig.Builder withMaxLogs(int maxLogs)
The maximum number ofngrok
logs to retain in the monitoring thread.
-
withLogEventCallback
public JavaNgrokConfig.Builder withLogEventCallback(java.util.function.Function<NgrokLog,java.lang.Void> logEventCallback)
A callback that will be invoked each timengrok
emits a log.keepMonitoring
must be set totrue
or the function will stop being called afterngrok
finishes starting.
-
withStartupTimeout
public JavaNgrokConfig.Builder withStartupTimeout(int startupTimeout)
The max number of seconds to wait forngrok
to start before timing out.
-
withNgrokVersion
public JavaNgrokConfig.Builder withNgrokVersion(NgrokVersion ngrokVersion)
The major version ofngrok
to be used.
-
withApiKey
public JavaNgrokConfig.Builder withApiKey(java.lang.String apiKey)
Angrok
API key.
-
build
public JavaNgrokConfig build()
Build theJavaNgrokConfig
.
-
-