server

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

This file implements the file change detection and classification system.

Package server provides HTTP handlers for file serving and live reload.

Package server provides a development server with live reload functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeDetector added in v0.0.33

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

ChangeDetector detects and classifies file changes

func NewChangeDetector added in v0.0.33

func NewChangeDetector(contentDir, outputDir, configPath string) *ChangeDetector

NewChangeDetector creates a new change detector

func (*ChangeDetector) ClassifyChange added in v0.0.33

func (cd *ChangeDetector) ClassifyChange(path string) ChangeType

ClassifyChange determines what type of change this file represents

func (*ChangeDetector) DetectChange added in v0.0.33

func (cd *ChangeDetector) DetectChange(path string) (*FileChange, error)

func (*ChangeDetector) HasChanged added in v0.0.33

func (cd *ChangeDetector) HasChanged(path string) (bool, error)

func (*ChangeDetector) InitializeHashes added in v0.0.33

func (cd *ChangeDetector) InitializeHashes() error

type ChangeType added in v0.0.33

type ChangeType int

ChangeType represents the category of file change

const (
	ChangeTypeIgnored ChangeType = iota
	ChangeTypeConfig
	ChangeTypeContent
	ChangeTypeTemplate
	ChangeTypeStatic
	ChangeTypeData
)

func (ChangeType) String added in v0.0.33

func (ct ChangeType) String() string

type DevServer

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

DevServer provides a development server with file watching and live reload.

func NewDevServer

func NewDevServer(
	configPath, contentDir string,
	site *config.Site,
	gen *builder.Builder,
	parser *parser.ContentParser,
) (*DevServer, error)

NewDevServer creates a new development server with file watching enabled.

func (*DevServer) Start

func (s *DevServer) Start(port int)

Start starts the development server on the specified port.

type FileChange added in v0.0.33

type FileChange struct {
	Path       string
	Type       ChangeType
	RelPath    string // Relative path from the appropriate base directory
	IsNew      bool
	ContentMD5 string
}

FileChange represents a detected file change with its classification

Jump to

Keyboard shortcuts

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