Documentation
¶
Index ¶
- func Globs(dir string, globs []*ast.Glob) ([]string, error)
- func IsTaskUpToDate(ctx context.Context, t *ast.Task, opts ...CheckerOption) (bool, error)
- type CheckerConfig
- type CheckerOption
- func WithDry(dry bool) CheckerOption
- func WithLogger(logger *logger.Logger) CheckerOption
- func WithMethod(method string) CheckerOption
- func WithSourcesChecker(checker SourcesCheckable) CheckerOption
- func WithStatusChecker(checker StatusCheckable) CheckerOption
- func WithTempDir(tempDir string) CheckerOption
- type ChecksumChecker
- type MockSourcesCheckable
- func (_m *MockSourcesCheckable) EXPECT() *MockSourcesCheckable_Expecter
- func (_mock *MockSourcesCheckable) IsUpToDate(t *ast.Task) (bool, error)
- func (_mock *MockSourcesCheckable) Kind() string
- func (_mock *MockSourcesCheckable) OnError(t *ast.Task) error
- func (_mock *MockSourcesCheckable) Value(t *ast.Task) (any, error)
- type MockSourcesCheckable_Expecter
- func (_e *MockSourcesCheckable_Expecter) IsUpToDate(t interface{}) *MockSourcesCheckable_IsUpToDate_Call
- func (_e *MockSourcesCheckable_Expecter) Kind() *MockSourcesCheckable_Kind_Call
- func (_e *MockSourcesCheckable_Expecter) OnError(t interface{}) *MockSourcesCheckable_OnError_Call
- func (_e *MockSourcesCheckable_Expecter) Value(t interface{}) *MockSourcesCheckable_Value_Call
- type MockSourcesCheckable_IsUpToDate_Call
- func (_c *MockSourcesCheckable_IsUpToDate_Call) Return(b bool, err error) *MockSourcesCheckable_IsUpToDate_Call
- func (_c *MockSourcesCheckable_IsUpToDate_Call) Run(run func(t *ast.Task)) *MockSourcesCheckable_IsUpToDate_Call
- func (_c *MockSourcesCheckable_IsUpToDate_Call) RunAndReturn(run func(t *ast.Task) (bool, error)) *MockSourcesCheckable_IsUpToDate_Call
- type MockSourcesCheckable_Kind_Call
- type MockSourcesCheckable_OnError_Call
- func (_c *MockSourcesCheckable_OnError_Call) Return(err error) *MockSourcesCheckable_OnError_Call
- func (_c *MockSourcesCheckable_OnError_Call) Run(run func(t *ast.Task)) *MockSourcesCheckable_OnError_Call
- func (_c *MockSourcesCheckable_OnError_Call) RunAndReturn(run func(t *ast.Task) error) *MockSourcesCheckable_OnError_Call
- type MockSourcesCheckable_Value_Call
- func (_c *MockSourcesCheckable_Value_Call) Return(v any, err error) *MockSourcesCheckable_Value_Call
- func (_c *MockSourcesCheckable_Value_Call) Run(run func(t *ast.Task)) *MockSourcesCheckable_Value_Call
- func (_c *MockSourcesCheckable_Value_Call) RunAndReturn(run func(t *ast.Task) (any, error)) *MockSourcesCheckable_Value_Call
- type MockStatusCheckable
- type MockStatusCheckable_Expecter
- type MockStatusCheckable_IsUpToDate_Call
- func (_c *MockStatusCheckable_IsUpToDate_Call) Return(b bool, err error) *MockStatusCheckable_IsUpToDate_Call
- func (_c *MockStatusCheckable_IsUpToDate_Call) Run(run func(ctx context.Context, t *ast.Task)) *MockStatusCheckable_IsUpToDate_Call
- func (_c *MockStatusCheckable_IsUpToDate_Call) RunAndReturn(run func(ctx context.Context, t *ast.Task) (bool, error)) *MockStatusCheckable_IsUpToDate_Call
- type NoneChecker
- type SourcesCheckable
- type StatusCheckable
- type StatusChecker
- type TimestampChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTaskUpToDate ¶
Types ¶
type CheckerConfig ¶
type CheckerConfig struct {
// contains filtered or unexported fields
}
type CheckerOption ¶
type CheckerOption func(*CheckerConfig)
func WithDry ¶
func WithDry(dry bool) CheckerOption
func WithLogger ¶
func WithLogger(logger *logger.Logger) CheckerOption
func WithMethod ¶
func WithMethod(method string) CheckerOption
func WithSourcesChecker ¶
func WithSourcesChecker(checker SourcesCheckable) CheckerOption
func WithStatusChecker ¶
func WithStatusChecker(checker StatusCheckable) CheckerOption
func WithTempDir ¶
func WithTempDir(tempDir string) CheckerOption
type ChecksumChecker ¶
type ChecksumChecker struct {
// contains filtered or unexported fields
}
ChecksumChecker validates if a task is up to date by calculating its source files checksum
func NewChecksumChecker ¶
func NewChecksumChecker(tempDir string, dry bool) *ChecksumChecker
func (*ChecksumChecker) IsUpToDate ¶
func (checker *ChecksumChecker) IsUpToDate(t *ast.Task) (bool, error)
func (*ChecksumChecker) Kind ¶
func (*ChecksumChecker) Kind() string
type MockSourcesCheckable ¶
MockSourcesCheckable is an autogenerated mock type for the SourcesCheckable type
func NewMockSourcesCheckable ¶
func NewMockSourcesCheckable(t interface {
mock.TestingT
Cleanup(func())
}) *MockSourcesCheckable
NewMockSourcesCheckable creates a new instance of MockSourcesCheckable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockSourcesCheckable) EXPECT ¶
func (_m *MockSourcesCheckable) EXPECT() *MockSourcesCheckable_Expecter
func (*MockSourcesCheckable) IsUpToDate ¶
func (_mock *MockSourcesCheckable) IsUpToDate(t *ast.Task) (bool, error)
IsUpToDate provides a mock function for the type MockSourcesCheckable
func (*MockSourcesCheckable) Kind ¶
func (_mock *MockSourcesCheckable) Kind() string
Kind provides a mock function for the type MockSourcesCheckable
type MockSourcesCheckable_Expecter ¶ added in v3.43.0
type MockSourcesCheckable_Expecter struct {
// contains filtered or unexported fields
}
func (*MockSourcesCheckable_Expecter) IsUpToDate ¶ added in v3.43.0
func (_e *MockSourcesCheckable_Expecter) IsUpToDate(t interface{}) *MockSourcesCheckable_IsUpToDate_Call
IsUpToDate is a helper method to define mock.On call
- t
func (*MockSourcesCheckable_Expecter) Kind ¶ added in v3.43.0
func (_e *MockSourcesCheckable_Expecter) Kind() *MockSourcesCheckable_Kind_Call
Kind is a helper method to define mock.On call
func (*MockSourcesCheckable_Expecter) OnError ¶ added in v3.43.0
func (_e *MockSourcesCheckable_Expecter) OnError(t interface{}) *MockSourcesCheckable_OnError_Call
OnError is a helper method to define mock.On call
- t
func (*MockSourcesCheckable_Expecter) Value ¶ added in v3.43.0
func (_e *MockSourcesCheckable_Expecter) Value(t interface{}) *MockSourcesCheckable_Value_Call
Value is a helper method to define mock.On call
- t
type MockSourcesCheckable_IsUpToDate_Call ¶ added in v3.43.0
MockSourcesCheckable_IsUpToDate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsUpToDate'
func (*MockSourcesCheckable_IsUpToDate_Call) Return ¶ added in v3.43.0
func (_c *MockSourcesCheckable_IsUpToDate_Call) Return(b bool, err error) *MockSourcesCheckable_IsUpToDate_Call
func (*MockSourcesCheckable_IsUpToDate_Call) Run ¶ added in v3.43.0
func (_c *MockSourcesCheckable_IsUpToDate_Call) Run(run func(t *ast.Task)) *MockSourcesCheckable_IsUpToDate_Call
func (*MockSourcesCheckable_IsUpToDate_Call) RunAndReturn ¶ added in v3.43.0
func (_c *MockSourcesCheckable_IsUpToDate_Call) RunAndReturn(run func(t *ast.Task) (bool, error)) *MockSourcesCheckable_IsUpToDate_Call
type MockSourcesCheckable_Kind_Call ¶ added in v3.43.0
MockSourcesCheckable_Kind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Kind'
func (*MockSourcesCheckable_Kind_Call) Return ¶ added in v3.43.0
func (_c *MockSourcesCheckable_Kind_Call) Return(s string) *MockSourcesCheckable_Kind_Call
func (*MockSourcesCheckable_Kind_Call) Run ¶ added in v3.43.0
func (_c *MockSourcesCheckable_Kind_Call) Run(run func()) *MockSourcesCheckable_Kind_Call
func (*MockSourcesCheckable_Kind_Call) RunAndReturn ¶ added in v3.43.0
func (_c *MockSourcesCheckable_Kind_Call) RunAndReturn(run func() string) *MockSourcesCheckable_Kind_Call
type MockSourcesCheckable_OnError_Call ¶ added in v3.43.0
MockSourcesCheckable_OnError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnError'
func (*MockSourcesCheckable_OnError_Call) Return ¶ added in v3.43.0
func (_c *MockSourcesCheckable_OnError_Call) Return(err error) *MockSourcesCheckable_OnError_Call
func (*MockSourcesCheckable_OnError_Call) Run ¶ added in v3.43.0
func (_c *MockSourcesCheckable_OnError_Call) Run(run func(t *ast.Task)) *MockSourcesCheckable_OnError_Call
func (*MockSourcesCheckable_OnError_Call) RunAndReturn ¶ added in v3.43.0
func (_c *MockSourcesCheckable_OnError_Call) RunAndReturn(run func(t *ast.Task) error) *MockSourcesCheckable_OnError_Call
type MockSourcesCheckable_Value_Call ¶ added in v3.43.0
MockSourcesCheckable_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value'
func (*MockSourcesCheckable_Value_Call) Return ¶ added in v3.43.0
func (_c *MockSourcesCheckable_Value_Call) Return(v any, err error) *MockSourcesCheckable_Value_Call
func (*MockSourcesCheckable_Value_Call) Run ¶ added in v3.43.0
func (_c *MockSourcesCheckable_Value_Call) Run(run func(t *ast.Task)) *MockSourcesCheckable_Value_Call
func (*MockSourcesCheckable_Value_Call) RunAndReturn ¶ added in v3.43.0
func (_c *MockSourcesCheckable_Value_Call) RunAndReturn(run func(t *ast.Task) (any, error)) *MockSourcesCheckable_Value_Call
type MockStatusCheckable ¶
MockStatusCheckable is an autogenerated mock type for the StatusCheckable type
func NewMockStatusCheckable ¶
func NewMockStatusCheckable(t interface {
mock.TestingT
Cleanup(func())
}) *MockStatusCheckable
NewMockStatusCheckable creates a new instance of MockStatusCheckable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockStatusCheckable) EXPECT ¶
func (_m *MockStatusCheckable) EXPECT() *MockStatusCheckable_Expecter
func (*MockStatusCheckable) IsUpToDate ¶
IsUpToDate provides a mock function for the type MockStatusCheckable
type MockStatusCheckable_Expecter ¶ added in v3.43.0
type MockStatusCheckable_Expecter struct {
// contains filtered or unexported fields
}
func (*MockStatusCheckable_Expecter) IsUpToDate ¶ added in v3.43.0
func (_e *MockStatusCheckable_Expecter) IsUpToDate(ctx interface{}, t interface{}) *MockStatusCheckable_IsUpToDate_Call
IsUpToDate is a helper method to define mock.On call
- ctx
- t
type MockStatusCheckable_IsUpToDate_Call ¶ added in v3.43.0
MockStatusCheckable_IsUpToDate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsUpToDate'
func (*MockStatusCheckable_IsUpToDate_Call) Return ¶ added in v3.43.0
func (_c *MockStatusCheckable_IsUpToDate_Call) Return(b bool, err error) *MockStatusCheckable_IsUpToDate_Call
func (*MockStatusCheckable_IsUpToDate_Call) Run ¶ added in v3.43.0
func (_c *MockStatusCheckable_IsUpToDate_Call) Run(run func(ctx context.Context, t *ast.Task)) *MockStatusCheckable_IsUpToDate_Call
func (*MockStatusCheckable_IsUpToDate_Call) RunAndReturn ¶ added in v3.43.0
func (_c *MockStatusCheckable_IsUpToDate_Call) RunAndReturn(run func(ctx context.Context, t *ast.Task) (bool, error)) *MockStatusCheckable_IsUpToDate_Call
type NoneChecker ¶
type NoneChecker struct{}
NoneChecker is a no-op Checker. It will always report that the task is not up-to-date.
func (NoneChecker) IsUpToDate ¶
func (NoneChecker) IsUpToDate(t *ast.Task) (bool, error)
func (NoneChecker) Kind ¶
func (NoneChecker) Kind() string
type SourcesCheckable ¶
type SourcesCheckable interface {
IsUpToDate(t *ast.Task) (bool, error)
Value(t *ast.Task) (any, error)
OnError(t *ast.Task) error
Kind() string
}
SourcesCheckable defines any type that can check if the sources of a task are up-to-date.
func NewSourcesChecker ¶
func NewSourcesChecker(method, tempDir string, dry bool) (SourcesCheckable, error)
type StatusCheckable ¶
StatusCheckable defines any type that can check if the status of a task is up-to-date.
func NewStatusChecker ¶
func NewStatusChecker(logger *logger.Logger) StatusCheckable
type StatusChecker ¶
type StatusChecker struct {
// contains filtered or unexported fields
}
func (*StatusChecker) IsUpToDate ¶
type TimestampChecker ¶
type TimestampChecker struct {
// contains filtered or unexported fields
}
TimestampChecker checks if any source change compared with the generated files, using file modifications timestamps.
func NewTimestampChecker ¶
func NewTimestampChecker(tempDir string, dry bool) *TimestampChecker
func (*TimestampChecker) IsUpToDate ¶
func (checker *TimestampChecker) IsUpToDate(t *ast.Task) (bool, error)
IsUpToDate implements the Checker interface
func (*TimestampChecker) Kind ¶
func (checker *TimestampChecker) Kind() string