2017-02-20 14:28:38 -08:00
|
|
|
package authboss
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
// RenderLoader is an object that understands how to load display templates.
|
|
|
|
// It's possible that Init() is a no-op if the responses are JSON or anything
|
|
|
|
// else.
|
|
|
|
type RenderLoader interface {
|
2017-02-23 16:13:25 -08:00
|
|
|
Init(names []string) (Renderer, error)
|
2017-02-20 14:28:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Renderer is a type that can render a given template with some data.
|
|
|
|
type Renderer interface {
|
2017-02-23 16:13:25 -08:00
|
|
|
Render(ctx context.Context, name string, data HTMLData) (output []byte, contentType string, err error)
|
2017-02-20 14:28:38 -08:00
|
|
|
}
|