Class JavaNgrokConfig.Builder

  • Enclosing class:
    JavaNgrokConfig

    public static class JavaNgrokConfig.Builder
    extends java.lang.Object
    Builder for a JavaNgrokConfig, see docs for that class for example usage.
    • Constructor Detail

      • Builder

        public Builder()
      • Builder

        public Builder​(JavaNgrokConfig javaNgrokConfig)
        Copy a JavaNgrokConfig 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 the ngrok binary, defaults to ~/.ngrok2/ngrok.
      • withConfigPath

        public JavaNgrokConfig.Builder withConfigPath​(java.nio.file.Path configPath)
        The path to the ngrok config file, defaults to ~/.ngrok2/ngrok.yml.
      • withAuthToken

        public JavaNgrokConfig.Builder withAuthToken​(java.lang.String authToken)
        A ngrok authtoken to pass to commands (overrides what is in the config).
      • withoutMonitoring

        public JavaNgrokConfig.Builder withoutMonitoring()
        Don't keep monitoring ngrok (for logs, etc.) after startup is complete.
      • withMaxLogs

        public JavaNgrokConfig.Builder withMaxLogs​(int maxLogs)
        The maximum number of ngrok 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 time ngrok emits a log. keepMonitoring must be set to true or the function will stop being called after ngrok finishes starting.
      • withStartupTimeout

        public JavaNgrokConfig.Builder withStartupTimeout​(int startupTimeout)
        The max number of seconds to wait for ngrok to start before timing out.