17 lines
480 B
Go
17 lines
480 B
Go
package html
|
|
|
|
import "gitlab.com/wpetit/goweb/service"
|
|
|
|
// ServiceProvider returns a service.Provider for the
|
|
// the HTML template service implementation
|
|
func ServiceProvider(templateDir string, funcs ...OptionFunc) service.Provider {
|
|
templateService := NewTemplateService(funcs...)
|
|
err := templateService.LoadTemplatesDir(templateDir)
|
|
return func(container *service.Container) (interface{}, error) {
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return templateService, nil
|
|
}
|
|
}
|