Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data is the container type for renderer data
type Feed ¶
type Feed struct {
// contains filtered or unexported fields
}
Feed implements Renderer for XML content
func NewFeed ¶
func NewFeed(cfgUI UIConfig, cfgRootURL RootURLConfig) *Feed
NewFeed creates new Feed instance
type HTML ¶
type HTML struct {
// contains filtered or unexported fields
}
HTML implements Renderer for HTML content
func NewHTML ¶
func NewHTML(config HTMLConfig, logger *slog.Logger) (*HTML, error)
NewHTML creates new HTML instance
type HTMLConfig ¶
type HTMLConfig struct {
Debug bool
TemplatesPath string
UICfg UIConfig
RootURLCfg RootURLConfig
PluginsCfg plugin.Config
}
HTMLConfig is configuration for HTML renderer
type Renderer ¶
type Renderer interface {
// Render renders the data with response code to a response writer
Render(w http.ResponseWriter, code int, data *Data)
// Error renders error to a response writer
Error(rq *http.Request, w http.ResponseWriter, code int, err error)
}
Renderer is the interface for rendering data to a client in required format
type RootURLConfig ¶
type RootURLConfig struct {
Scheme string `env:"ROOT_URL_SCHEME,default=http"`
Host string `env:"ROOT_URL_HOST"`
Path string `env:"ROOT_URL_PATH,default=/"`
}
RootURLConfig is the configuration for app root url
type UIConfig ¶
type UIConfig struct {
Theme string `env:"UI_THEME,default=foundation6"`
Author string `env:"UI_AUTHOR,default=Vladimir Garvardt"`
Email string `env:"UI_EMAIL,default=vgarvardt@gmail.com"`
Description string `env:"UI_DESCRIPTION,default=rKlotz - simple golang-driven blog engine"`
Language string `env:"UI_LANGUAGE,default=en"`
Title string `env:"UI_TITLE,default=rKlotz"`
Heading string `env:"UI_HEADING,default=rKlotz"`
Intro string `env:"UI_INTRO,default=simple golang-driven blog engine"`
// DateFormat is format for posts, see http://golang.org/pkg/time/#Time.Format
DateFormat string `env:"UI_DATEFORMAT,default=2 Jan 2006"`
AboutPath string `env:"UI_ABOUT_PATH,default=/etc/rklotz/about.tpl"`
}
UIConfig is the configuration for user interface
Click to show internal directories.
Click to hide internal directories.