Package com.github.alexdlaird.ngrok.conf
Class JavaNgrokConfig
- java.lang.Object
-
- com.github.alexdlaird.ngrok.conf.JavaNgrokConfig
-
public class JavaNgrokConfig extends java.lang.Object
An object for managingjava-ngrok
's configuration to interact thengrok
binary.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) .withNgrokVersion(NgrokVersion.V2); final NgrokClient = new NgrokClient.Builder() .withJavaNgrokConfig(javaNgrokConfig) .build();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaNgrokConfig.Builder
Builder 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.String
getAuthToken()
Get the authtoken that will be passed to commands.java.nio.file.Path
getConfigPath()
Get the path to thengrok
config file.java.util.function.Function<NgrokLog,java.lang.Void>
getLogEventCallback()
Get the log event callback that will be invoked each timengrok
emits a log.int
getMaxLogs()
Get the maximum number ofngrok
logs to retain in the monitoring thread.java.nio.file.Path
getNgrokPath()
Get the path to thengrok
binary.NgrokVersion
getNgrokVersion()
Get the majorngrok
version to be used.Region
getRegion()
Get the region in whichngrok
will start.int
getStartupTime()
Get the startup time beforengrok
times out on boot.boolean
isKeepMonitoring()
Get whether thengrok
process will continue to be monitored after it finishes starting up.
-
-
-
Method Detail
-
getNgrokPath
public java.nio.file.Path getNgrokPath()
Get the path to thengrok
binary.
-
getConfigPath
public java.nio.file.Path getConfigPath()
Get the path to thengrok
config file.
-
getAuthToken
public java.lang.String getAuthToken()
Get the authtoken that will be passed to commands.
-
getRegion
public Region getRegion()
Get the region in whichngrok
will start.
-
isKeepMonitoring
public boolean isKeepMonitoring()
Get whether thengrok
process will continue to be monitored after it finishes starting up.
-
getMaxLogs
public int getMaxLogs()
Get the maximum number ofngrok
logs 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 timengrok
emits a log.
-
getStartupTime
public int getStartupTime()
Get the startup time beforengrok
times out on boot.
-
getNgrokVersion
public NgrokVersion getNgrokVersion()
Get the majorngrok
version to be used.
-
-