Documentation
¶
Overview ¶
Package publicurl resolves the URL users reach a ShellHub instance at.
Index ¶
Constants ¶
View Source
const ( // ErrCodeInvalidDomain is the code reported when the domain does not make a URL. ErrCodeInvalidDomain = iota + 1 // ErrCodeInvalidOverride is the code reported when the override is not an http or https origin. ErrCodeInvalidOverride )
View Source
const ErrLayer = "publicurl"
ErrLayer is the layer that publicurl errors are reported from.
Variables ¶
View Source
var ( // ErrInvalidDomain is returned by [Resolve] when the domain does not make a URL with a host. It // is joined with the parse error when the domain does not parse. ErrInvalidDomain = errors.New("invalid SHELLHUB_DOMAIN", ErrLayer, ErrCodeInvalidDomain) // ErrInvalidOverride is returned by [Resolve] when the override is not an http or https URL made // of a host and an optional port from 1 to 65535 alone: no userinfo, and nothing past the host // but a trailing slash. It is joined with the parse error when the override does not parse. ErrInvalidOverride = errors.New("invalid SHELLHUB_PUBLIC_URL: want an http or https URL with only a host and an optional port", ErrLayer, ErrCodeInvalidOverride) )
Functions ¶
func Resolve ¶
Resolve returns the URL users reach the instance at. A non-empty override, set when TLS ends before the gateway, wins. Otherwise the URL is built from domain, with autoSSL deciding the scheme when domain carries none. The URL never ends in a slash, so a path can be appended to it. It returns ErrInvalidOverride or ErrInvalidDomain when the one it uses is unusable.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.