Documentation ¶
Index ¶
- func Glob(dir string, g string) ([]string, error)
- 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 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 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
Click to show internal directories.
Click to hide internal directories.