config

package
v0.0.0-...-5216202 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PROXY protocol disabled
	ProxyProtoNone = ProxyProtoVersion(0)
	// PROXY protocol v1
	ProxyProtoV1 = ProxyProtoVersion(1)
	// PROXY protocol v2
	ProxyProtoV2 = ProxyProtoVersion(2)
)
View Source
const (
	SchemeHTTP = Scheme("http")
	// The 'https' URL scheme.
	SchemeHTTPS = Scheme("https")
)

The 'http' URL scheme.

Variables

This section is empty.

Functions

func WithAllowCIDR

func WithAllowCIDR(net ...*net.IPNet) interface {
	HTTPEndpointOption
	TCPEndpointOption
	TLSEndpointOption
}

Add the provided net.IPNet to the [CIDRRestriction].Allowed list.

func WithAllowCIDRString

func WithAllowCIDRString(cidr ...string) interface {
	HTTPEndpointOption
	TCPEndpointOption
	TLSEndpointOption
}

Add the provided CIDRS to the [CIDRRestriction].Allowed list.

func WithDenyCIDR

func WithDenyCIDR(net ...*net.IPNet) interface {
	HTTPEndpointOption
	TCPEndpointOption
	TLSEndpointOption
}

Add the provided net.IPNet to the [CIDRRestriction].Denied list.

func WithDenyCIDRString

func WithDenyCIDRString(cidr ...string) interface {
	HTTPEndpointOption
	TCPEndpointOption
	TLSEndpointOption
}

Add the provided CIDRS to the [CIDRRestriction].Denied list.

func WithDomain

func WithDomain(name string) interface {
	HTTPEndpointOption
	TLSEndpointOption
}

WithDomain sets the domain for this edge.

func WithForwardsTo

func WithForwardsTo(meta string) interface {
	HTTPEndpointOption
	TCPEndpointOption
	TLSEndpointOption
}

WithForwardsTo sets the ForwardsTo string for this tunnel. This can be veiwed via the API or dashboard.

func WithHTTPHandler

WithHTTPHandler adds the provided credentials to the list of basic authentication credentials.

func WithHTTPServer

WithHTTPServer adds the provided credentials to the list of basic authentication credentials.

func WithMetadata

WithMetadata sets the opaque metadata string for this tunnel.

func WithMutualTLSCA

func WithMutualTLSCA(certs ...*x509.Certificate) interface {
	HTTPEndpointOption
	TLSEndpointOption
}

WithMutualTLSCA adds a list of x509.Certificate's to use for mutual TLS authentication. These will be used to authenticate client certificates for requests at the ngrok edge.

func WithProxyProto

func WithProxyProto(version ProxyProtoVersion) interface {
	HTTPEndpointOption
	TCPEndpointOption
	TLSEndpointOption
}

WithProxyProto sets the PROXY protocol version for connections over this tunnel.

Types

type HTTPEndpointOption

type HTTPEndpointOption interface {
	ApplyHTTP(cfg *httpOptions)
}

func WithBasicAuth

func WithBasicAuth(username, password string) HTTPEndpointOption

WithBasicAuth adds the provided credentials to the list of basic authentication credentials.

func WithCircuitBreaker

func WithCircuitBreaker(ratio float64) HTTPEndpointOption

WithCircuitBreaker sets the 5XX response ratio at which the ngrok edge will stop sending requests to this tunnel.

func WithCompression

func WithCompression() HTTPEndpointOption

WithCompression enables gzip compression.

func WithOAuth

func WithOAuth(provider string, opts ...OAuthOption) HTTPEndpointOption

WithOAuth configures this edge with the the given OAuth provider. Overwrites any previously-set OAuth configuration.

func WithOIDC

func WithOIDC(issuerURL string, clientID string, clientSecret string, opts ...OIDCOption) HTTPEndpointOption

WithOIDC configures this edge with the the given OIDC provider. Overwrites any previously-set OIDC configuration.

func WithRemoveRequestHeader

func WithRemoveRequestHeader(name string) HTTPEndpointOption

WithRemoveRequestHeader removes a header from requests to this edge.

func WithRemoveResponseHeader

func WithRemoveResponseHeader(name string) HTTPEndpointOption

WithRemoveResponseHeader removes a header from responses from this edge.

func WithRequestHeader

func WithRequestHeader(name, value string) HTTPEndpointOption

WithRequestHeader adds a header to all requests to this edge.

func WithResponseHeader

func WithResponseHeader(name, value string) HTTPEndpointOption

WithRequestHeader adds a header to all responses coming from this edge.

func WithScheme

func WithScheme(scheme Scheme) HTTPEndpointOption

WithScheme sets the scheme for this edge.

func WithWebhookVerification

func WithWebhookVerification(provider string, secret string) HTTPEndpointOption

WithWebhookVerification configures webhook vericiation for this edge.

func WithWebsocketTCPConversion

func WithWebsocketTCPConversion() HTTPEndpointOption

WithWebsocketTCPConversion enables the websocket-to-tcp converter.

type LabeledTunnelOption

type LabeledTunnelOption interface {
	ApplyLabeled(cfg *labeledOptions)
}

func WithLabel

func WithLabel(label, value string) LabeledTunnelOption

WithLabel adds a label to this tunnel's set of label, value pairs.

type OAuthOption

type OAuthOption func(cfg *oauthOptions)

func WithAllowOAuthDomain

func WithAllowOAuthDomain(domain ...string) OAuthOption

Append email domains to the list of allowed domains.

func WithAllowOAuthEmail

func WithAllowOAuthEmail(addr ...string) OAuthOption

Append email addresses to the list of allowed emails.

func WithOAuthScope

func WithOAuthScope(scope ...string) OAuthOption

Append scopes to the list of scopes to request.

type OIDCOption

type OIDCOption func(cfg *oidcOptions)

func WithAllowOIDCDomain

func WithAllowOIDCDomain(domain ...string) OIDCOption

Append email domains to the list of allowed domains.

func WithAllowOIDCEmail

func WithAllowOIDCEmail(addr ...string) OIDCOption

Append email addresses to the list of allowed emails.

func WithOIDCScope

func WithOIDCScope(scope ...string) OIDCOption

Append scopes to the list of scopes to request.

type ProxyProtoVersion

type ProxyProtoVersion int32

ProxyProtoVersion is a valid PROXY protocol version

type Scheme

type Scheme string

A URL scheme.

type TCPEndpointOption

type TCPEndpointOption interface {
	ApplyTCP(cfg *tcpOptions)
}

func WithRemoteAddr

func WithRemoteAddr(addr string) TCPEndpointOption

Set the TCP address to request for this edge.

type TLSEndpointOption

type TLSEndpointOption interface {
	ApplyTLS(cfg *tlsOptions)
}

func WithTermination

func WithTermination(certPEM, keyPEM []byte) TLSEndpointOption

WithTermination sets the key and certificate in PEM format for TLS termination at the ngrok edge.

type Tunnel

type Tunnel interface {
	// contains filtered or unexported methods
}

Tunnel is a marker trait for options that can be used to start tunnels. It should not be implemented outside of this module.

func HTTPEndpoint

func HTTPEndpoint(opts ...HTTPEndpointOption) Tunnel

Construct a new set of HTTP tunnel options.

func LabeledTunnel

func LabeledTunnel(opts ...LabeledTunnelOption) Tunnel

Construct a new set of Labeled tunnel options.

func TCPEndpoint

func TCPEndpoint(opts ...TCPEndpointOption) Tunnel

Construct a new set of HTTP tunnel options.

func TLSEndpoint

func TLSEndpoint(opts ...TLSEndpointOption) Tunnel

Construct a new set of HTTP tunnel options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL