Package com.github.alexdlaird.ngrok.conf
Class JavaNgrokConfig
- 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_AUTH_TOKEN>") .withRegion(Region.AU) .withLogEventCallback(logEventCallback) .withMaxLogs(10); final NgrokClient = new NgrokClient.Builder() .withJavaNgrokConfig(javaNgrokConfig) .build();
-
-
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.StringgetAuthToken()Get the authtoken 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.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 the authtoken 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.
-
-