endpoint

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package endpoint reduces a configured endpoint to the three parts an architecture sketch shows of it — scheme, host and port — and to nothing else (ADR-0471).

It is one package because two processes do the same reduction for two different reasons. A worker reduces the endpoints it holds before it reports them, so a credential or a path in its configuration never leaves it; the server reduces what it records and what it is told, because a report is input and not a promise. One function on both sides is what keeps "scheme, host and port" from meaning two slightly different things.

The result is rebuilt from the parsed parts rather than trimmed from the input, so user information, a path, a query or a fragment cannot survive it by an oversight in what was cut.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Scheme string
	Host   string
	Port   string
}

Address is a reduced endpoint. Port is empty when the configured value named none, which means the scheme's or the Worker Type's default; the reduction does not guess which.

func Reduce

func Reduce(raw string) (Address, bool)

Reduce reads a configured endpoint in any of the shapes the Worker Types store — a URL, "host:port", or a bare host — and returns its scheme, host and port. ok is false when the value is empty or cannot be an address.

func (Address) String

func (a Address) String() string

String writes the address the way a reader writes one: scheme://host:port, with an IPv6 host in brackets and the parts that are empty left out.

Jump to

Keyboard shortcuts

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