Documentation
¶
Index ¶
- Variables
- func AssetsFromEmbed(prefix string, dir fs.FS) fs.FS
- func AssetsFromPath(path string) fs.FS
- func ContextWithRemoteConfig(ctx context.Context, rc config.RemoteConfig) context.Context
- func ContextWithTemplates(ctx context.Context, t TemplateCache) context.Context
- func NewHandler(rc config.RemoteConfig, templates TemplateCache, staticAssets fs.FS) http.Handler
- func RemoteConfigFromContext(ctx context.Context) (config.RemoteConfig, error)
- func RenderAndRespond(w http.ResponseWriter, r *http.Request, name string, data any, ...)
- func Router(staticAssets fs.FS) http.Handler
- func TemplatesFromContext(ctx context.Context, name ...string) (*template.Template, error)
- type AssetDir
- type CacheStrategy
- type ConfigPage
- type ControlView
- type GroupView
- type NetworkView
- type ServiceStatus
- type ServiceView
- type ServicesPage
- type StatusCount
- type TemplateCache
- type ZoneView
Constants ¶
This section is empty.
Variables ¶
View Source
var StaticAssets fs.FS
View Source
var TemplateAssets fs.FS
Functions ¶
func AssetsFromPath ¶
func ContextWithRemoteConfig ¶
func ContextWithTemplates ¶
func ContextWithTemplates(ctx context.Context, t TemplateCache) context.Context
func NewHandler ¶
func NewHandler(rc config.RemoteConfig, templates TemplateCache, staticAssets fs.FS) http.Handler
NewHandler returns the dashboard handler with rc and templates attached to every request context, for hosts (like the caddy plugin) that don't own the server's base context.
func RemoteConfigFromContext ¶
func RemoteConfigFromContext(ctx context.Context) (config.RemoteConfig, error)
func RenderAndRespond ¶
Types ¶
type ConfigPage ¶
type ConfigPage struct {
Ready bool
DefaultZone string
// DefaultZoneMissing is set when the default zone isn't in Zones.
DefaultZoneMissing bool
Zones []ZoneView
Networks []NetworkView
Groups []GroupView
DefaultPolicy []ControlView
DefaultAction string
}
func BuildConfigPage ¶
func BuildConfigPage(rc config.RemoteConfig) ConfigPage
type ControlView ¶
type NetworkView ¶
type ServiceStatus ¶
type ServiceStatus string
ServiceStatus summarizes how a service is exposed.
const ( // StatusRouted services get a reverse-proxy route (and DNS pointing at // the proxy). StatusRouted ServiceStatus = "proxied" // StatusDirect services bypass the proxy; only DNS publishes them, // pointing straight at their endpoints. StatusDirect ServiceStatus = "direct" // StatusUnpublished services carry the no-publish tag. StatusUnpublished ServiceStatus = "unpublished" // StatusInvalid services are published but can't be served, e.g. they // have no endpoints or no usable zones. StatusInvalid ServiceStatus = "invalid" )
type ServiceView ¶
type ServiceView struct {
ID string
Name string
Type string
Status ServiceStatus
Hostnames []string
Endpoints []string
// Policy is the effective ACL policy; PolicyInherited is true when it
// comes from the global default rather than the service's own meta.
Policy []ControlView
PolicyInherited bool
Warnings []string
}
type ServicesPage ¶
type ServicesPage struct {
Ready bool
Services []ServiceView
// Counts holds the number of services per status, in display order,
// omitting statuses with no services.
Counts []StatusCount
}
func BuildServicesPage ¶
func BuildServicesPage(rc config.RemoteConfig) ServicesPage
type StatusCount ¶
type StatusCount struct {
Status ServiceStatus
Count int
}
type TemplateCache ¶
var EmbeddedTemplates TemplateCache
func NewTemplateCache ¶
func NewTemplateCache(templates fs.FS, strategy CacheStrategy) TemplateCache
func TemplateCacheFromPath ¶
func TemplateCacheFromPath(path string, strategy CacheStrategy) TemplateCache
Click to show internal directories.
Click to hide internal directories.