tunneldriver

package
v0.0.0-...-a36a61a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAndSanitizeEndpointURL

func ParseAndSanitizeEndpointURL(input string, isIngressURL bool) (*url.URL, error)

ParseAndSanitizeEndpointURL parses/sanitizes an input string for an endpoint url and provides a *url.URL following the restrictions for endpoints. when isIngressURL is true, the input string does not require a port (excluding tcp addresses)

Types

type Dialer

type Dialer interface {
	DialContext(context.Context, string, string) (net.Conn, error)
}

Dialer is the portion of *net.Dialer that this package uses. This is exported only for testing reasons.

type TunnelDriver

type TunnelDriver struct {
	// contains filtered or unexported fields
}

TunnelDriver is a driver for creating and deleting ngrok tunnels

func New

func New(ctx context.Context, logger logr.Logger, opts TunnelDriverOpts) (*TunnelDriver, error)

New creates and initializes a new TunnelDriver

func (*TunnelDriver) Alive

func (td *TunnelDriver) Alive(_ context.Context, _ *http.Request) error

Alive implements the healthcheck.HealthChecker interface for when the TunnelDriver is alive

func (*TunnelDriver) CreateAgentEndpoint

func (td *TunnelDriver) CreateAgentEndpoint(ctx context.Context, name string, spec ngrokv1alpha1.AgentEndpointSpec, trafficPolicy string) error

CreateAgentEndpoint will create or update an agent endpoint by name using the provided desired configuration state

func (*TunnelDriver) CreateTunnel

func (td *TunnelDriver) CreateTunnel(ctx context.Context, name string, spec ingressv1alpha1.TunnelSpec) error

CreateTunnel creates and starts a new tunnel in a goroutine. If a tunnel with the same name already exists, it will be stopped and replaced with a new tunnel unless the labels match.

func (*TunnelDriver) DeleteAgentEndpoint

func (td *TunnelDriver) DeleteAgentEndpoint(ctx context.Context, name string) error

func (*TunnelDriver) DeleteTunnel

func (td *TunnelDriver) DeleteTunnel(ctx context.Context, name string) error

DeleteTunnel stops and deletes a tunnel

func (*TunnelDriver) Ready

func (td *TunnelDriver) Ready(_ context.Context, _ *http.Request) error

Ready implements the healthcheck.HealthChecker interface for when the TunnelDriver is ready to serve tunnels

type TunnelDriverComments

type TunnelDriverComments struct {
	Gateway string `json:"gateway,omitempty"`
}

type TunnelDriverOpts

type TunnelDriverOpts struct {
	ServerAddr string
	Region     string
	RootCAs    string
	Comments   *TunnelDriverComments
}

TunnelDriverOpts are options for creating a new TunnelDriver

Jump to

Keyboard shortcuts

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