httpingress

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheck

type HealthCheck struct {
	Status string `json:"status"`
	Error  string `json:"error,omitempty"`
}

HealthCheck represents a single component health check

type HealthResponse

type HealthResponse struct {
	Status string                 `json:"status"`
	Checks map[string]HealthCheck `json:"checks"`
}

HealthResponse represents the JSON response for /health endpoint

type IngressConfig

type IngressConfig struct {
	RequestTimeout time.Duration
	DataPath       string
}

type Server

type Server struct {
	Log *slog.Logger
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	ctx context.Context,
	log *slog.Logger,
	config IngressConfig,
	rpcClient rpc.Client,
	aa activator.AppActivator,
	httpMetrics *metrics.HTTPMetrics,
	logWriter observability.LogWriter,
) *Server

func (*Server) AcquireTunnel added in v0.6.1

func (h *Server) AcquireTunnel(ctx context.Context, hostname, path string) (*TunnelConn, error)

AcquireTunnel resolves a hostname to an app, acquires a lease to a running sandbox, and returns the sandbox URL. This is similar to DoRequest but doesn't execute a request — it gives the caller direct access to the sandbox URL for protocols that need custom connection handling (e.g., WebSocket tunneling).

The path parameter is checked against blocked paths (e.g., admin endpoints). If the route requires OIDC authentication, the tunnel is rejected since OIDC flows cannot be performed over tunneled connections.

func (*Server) DeriveApp

func (h *Server) DeriveApp(host string) (string, bool)

func (*Server) DoRequest added in v0.3.1

DoRequest handles internal HTTP requests to app sandboxes. This method reuses the same lease management infrastructure as the HTTP proxy but is called directly via Go method invocation rather than through the HTTP listener.

func (*Server) ServeHTTP

func (h *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

type TunnelConn added in v0.6.1

type TunnelConn struct {
	// URL is the base URL of the sandbox (e.g., "http://10.0.0.5:8080").
	URL   string
	AppID string
	// contains filtered or unexported fields
}

TunnelConn represents a resolved connection to an app sandbox. The caller is responsible for calling Release when done to return the lease.

func (*TunnelConn) Release added in v0.6.1

func (tc *TunnelConn) Release()

Release returns the lease to the pool.

Jump to

Keyboard shortcuts

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