frontend

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package frontend provides a static file server for the frontend assets.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFrontendAddrRequired = errors.New("frontend address is required when frontend is enabled")
)

ErrFrontendAddrRequired is returned when frontend is enabled but no address is configured

Functions

func NewHandler added in v0.0.30

func NewHandler(cfg *InjectedConfig) (http.Handler, error)

NewHandler creates a new frontend HTTP handler with SPA fallback support. If cfg is non-nil, its fields are injected as window.__CONFIG__ into index.html.

Types

type Config

type Config struct {
	Enabled bool   `yaml:"enabled" default:"false"`
	Addr    string `yaml:"addr" default:":8080" validate:"hostname_port"`
}

Config represents frontend service configuration

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the frontend configuration

type InjectedConfig added in v0.1.0

type InjectedConfig struct {
	ManagementEnabled bool     `json:"managementEnabled,omitempty"`
	AuthMethods       []string `json:"authMethods,omitempty"`
}

InjectedConfig holds runtime configuration injected into the frontend HTML.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL