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()
JavaNgrokConfig.Builder
withAuthToken(java.lang.String authToken)
An 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 to~/.ngrok2/ngrok.yml
.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~/.ngrok2/ngrok
.JavaNgrokConfig.Builder
withNgrokVersion(NgrokVersion ngrokVersion)
The major version ofto 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~/.ngrok2/ngrok
.
-
withConfigPath
public JavaNgrokConfig.Builder withConfigPath(java.nio.file.Path configPath)
The path to thengrok
config file, defaults to~/.ngrok2/ngrok.yml
.
-
withAuthToken
public JavaNgrokConfig.Builder withAuthToken(java.lang.String authToken)
An authtoken to pass to commands (overrides what is in the config).
-
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 ofto be used.
-
build
public JavaNgrokConfig build()
-
-