ports

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigPort

type ConfigPort interface {
	LoadConfig(filename string) (*entities.Config, error)
}

ConfigPort is the port for the config.

type LoggerPort

type LoggerPort interface {
	// Debugf logs a debug message with optional fields.
	Debug(msg string, keysAndValues ...any)
	// Infof logs an info message with optional fields.
	Info(msg string, keysAndValues ...any)
	// Warnf logs a warning message with optional fields.
	Warn(msg string, keysAndValues ...any)
	// Errorf logs an error message with optional fields.
	Error(msg string, keysAndValues ...any)
	// Fatalf logs a fatal message with optional fields.
	Fatal(msg string, keysAndValues ...any)
	// Panicf logs a panic message with optional fields.
	Panic(msg string, keysAndValues ...any)
}

type PageCollectionPort

type PageCollectionPort interface {
	InitializePageCollection(config *entities.Config) error
	WatchPageCollection() error
	GetPageCollection() *entities.PageCollection
	RegisterPageCollectionObserver(observer entities.PageCollectionObserver)
	UnregisterPageCollectionObserver(observer *entities.PageCollectionObserver)
}

PageCollectionPort is the port for the page collection.

type SitePort

type SitePort interface {
	FetchSite(collection *entities.PageCollection, path *url.URL, userLanguage fields.RequiredString) (*entities.Site, error)
}

SitePort is the port for the site.

type ThemePort

type ThemePort interface {
	TemplateRenderer() ThemeRenderer
	NotFoundRenderer() ThemeRenderer
	WatchTemplates()
	AddTemplateVariable(name string, value any)
}

ThemePort is the port for the theme.

type ThemeRenderer

type ThemeRenderer func(site *entities.Site, w io.Writer) error

ThemeRenderer is a function that renders a theme template.

Jump to

Keyboard shortcuts

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