- java.lang.Object
-
- com.github.alexdlaird.ngrok.conf.JavaNgrokConfig
-
public class JavaNgrokConfig extends java.lang.ObjectAn object for managingjava-ngrok's configuration to interact thengrokbinary.Basic Usage
final Function<NgrokLog, Void> logEventCallback = ngrokLog -> { System.out.println(ngrokLog.getLine()); return null; }; final JavaNgrokConfig javaNgrokConfig = new JavaNgrokConfig.Builder() .withAuthToken("<NGROK_AUTHTOKEN>") .withRegion(Region.AU) .withLogEventCallback(logEventCallback) .withMaxLogs(10); final NgrokClient ngrokClient = new NgrokClient.Builder() .withJavaNgrokConfig(javaNgrokConfig) .build();ngrokVersion Compatibilityjava-ngrokis compatible withngrokv2 and v3, but by default it will install v3. To install v2 instead, set the version withJavaNgrokConfig.Builder.withNgrokVersion(NgrokVersion)andCreateTunnel.Builder.withNgrokVersion(NgrokVersion).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJavaNgrokConfig.BuilderBuilder for aJavaNgrokConfig, see docs for that class for example usage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetApiKey()AngrokAPI key.java.lang.StringgetAuthToken()Get thengrokauthtoken that will be passed to commands.java.nio.file.PathgetConfigPath()Get the path to thengrokconfig file.java.util.function.Function<NgrokLog,java.lang.Void>getLogEventCallback()Get the log event callback that will be invoked each timengrokemits a log.intgetMaxLogs()Get the maximum number ofngroklogs to retain in the monitoring thread.java.nio.file.PathgetNgrokPath()Get the path to thengrokbinary.NgrokVersiongetNgrokVersion()Get the majorngrokversion to be used.RegiongetRegion()Get the region in whichngrokwill start.intgetStartupTime()Get the startup time beforengroktimes out on boot.booleanisKeepMonitoring()Get whether thengrokprocess will continue to be monitored after it finishes starting up.
-
-
-
Method Detail
-
getNgrokPath
public java.nio.file.Path getNgrokPath()
Get the path to thengrokbinary.
-
getConfigPath
public java.nio.file.Path getConfigPath()
Get the path to thengrokconfig file.
-
getAuthToken
public java.lang.String getAuthToken()
Get thengrokauthtoken that will be passed to commands.
-
getRegion
public Region getRegion()
Get the region in whichngrokwill start.
-
isKeepMonitoring
public boolean isKeepMonitoring()
Get whether thengrokprocess will continue to be monitored after it finishes starting up.
-
getMaxLogs
public int getMaxLogs()
Get the maximum number ofngroklogs to retain in the monitoring thread.
-
getLogEventCallback
public java.util.function.Function<NgrokLog,java.lang.Void> getLogEventCallback()
Get the log event callback that will be invoked each timengrokemits a log.
-
getStartupTime
public int getStartupTime()
Get the startup time beforengroktimes out on boot.
-
getNgrokVersion
public NgrokVersion getNgrokVersion()
Get the majorngrokversion to be used.
-
getApiKey
public java.lang.String getApiKey()
AngrokAPI key.
-
-