laneurl

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package laneurl parses WireHop carrier URLs.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalid indicates a malformed or unsupported WireHop lane URL.
	ErrInvalid = errors.New("invalid lane URL")
)

Functions

func ValidDialIP

func ValidDialIP(address netip.Addr) bool

ValidDialIP reports whether address can identify one unicast carrier destination.

Types

type Scheme

type Scheme string

Scheme identifies one supported carrier protocol.

const (
	// TCP identifies an insecure raw TCP carrier.
	TCP Scheme = "tcp"
	// TLS identifies a raw TCP carrier protected by TLS.
	TLS Scheme = "tls"
	// WS identifies an insecure WebSocket carrier.
	WS Scheme = "ws"
	// WSS identifies a WebSocket carrier protected by TLS.
	WSS Scheme = "wss"
)

func (Scheme) Secure

func (s Scheme) Secure() bool

Secure reports whether scheme protects the carrier with TLS.

func (Scheme) Valid

func (s Scheme) Valid() bool

Valid reports whether scheme is supported by WireHop.

func (Scheme) WebSocket

func (s Scheme) WebSocket() bool

WebSocket reports whether scheme uses a WebSocket carrier.

type URL

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

URL is one validated WireHop lane URL.

func ParseDial

func ParseDial(value string) (URL, error)

ParseDial validates a client lane URL and applies the standard WebSocket port when omitted.

func ParseListen

func ParseListen(value string) (URL, error)

ParseListen validates a server lane URL and applies the standard WebSocket port when omitted.

func (URL) Address

func (u URL) Address() string

Address returns the canonical host and port used for dialing or listening.

func (URL) EscapedPath

func (u URL) EscapedPath() string

EscapedPath returns the canonical HTTP request path for a WebSocket lane.

func (URL) Hostname

func (u URL) Hostname() string

Hostname returns the destination hostname without brackets or port.

func (URL) Port

func (u URL) Port() string

Port returns the canonical destination port.

func (URL) Scheme

func (u URL) Scheme() Scheme

Scheme returns the validated carrier scheme.

func (URL) String

func (u URL) String() string

String returns the canonical lane URL.

func (URL) Valid

func (u URL) Valid() bool

Valid reports whether u contains a parsed supported lane URL.

Jump to

Keyboard shortcuts

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