handler

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirectoryNotFound = errors.New("directory not found")
View Source
var ErrTemplateNotFound = errors.New("template not found")

Functions

This section is empty.

Types

type Error

type Error struct {
	Type    ErrorType
	Doc     string
	Wrapped error
}

func (*Error) Error

func (e *Error) Error() string

type ErrorType

type ErrorType int
const (
	ErrorLoadingFiles ErrorType = iota
	ErrorRendering
	ErrorCompiling
	ErrorSaving
)

type FileLoader

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

func NewFileLoader

func NewFileLoader(documentsPath, partialsPath string) *FileLoader

func (*FileLoader) LoadDocument

func (l *FileLoader) LoadDocument(name string) ([]template.Template, error)

func (*FileLoader) LoadDocuments

func (l *FileLoader) LoadDocuments() ([]template.Template, error)

func (*FileLoader) LoadPartials

func (l *FileLoader) LoadPartials() ([]template.Template, error)

type Processor

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

func NewProcessor

func NewProcessor(cfg *config.Config) (*Processor, error)

func (*Processor) Process

func (p *Processor) Process() error

func (*Processor) ProcessSingle

func (p *Processor) ProcessSingle(templateName string) error

type ReloadNotifier

type ReloadNotifier interface {
	NotifyReload()
}

type Watcher

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

func NewWatcher

func NewWatcher(proc *Processor, cfg *config.Config, notifier ReloadNotifier) (*Watcher, error)

func (*Watcher) Stop

func (w *Watcher) Stop()

func (*Watcher) Watch

func (w *Watcher) Watch() error

Jump to

Keyboard shortcuts

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