Documentation
¶
Index ¶
- Constants
- Variables
- func GetIsDev() bool
- func GetRefreshScriptInner(port int) string
- func MustGetAppPort() int
- func SetModeToDev()
- type Base64
- type BuildOptions
- type CSSEntryFiles
- type CleanSources
- type Config
- func (c *Config) AddPublicAssetKeys(statements *tsgen.Statements) *tsgen.Statements
- func (c *Config) BuildWave(opts BuildOptions) error
- func (c *Config) BuildWaveWithHook(hook func(isDev bool) error)
- func (c *Config) FaviconRedirect() middleware.Middleware
- func (c *Config) GetBaseFS() (fs.FS, error)
- func (c *Config) GetConfigFile() string
- func (c *Config) GetCriticalCSS() string
- func (c *Config) GetCriticalCSSStyleElement() template.HTML
- func (c *Config) GetCriticalCSSStyleElementSha256Hash() string
- func (c *Config) GetDistDir() string
- func (c *Config) GetPrivateFS() (fs.FS, error)
- func (c *Config) GetPrivateStaticDir() string
- func (c *Config) GetPublicFS() (fs.FS, error)
- func (c *Config) GetPublicFileMap() (FileMap, error)
- func (c *Config) GetPublicFileMapElements() template.HTML
- func (c *Config) GetPublicFileMapKeysBuildtime() ([]string, error)
- func (c *Config) GetPublicFileMapScriptSha256Hash() string
- func (c *Config) GetPublicFileMapURL() string
- func (c *Config) GetPublicPathPrefix() string
- func (c *Config) GetPublicStaticDir() string
- func (c *Config) GetPublicURL(originalPublicURL string) string
- func (c *Config) GetRefreshScript() template.HTML
- func (c *Config) GetRefreshScriptSha256Hash() string
- func (c *Config) GetServeStaticHandler(addImmutableCacheHeaders bool) (http.Handler, error)
- func (c *Config) GetSimplePublicFileMapBuildtime() (map[string]string, error)
- func (c *Config) GetStaticPrivateOutDir() string
- func (c *Config) GetStaticPublicOutDir() string
- func (c *Config) GetStyleSheetLinkElement() template.HTML
- func (c *Config) GetStyleSheetURL() string
- func (c *Config) GetViteManifestLocation() string
- func (c *Config) GetViteOutDir() string
- func (c *Config) GetVormaBuildtimePublicURLFuncName() string
- func (c *Config) GetVormaClientEntry() string
- func (c *Config) GetVormaClientRouteDefsFile() string
- func (c *Config) GetVormaHTMLTemplateLocation() string
- func (c *Config) GetVormaTSGenOutPath() string
- func (c *Config) GetVormaUIVariant() string
- func (c *Config) InitRuntimeCache()
- func (c *Config) MainInit(opts MainInitOptions, calledFrom string)
- func (c *Config) MustGetPublicURLBuildtime(originalPublicURL string) string
- func (c *Config) MustStartDev(_opts ...must_start_dev_opts)
- func (c *Config) ServeStaticPublicAssets(addImmutableCacheHeaders bool) func(http.Handler) http.Handler
- func (c *Config) SetupDistDir() error
- func (c *Config) ViteProdBuildWave() error
- type Dist
- type DistStatic
- type DistStaticAssets
- type DistWaveInternal
- type EvtDetails
- type FileMap
- type MainInitOptions
- type OnChangeHook
- type StaticAssetDirs
- type Timing
- type UserConfig
- type UserConfigCore
- type UserConfigVite
- type UserConfigVorma
- type UserConfigWatch
- type WatchedFile
Constants ¶
View Source
const ( CriticalCSSElementID = "wave-critical-css" StyleSheetElementID = "wave-normal-css" )
View Source
const ( PUBLIC = "public" PRIVATE = "private" )
View Source
const ( PublicFileMapJSName = "vorma_internal_public_filemap.js" PublicFileMapGobName = "public_filemap.gob" PrivateFileMapGobName = "private_filemap.gob" )
View Source
const ( OnChangeStrategyPre = "pre" OnChangeStrategyPost = "post" OnChangeStrategyConcurrent = "concurrent" OnChangeStrategyConcurrentNoWait = "concurrent-no-wait" )
View Source
const PrehashedDirname = "prehashed"
Variables ¶
View Source
var ErrConfigValidation = errors.New("config validation error")
View Source
var STATIC_FILENAMES_IGNORE_LIST = map[string]struct{}{
".DS_Store": {},
}
__TODO this should probably be a config option and use glob patterns
View Source
var TimingEnum = struct { Pre Timing Post Timing Concurrent Timing ConcurrentNoWait Timing }{ Pre: "pre", Post: "post", Concurrent: "concurrent", ConcurrentNoWait: "concurrent-no-wait", }
Functions ¶
func GetRefreshScriptInner ¶
func MustGetAppPort ¶
func MustGetAppPort() int
func SetModeToDev ¶
func SetModeToDev()
Types ¶
type BuildOptions ¶
type CSSEntryFiles ¶
type CleanSources ¶
type Config ¶
type Config struct {
// Required -- the bytes of your wave.config.json file. You can
// use go:embed or just read the file in yourself. Using go:embed
// is recommended for simpler deployments and improved performance.
WaveConfigJSON []byte
// Required -- be sure to pass in a file system that has your
// <distDir>/static directory as its ROOT. If you are using an
// embedded filesystem, you may need to use fs.Sub to get the
// correct subdirectory. Using go:embed is recommended for simpler
// deployments and improved performance.
DistStaticFS fs.FS
// Optional -- a Logger instance. If not provided, a default Logger
// will be created that writes to standard out.
Logger *slog.Logger
// contains filtered or unexported fields
}
func (*Config) AddPublicAssetKeys ¶
func (c *Config) AddPublicAssetKeys(statements *tsgen.Statements) *tsgen.Statements
If you pass nil to this function, it will return a pointer to a new Statements object. If you pass a pointer to an existing Statements object, it will mutate that object and return it.
func (*Config) BuildWave ¶
func (c *Config) BuildWave(opts BuildOptions) error
func (*Config) BuildWaveWithHook ¶
func (*Config) FaviconRedirect ¶
func (c *Config) FaviconRedirect() middleware.Middleware
func (*Config) GetBaseFS ¶
GetBaseFS returns a filesystem interface that works across different environments (dev/prod) and supports both embedded and non-embedded filesystems.
func (*Config) GetConfigFile ¶
func (*Config) GetCriticalCSS ¶
func (*Config) GetCriticalCSSStyleElement ¶
func (*Config) GetCriticalCSSStyleElementSha256Hash ¶
func (*Config) GetDistDir ¶
func (*Config) GetPrivateStaticDir ¶
func (*Config) GetPublicFileMap ¶
func (*Config) GetPublicFileMapElements ¶
func (*Config) GetPublicFileMapKeysBuildtime ¶
func (*Config) GetPublicFileMapScriptSha256Hash ¶
func (*Config) GetPublicFileMapURL ¶
func (*Config) GetPublicPathPrefix ¶
func (*Config) GetPublicStaticDir ¶
func (*Config) GetPublicURL ¶
func (*Config) GetRefreshScript ¶
func (*Config) GetRefreshScriptSha256Hash ¶
func (*Config) GetServeStaticHandler ¶
func (*Config) GetSimplePublicFileMapBuildtime ¶
func (*Config) GetStaticPrivateOutDir ¶
func (*Config) GetStaticPublicOutDir ¶
func (*Config) GetStyleSheetLinkElement ¶
func (*Config) GetStyleSheetURL ¶
func (*Config) GetViteManifestLocation ¶
func (*Config) GetViteOutDir ¶
func (*Config) GetVormaBuildtimePublicURLFuncName ¶
func (*Config) GetVormaClientEntry ¶
func (*Config) GetVormaClientRouteDefsFile ¶
func (*Config) GetVormaHTMLTemplateLocation ¶
func (*Config) GetVormaTSGenOutPath ¶
func (*Config) GetVormaUIVariant ¶
func (*Config) InitRuntimeCache ¶
func (c *Config) InitRuntimeCache()
func (*Config) MainInit ¶
func (c *Config) MainInit(opts MainInitOptions, calledFrom string)
func (*Config) MustGetPublicURLBuildtime ¶
func (*Config) MustStartDev ¶
func (c *Config) MustStartDev(_opts ...must_start_dev_opts)
func (*Config) ServeStaticPublicAssets ¶
func (*Config) SetupDistDir ¶
func (*Config) ViteProdBuildWave ¶
type DistStatic ¶
type DistStatic struct {
Assets *dirs.Dir[DistStaticAssets]
Internal *dirs.Dir[DistWaveInternal]
Keep *dirs.File
}
type DistStaticAssets ¶
type DistWaveInternal ¶
type EvtDetails ¶
type EvtDetails struct {
// contains filtered or unexported fields
}
type MainInitOptions ¶
type OnChangeHook ¶
type StaticAssetDirs ¶
type UserConfig ¶
type UserConfig struct {
Core *UserConfigCore
Vorma *UserConfigVorma
Vite *UserConfigVite
Watch *UserConfigWatch
}
type UserConfigCore ¶
type UserConfigCore struct {
ConfigLocation string
DevBuildHook string
ProdBuildHook string
MainAppEntry string
DistDir string
StaticAssetDirs StaticAssetDirs
CSSEntryFiles CSSEntryFiles
PublicPathPrefix string
ServerOnlyMode bool
}
type UserConfigVite ¶
type UserConfigVorma ¶
type UserConfigVorma struct {
IncludeDefaults *bool
UIVariant string
HTMLTemplateLocation string // Relative to your static private dir
ClientEntry string
ClientRouteDefsFile string
TSGenOutPath string // e.g., "frontend/src/vorma.gen.ts"
BuildtimePublicURLFuncName string // e.g., "waveURL", "withHash", etc.
}
type UserConfigWatch ¶
type UserConfigWatch struct {
WatchRoot string
HealthcheckEndpoint string
Include []WatchedFile
Exclude struct {
Dirs []string
Files []string
}
}
type WatchedFile ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.