appserver

package
v1.0.1-0...-acac574 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package appserver implements the HTTP server, routing, and request handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(dir, version string, cfg appconfig.Config, gatewayToken string, indexHTML []byte, serverCtx context.Context, refreshFn func(string, string, ...appconfig.Config) error) *Server

func (*Server) GetDataCached

func (s *Server) GetDataCached() (map[string]any, error)

getDataCached returns parsed data.json — delegates to loadData().

func (*Server) GetDataRawCached

func (s *Server) GetDataRawCached() ([]byte, error)

getDataRawCached returns cached data.json bytes — delegates to loadData().

func (*Server) HandleStaticFile

func (s *Server) HandleStaticFile(w http.ResponseWriter, r *http.Request, path, contentType string)

HandleStaticFile serves an allowlisted file from the dashboard directory.

func (*Server) PreWarm

func (s *Server) PreWarm()

PreWarm runs refresh.sh once in the background at startup so data.json is ready before the first browser request arrives.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) SystemService

func (s *Server) SystemService() *appsystem.SystemService

Jump to

Keyboard shortcuts

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