Documentation ¶
Index ¶
- func New(opts ...Config) http.Handler
- type Config
- func WithConfig(c *config.Config) Config
- func WithDatabase(db persistence.Service) Config
- func WithEmails(t *template.Template) Config
- func WithFS(fs http.FileSystem) Config
- func WithLogger(l *logrus.Logger) Config
- func WithMailer(m mailer.Mailer) Config
- func WithTemplate(t *template.Template) Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config func(*router)
Config adds a configuration value to the router
func WithConfig ¶
WithConfig attaches the given runtime config to the router.
func WithDatabase ¶
func WithDatabase(db persistence.Service) Config
WithDatabase sets the database the router will use
func WithEmails ¶
WithEmails ensures the router is using the given template object for rendering email output.
func WithFS ¶
func WithFS(fs http.FileSystem) Config
WithFS attaches a filesystem for serving static assets
func WithLogger ¶
WithLogger sets the logger the router will use
func WithMailer ¶
WithMailer attaches a mailer for sending transactional email
func WithTemplate ¶
WithTemplate ensures the router is using the given template object for rendering dynamic HTML output.
Click to show internal directories.
Click to hide internal directories.