Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultDomains = Domains{"konghq.com", "konghq.tech"}
DefaultDomains are the domains Kong serves Konnect from. The list is the switch: a deployment pointed at another domain adds it, there is nothing to turn off.
Functions ¶
func IsDomain ¶ added in v2.4.0
IsDomain reports whether domain is a bare host: parsed as an authority, it gives back the same host, with no scheme, port, path or userinfo. An entry that is a valid host but not a DNS name, e.g. a wildcard, matches no host. An IP is refused: NewServer reads the first label as a region, so it cannot match. An empty string is a bare host too: callers that need a value check it.
Types ¶
type Domains ¶ added in v2.4.0
type Domains []string
Domains is the list of domains a Konnect server URL host must belong to.
func NewDomains ¶ added in v2.4.0
NewDomains parses the comma-separated list given to --konnect-server-url-domains. An empty list is an error.
type Region ¶
type Region string
Region represents a Konnect region.
const ( // RegionGlobal represents the global region. RegionGlobal Region = "global" )
These are the well-known Konnect regions. The list is not exhaustive.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a type to represent a server.
func NewServer ¶
NewServer creates a new Server from a string. It accepts either a full URL or a hostnameWithoutRegion.
func (Server) Domain ¶ added in v2.2.0
Domain returns the registrable domain of the server URL, i.e. the last two DNS labels of the hostname (e.g. "konghq.com" from "us.api.konghq.com"). If the hostname has fewer than two labels it returns the full hostname.
func (Server) GlobalURL ¶ added in v2.4.0
GlobalURL returns the URL of the global endpoint of the Server's domain, e.g. "https://global.svc.konghq.com/api" for a Server built from "https://us.svc.konghq.com/api".