Documentation
¶
Index ¶
- Variables
- type Config
- type ConfigError
- type EmbedConfig
- type Factory
- func (f *Factory) CreateEmbeddedServer(config *EmbedConfig) (*redi.Server, error)
- func (f *Factory) CreateServer(config *Config) (*redi.Server, error)
- func (f *Factory) CreateServerFromFS(embedFS fs.FS, port int, version string) (*redi.Server, error)
- func (f *Factory) CreateServerFromRoot(root string, port int, version string) (*redi.Server, error)
- type Launcher
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFactory = NewFactory()
Default factory instance
View Source
var DefaultLauncher = NewLauncher()
Default launcher instance
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Root string
Port int
Version string
LogFile string
Daemon bool
RoutesDir string // Directory for routes (default: "routes")
// Gzip compression settings
EnableGzip bool // Enable gzip compression (default: true)
GzipLevel int // Compression level (-1 to 9, -1 = default)
// Cache settings
EnableCache bool // Enable compilation cache (default: false)
// Prebuild settings
Prebuild bool // Pre-compile all Svelte components before starting
PrebuildParallel int // Number of parallel workers for pre-building
OnlyPrebuild bool // Only run prebuild without starting server
}
Config represents server configuration
type ConfigError ¶
ConfigError represents a configuration error
func (ConfigError) Error ¶
func (e ConfigError) Error() string
type EmbedConfig ¶
type EmbedConfig struct {
EmbedFS fs.FS
Port int
Version string
RoutesDir string // Directory for routes (default: "routes")
// Gzip compression settings
EnableGzip bool // Enable gzip compression (default: true)
GzipLevel int // Compression level (-1 to 9, -1 = default)
// Cache settings
EnableCache bool // Enable compilation cache (default: false)
}
EmbedConfig represents embedded server configuration
func NewEmbedConfig ¶
func NewEmbedConfig(embedFS fs.FS) *EmbedConfig
NewEmbedConfig creates a new embedded server configuration
func (*EmbedConfig) Validate ¶
func (c *EmbedConfig) Validate() error
Validate validates the embedded server configuration
type Factory ¶
type Factory struct{}
Factory creates redi servers with various configurations
func (*Factory) CreateEmbeddedServer ¶
func (f *Factory) CreateEmbeddedServer(config *EmbedConfig) (*redi.Server, error)
CreateEmbeddedServer creates an embedded redi server
func (*Factory) CreateServer ¶
CreateServer creates a standard redi server
func (*Factory) CreateServerFromFS ¶
CreateServerFromFS creates a server from a filesystem
Click to show internal directories.
Click to hide internal directories.