Documentation
¶
Overview ¶
Package eval provides a common evaluator for templated expressions, that may make requests to remote services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddonMock ¶ added in v0.9.0
type AddonMock struct {
// FuncsFunc mocks the Funcs method.
FuncsFunc func(ctx context.Context) (template.FuncMap, error)
// StringFunc mocks the String method.
StringFunc func() string
// contains filtered or unexported fields
}
AddonMock is a mock implementation of Addon.
func TestSomethingThatUsesAddon(t *testing.T) {
// make and configure a mocked Addon
mockedAddon := &AddonMock{
FuncsFunc: func(ctx context.Context) (template.FuncMap, error) {
panic("mock out the Funcs method")
},
StringFunc: func() string {
panic("mock out the String method")
},
}
// use mockedAddon in code that requires Addon
// and then make assertions.
}
func (*AddonMock) FuncsCalls ¶ added in v0.9.0
FuncsCalls gets all the calls that were made to Funcs. Check the length with:
len(mockedAddon.FuncsCalls())
func (*AddonMock) StringCalls ¶ added in v0.9.0
func (mock *AddonMock) StringCalls() []struct { }
StringCalls gets all the calls that were made to String. Check the length with:
len(mockedAddon.StringCalls())
type Evaluator ¶
type Evaluator struct {
Addon Addon
}
Evaluator is a service that provides common functions for most of the consumers for evaluating go template expressions.
type Git ¶ added in v0.9.0
Git is an addon for evaluating git-related functions in templates.
type MultiAddon ¶ added in v0.9.0
type MultiAddon []Addon
MultiAddon is a list of addons.
func (MultiAddon) String ¶ added in v0.9.0
func (m MultiAddon) String() string
String returns names of all underlying addons.
Click to show internal directories.
Click to hide internal directories.