Documentation
¶
Index ¶
- type ConfigService
- type FetchSiteError
- type InvalidLanguageError
- type LoadConfigError
- type PageCollectionService
- func (s *PageCollectionService) GetPageCollection() *entities.PageCollection
- func (s *PageCollectionService) Initialize(config *entities.Config) error
- func (s *PageCollectionService) Subscribe(observer entities.PageCollectionObserver)
- func (s *PageCollectionService) Unsubscribe(observer *entities.PageCollectionObserver)
- func (s *PageCollectionService) Watch() error
- type SiteService
- type ThemeService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigService ¶
type ConfigService struct {
// contains filtered or unexported fields
}
ConfigService is the service for the config. It implements the ConfigPort interface.
func NewConfigService ¶
func NewConfigService(adapter ports.ConfigPort) *ConfigService
NewConfigService returns a new ConfigService.
func (*ConfigService) LoadConfig ¶
func (s *ConfigService) LoadConfig(filename string) (*entities.Config, error)
LoadConfig loads the config from a file. It returns a LoadConfigError if an error occurs.
type FetchSiteError ¶
type FetchSiteError struct {
Err error
}
FetchSiteError is returned when the site could not be fetched.
func (FetchSiteError) Error ¶
func (e FetchSiteError) Error() string
Error returns the error message.
type InvalidLanguageError ¶
type InvalidLanguageError struct {
Language string
}
InvalidLanguageError is returned when the language is invalid.
func (InvalidLanguageError) Error ¶
func (e InvalidLanguageError) Error() string
Error returns the error message.
type LoadConfigError ¶
type LoadConfigError struct {
Err error
}
LoadConfigError is the error returned by LoadConfig.
func (*LoadConfigError) Error ¶
func (e *LoadConfigError) Error() string
Error returns the error message.
type PageCollectionService ¶
type PageCollectionService struct {
// contains filtered or unexported fields
}
PageCollectionService is the service for the page collection.
func NewPageCollectionService ¶
func NewPageCollectionService(adapter ports.PageCollectionPort, logger ports.LoggerPort) *PageCollectionService
NewPageCollectionService returns a new PageCollectionService.
func (*PageCollectionService) GetPageCollection ¶
func (s *PageCollectionService) GetPageCollection() *entities.PageCollection
GetPageCollection returns the page collection.
func (*PageCollectionService) Initialize ¶
func (s *PageCollectionService) Initialize(config *entities.Config) error
Initialize initializes the page collection.
func (*PageCollectionService) Subscribe ¶
func (s *PageCollectionService) Subscribe(observer entities.PageCollectionObserver)
Subscribe subscribes an observer to the page collection.
func (*PageCollectionService) Unsubscribe ¶
func (s *PageCollectionService) Unsubscribe(observer *entities.PageCollectionObserver)
Unsubscribe unsubscribes an observer from the page collection.
func (*PageCollectionService) Watch ¶
func (s *PageCollectionService) Watch() error
Watch watches the page collection for changes.
type SiteService ¶
type SiteService struct {
// contains filtered or unexported fields
}
SiteService is the service for the site.
func NewSiteService ¶
func NewSiteService(siteAdapter ports.SitePort, pageCollectionAdapter ports.PageCollectionPort) *SiteService
NewSiteService creates a new site service.
type ThemeService ¶
type ThemeService struct {
// contains filtered or unexported fields
}
ThemeService is the service for the theme.
func NewThemeService ¶
func NewThemeService(adapter ports.ThemePort) *ThemeService
NewThemeService returns a new ThemeService.
func (*ThemeService) RenderNotFound ¶
RenderNotFound renders the 404 page.
func (*ThemeService) RenderPage ¶
RenderPage renders a page with the site data.
func (*ThemeService) WatchTemplates ¶
func (a *ThemeService) WatchTemplates()
WatchTemplates watches the theme templates for changes.