Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Ctx is a context that will be used to start ngrok tunnel.
Ctx context.Context
// Enabled defines if ngrok tunnel should be started.
Enabled bool
// Enable logging of ngrok events to pocketbase logger
EnableLogging bool
// AuthToken is your ngrok auth token. You can get it from https://dashboard.ngrok.com/auth
AuthToken string
// AfterSetup is a callback function that will be called after ngrok tunnel is started.
AfterSetup func(url *url.URL) error
// TunnelForwarder is optional. When set, used instead of ngrok for creating tunnels.
// Primarily useful for testing without a real ngrok connection.
TunnelForwarder TunnelForwarder
}
Options defines optional struct to customize the default plugin behavior.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func MustRegister ¶
MustRegister is a helper function that registers plugin and panics if error occurred.
type TunnelForwarder ¶ added in v0.14.0
type TunnelForwarder interface {
Forward(ctx context.Context, upstreamAddr, authToken string, enableLogging bool, logger interface{}) (*url.URL, error)
}
TunnelForwarder creates ngrok tunnels. Used for dependency injection in tests. When nil, the default ngrok implementation is used.
Click to show internal directories.
Click to hide internal directories.