-
Notifications
You must be signed in to change notification settings - Fork 136
/
compiled_template_loader.go
42 lines (30 loc) · 1.29 KB
/
compiled_template_loader.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package template
import (
"fmt"
"go.starlark.net/starlark"
)
type CompiledTemplateLoader interface {
FindCompiledTemplate(string) (*CompiledTemplate, error)
Load(*starlark.Thread, string) (starlark.StringDict, error)
LoadData(*starlark.Thread, *starlark.Builtin, starlark.Tuple, []starlark.Tuple) (starlark.Value, error)
ListData(*starlark.Thread, *starlark.Builtin, starlark.Tuple, []starlark.Tuple) (starlark.Value, error)
}
type NoopCompiledTemplateLoader struct{}
var _ CompiledTemplateLoader = NoopCompiledTemplateLoader{}
func (l NoopCompiledTemplateLoader) FindCompiledTemplate(_ string) (*CompiledTemplate, error) {
return nil, fmt.Errorf("FindCompiledTemplate is not supported")
}
func (l NoopCompiledTemplateLoader) Load(
thread *starlark.Thread, module string) (starlark.StringDict, error) {
return nil, fmt.Errorf("Load is not supported")
}
func (l NoopCompiledTemplateLoader) LoadData(
thread *starlark.Thread, f *starlark.Builtin,
args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {
return nil, fmt.Errorf("LoadData is not supported")
}
func (l NoopCompiledTemplateLoader) ListData(
thread *starlark.Thread, f *starlark.Builtin,
args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {
return nil, fmt.Errorf("ListData is not supported")
}