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()Builder(JavaNgrokConfig javaNgrokConfig)Copy aJavaNgrokConfigin to a new Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaNgrokConfigbuild()JavaNgrokConfig.BuilderwithAuthToken(java.lang.String authToken)An authtoken to pass to commands (overrides what is in the config).JavaNgrokConfig.BuilderwithConfigPath(java.nio.file.Path configPath)The path to thengrokconfig file, defaults to~/.ngrok2/ngrok.yml.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~/.ngrok2/ngrok.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 number of seconds to wait forngrokto start before timing out.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(JavaNgrokConfig javaNgrokConfig)
Copy aJavaNgrokConfigin 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 thengrokbinary, defaults to~/.ngrok2/ngrok.
-
withConfigPath
public JavaNgrokConfig.Builder withConfigPath(java.nio.file.Path configPath)
The path to thengrokconfig 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 whichngrokshould 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 ofngroklogs 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 timengrokemits a log.keepMonitoringmust be set totrueor the function will stop being called afterngrokfinishes starting.
-
withStartupTimeout
public JavaNgrokConfig.Builder withStartupTimeout(int startupTimeout)
The max number of seconds to wait forngrokto start before timing out.
-
build
public JavaNgrokConfig build()
-
-