2018-12-07 09:57:07 +01:00
|
|
|
package html
|
|
|
|
|
2019-07-28 13:11:23 +02:00
|
|
|
import "gitlab.com/wpetit/goweb/service"
|
2018-12-07 09:57:07 +01:00
|
|
|
|
|
|
|
// ServiceProvider returns a service.Provider for the
|
|
|
|
// the HTML template service implementation
|
2020-07-07 09:01:04 +02:00
|
|
|
func ServiceProvider(loader Loader, funcs ...OptionFunc) service.Provider {
|
|
|
|
templateService := NewTemplateService(loader, funcs...)
|
|
|
|
err := templateService.Load()
|
2018-12-07 09:57:07 +01:00
|
|
|
return func(container *service.Container) (interface{}, error) {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return templateService, nil
|
|
|
|
}
|
|
|
|
}
|