Documentation
¶
Overview ¶
Package urlbase holds the rules for the URLs an app is served under, for the packages that must apply them without depending on each other: config validates GOMBIT_STORAGE_LOCAL_URL and GOMBIT_STORAGE_S3_PUBLIC_URL with the same functions storage/presign and storage/s3 use, so a configuration that validates is one they accept, and it normalises and validates GOMBIT_API_PREFIX with the two APIPrefix functions below, so the prefix a loaded configuration stores is the form its routes, its OpenAPI document and the client generated from that document are all built from.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIPrefixProblem ¶ added in v0.9.0
APIPrefixProblem reports why prefix cannot be served as an API prefix, or "" when it can. A prefix that has a canonical form but is not already it is still a problem: the callers that read config.API.Prefix get the field, not this function, so only a canonical value reaches all of them unchanged.
func Base ¶
Base checks where a store's URLs are served (presign.Config.Base): a path ("/_storage") or an http(s) URL with one ("https://files.example.com/_storage"), without a query, fragment, credentials, or trailing '/', whose path is plain (no percent-escapes: the path is matched against requests as decoded, so it must be the same written either way). It returns the path, or why base is not one.
func CanonicalAPIPrefix ¶ added in v0.9.0
CanonicalAPIPrefix returns the canonical form of an API prefix, or "" when it has none, which APIPrefixProblem explains.
Types ¶
This section is empty.