dev

package
v1.0.71 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DevDashboard

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

DevDashboard provides an interactive web interface for development

func NewDevDashboard

func NewDevDashboard(server *DevServer, port int) *DevDashboard

NewDevDashboard creates a new development dashboard

func (*DevDashboard) Start

func (d *DevDashboard) Start() error

Start starts the dashboard server

func (*DevDashboard) Stop

func (d *DevDashboard) Stop() error

Stop stops the dashboard server

type DevServer

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

DevServer provides development server with hot reload and debugging

func NewDevServer

func NewDevServer(app *lift.App, config *DevServerConfig) *DevServer

NewDevServer creates a new development server

func (*DevServer) GetStats

func (s *DevServer) GetStats() SafeDevStats

GetStats returns current development server statistics

func (*DevServer) Start

func (s *DevServer) Start(ctx context.Context) error

Start starts the development server

func (*DevServer) Stop

func (s *DevServer) Stop() error

Stop stops the development server

type DevServerConfig

type DevServerConfig struct {
	BuildCommand  string        `json:"build_command"`
	LogLevel      string        `json:"log_level"`
	WatchPaths    []string      `json:"watch_paths"`
	Port          int           `json:"port"`
	ProfilerPort  int           `json:"profiler_port"`
	DashboardPort int           `json:"dashboard_port"`
	WatchInterval time.Duration `json:"watch_interval"`
	RestartDelay  time.Duration `json:"restart_delay"`
	HotReload     bool          `json:"hot_reload"`
	DebugMode     bool          `json:"debug_mode"`
	EnableCORS    bool          `json:"enable_cors"`
}

DevServerConfig configures the development server

func DefaultDevServerConfig

func DefaultDevServerConfig() *DevServerConfig

DefaultDevServerConfig returns sensible defaults for development

type DevStats

type DevStats struct {
	LastRestart    time.Time     `json:"last_restart"`
	Requests       int64         `json:"requests"`
	Errors         int64         `json:"errors"`
	Restarts       int64         `json:"restarts"`
	AverageLatency time.Duration `json:"average_latency"`
	Uptime         time.Duration `json:"uptime"`
	HotReloads     int64         `json:"hot_reloads"`
	BuildTime      time.Duration `json:"build_time"`
	// contains filtered or unexported fields
}

DevStats holds internal development server statistics (with mutex)

type FileEvent

type FileEvent struct {
	Timestamp time.Time `json:"timestamp"`
	Path      string    `json:"path"`
	Type      string    `json:"type"`
}

FileEvent represents a file change event

type FileWatcher

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

FileWatcher monitors file changes

func NewFileWatcher

func NewFileWatcher(paths []string, interval time.Duration) *FileWatcher

NewFileWatcher creates a new file watcher

func (*FileWatcher) Events

func (w *FileWatcher) Events() <-chan FileEvent

Events returns the events channel

func (*FileWatcher) Start

func (w *FileWatcher) Start() error

Start starts the file watcher

func (*FileWatcher) Stop

func (w *FileWatcher) Stop()

Stop stops the file watcher

type LogEntry added in v1.0.37

type LogEntry struct {
	Timestamp time.Time              `json:"timestamp"`
	Fields    map[string]interface{} `json:"fields,omitempty"`
	Level     string                 `json:"level"`
	Message   string                 `json:"message"`
}

LogEntry represents a single log entry

type LogService added in v1.0.37

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

LogService manages log collection and retrieval

func LogServiceFactory added in v1.0.37

func LogServiceFactory(logFile string, ff *features.FeatureFlags) *LogService

LogServiceFactory creates the appropriate log service based on environment

func NewLogService added in v1.0.37

func NewLogService(logFile string, ff *features.FeatureFlags) *LogService

NewLogService creates a new log service

func (*LogService) AddLog added in v1.0.37

func (ls *LogService) AddLog(entry LogEntry)

AddLog adds a log entry

func (*LogService) Clear added in v1.0.37

func (ls *LogService) Clear()

Clear clears all logs

func (*LogService) GetLogsSince added in v1.0.37

func (ls *LogService) GetLogsSince(since time.Time) []LogEntry

GetLogsSince returns logs since a given timestamp

func (*LogService) GetRecentLogs added in v1.0.37

func (ls *LogService) GetRecentLogs(limit int) []LogEntry

GetRecentLogs returns the most recent log entries

func (*LogService) SearchLogs added in v1.0.37

func (ls *LogService) SearchLogs(query string) []LogEntry

SearchLogs searches for logs containing a query string

func (*LogService) Stop added in v1.0.37

func (ls *LogService) Stop()

Stop stops the log service

type MockLogService added in v1.0.37

type MockLogService struct {
	*LogService
	// contains filtered or unexported fields
}

MockLogService provides mock logs for development

func NewMockLogService added in v1.0.37

func NewMockLogService(ff *features.FeatureFlags) *MockLogService

NewMockLogService creates a mock log service for development

type ProfilerServer

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

ProfilerServer provides pprof endpoints for performance profiling

func NewProfilerServer

func NewProfilerServer(port int) *ProfilerServer

NewProfilerServer creates a new profiler server

func (*ProfilerServer) Start

func (p *ProfilerServer) Start() error

Start starts the profiler server

func (*ProfilerServer) Stop

func (p *ProfilerServer) Stop() error

Stop stops the profiler server

type SafeDevStats

type SafeDevStats struct {
	LastRestart    time.Time     `json:"last_restart"`
	Requests       int64         `json:"requests"`
	Errors         int64         `json:"errors"`
	Restarts       int64         `json:"restarts"`
	AverageLatency time.Duration `json:"average_latency"`
	Uptime         time.Duration `json:"uptime"`
	HotReloads     int64         `json:"hot_reloads"`
	BuildTime      time.Duration `json:"build_time"`
}

SafeDevStats holds development server statistics without mutex (safe for copying)

Jump to

Keyboard shortcuts

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