Documentation
¶
Index ¶
- type Config
- type ServerHandler
- func (h *ServerHandler) MainInputFileRelativePath() string
- func (h *ServerHandler) NewFileEvent(fileName, extension, filePath, event string) error
- func (h *ServerHandler) RestartServer() error
- func (h *ServerHandler) StartServer(wg *sync.WaitGroup)
- func (h *ServerHandler) SupportedExtensions() []string
- func (h *ServerHandler) UnobservedFiles() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
AppRootDir string // e.g., /home/user/project (application root directory)
SourceDir string // directory location of main.go e.g., src/cmd/appserver (relative to AppRootDir)
OutputDir string // compilation and execution directory e.g., deploy/appserver (relative to AppRootDir)
PublicDir string // default public dir for generated server (e.g., src/web/public)
MainInputFile string // main input file name (default: "main.go", can be "server.go", etc.)
ArgumentsForCompilingServer func() []string // e.g., []string{"-X 'main.version=v1.0.0'"}
ArgumentsToRunServer func() []string // e.g., []string{"dev"}
AppPort string // e.g., 8080
Logger func(message ...any) // For logging output
ExitChan chan bool // Global channel to signal shutdown
}
type ServerHandler ¶
type ServerHandler struct {
*Config
// contains filtered or unexported fields
}
func New ¶
func New(c *Config) *ServerHandler
func (*ServerHandler) MainInputFileRelativePath ¶
func (h *ServerHandler) MainInputFileRelativePath() string
MainInputFileRelativePath returns the path relative to AppRootDir (e.g., "src/cmd/appserver/main.go")
func (*ServerHandler) NewFileEvent ¶
func (h *ServerHandler) NewFileEvent(fileName, extension, filePath, event string) error
event: create,write,remove,rename
func (*ServerHandler) RestartServer ¶
func (h *ServerHandler) RestartServer() error
func (*ServerHandler) StartServer ¶
func (h *ServerHandler) StartServer(wg *sync.WaitGroup)
Start inicia el servidor como goroutine
func (*ServerHandler) SupportedExtensions ¶
func (h *ServerHandler) SupportedExtensions() []string
func (*ServerHandler) UnobservedFiles ¶
func (h *ServerHandler) UnobservedFiles() []string
UnobservedFiles returns the list of files that should not be tracked by file watchers eg: main.exe, main_temp.exe
Click to show internal directories.
Click to hide internal directories.