Documentation
¶
Overview ¶
Package siterouting is the Site routing integration's items (#2659): every hostname the platform serves for sites and applications, computed from what is stored, never from what a call site says it changed. Each environment's address on the pages domain, each application's page origin, and each added domain, as the request's hosts entries.
Index ¶
- Constants
- Variables
- type Lookup
- func (l *Lookup) Domains(ctx context.Context, admin bool, domains []site.Domain) []site.Domain
- func (l *Lookup) Of(ctx context.Context, admin bool, hosts []string) map[string]*site.Routing
- func (l *Lookup) Origin(ctx context.Context, admin bool, address string) *site.Routing
- func (*Lookup) Refusal(err error) (status int, message string)
- func (l *Lookup) Retry(ctx context.Context, admin bool, st *site.Site, domains []site.Domain) error
- func (l *Lookup) Site(ctx context.Context, admin bool, st *site.Site, domains []site.Domain) (routed []site.Domain, byEnv map[string]*site.Routing)
- type Source
Constants ¶
const ( KindPages = "pages" KindApplication = "application" KindDomain = "domain" )
The kinds of hostname.
Variables ¶
var ErrNoRouting = errors.New("no site routing script is chosen")
ErrNoRouting is a retry with no routing script chosen.
Functions ¶
This section is empty.
Types ¶
type Lookup ¶
type Lookup struct {
Service *integration.Service
Addressing func() site.Addressing
}
Lookup is the Site routing integration as the places that show a hostname read it: each hostname's status while a script is chosen, and a retry. Its Service is set once the integrations are wired; nil, or a Lookup with no Service, shows nothing and retries nothing.
func (*Lookup) Domains ¶
Domains is domains with each one's status, as they are when no script is chosen. The caller's slice is not changed.
func (*Lookup) Of ¶
Of is each host's status, nil when no script is chosen. An administrator reads the run error of a host the script itself failed; anyone else reads one sentence. A read that fails shows nothing rather than failing the page.
func (*Lookup) Refusal ¶
Refusal is the HTTP status and sentence a retry Retry refused is answered with.
func (*Lookup) Retry ¶
Retry asks the Site routing script to run again for someone who can see st and domains: at once for an administrator; for anyone else only when one of the site's hostnames failed, and not just after a run started (integration.Service.RetryFailed).
func (*Lookup) Site ¶
func (l *Lookup) Site(ctx context.Context, admin bool, st *site.Site, domains []site.Domain) (routed []site.Domain, byEnv map[string]*site.Routing)
Site is a site's domains with each one's status, and each environment's pages address status by environment, the second nil when no script is chosen.
type Source ¶
type Source struct {
Sites func(ctx context.Context) ([]site.Site, error)
Domains func(ctx context.Context) ([]site.Domain, error)
Apps func(ctx context.Context) ([]application.Application, error)
Addressing func() site.Addressing
}
Source reads what the hostnames are computed from.