Documentation
¶
Index ¶
- func EnsureFrontendDevServer(ctx context.Context) (chan struct{}, error)
- func FindAvailablePort(startPort int, maxAttempts int) (int, error)
- func FormatTemplateHtml(opts FormatOptions) (string, error)
- func Init(fs embed.FS, tmpl string)
- func ProxyDev(mux *http.ServeMux) error
- func RegisterAPI(mux *http.ServeMux) error
- func Serve(port int, dev bool) error
- func ServeComponent(port int, opts ServeOptions) error
- func Static(mux *http.ServeMux, opts StaticOptions) error
- type FormatOptions
- type ServeOptions
- type StaticOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureFrontendDevServer ¶ added in v0.0.99
func FindAvailablePort ¶ added in v0.0.96
FindAvailablePort finds a port starting from startPort
func FormatTemplateHtml ¶ added in v0.0.96
func FormatTemplateHtml(opts FormatOptions) (string, error)
FormatTemplateHtml formats the template HTML with the given options
func RegisterAPI ¶
func ServeComponent ¶ added in v0.0.96
func ServeComponent(port int, opts ServeOptions) error
Types ¶
type FormatOptions ¶ added in v0.0.96
type FormatOptions struct {
Title string // __TITLE__ placeholder
Render string // __RENDER__ placeholder (default: "renderComponent")
Component string // __COMPONENT__ placeholder (mandatory)
ComponentProps string // __COMPONENT_PROPS__ placeholder (default: "{}")
}
FormatOptions contains the options for formatting the template HTML
type ServeOptions ¶ added in v0.0.96
type StaticOptions ¶ added in v0.0.96
type StaticOptions struct {
IndexHtml string // Custom HTML content to serve instead of embedded index.html
}
Click to show internal directories.
Click to hide internal directories.