fingerprint

package
v3.38.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Glob

func Glob(dir string, g string) ([]string, error)

func Globs

func Globs(dir string, globs []*ast.Glob) ([]string, error)

func IsTaskUpToDate

func IsTaskUpToDate(
	ctx context.Context,
	t *ast.Task,
	opts ...CheckerOption,
) (bool, error)

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

func (*ChecksumChecker) OnError

func (checker *ChecksumChecker) OnError(t *ast.Task) error

func (*ChecksumChecker) Value

func (checker *ChecksumChecker) Value(t *ast.Task) (any, error)

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

func (NoneChecker) OnError

func (NoneChecker) OnError(t *ast.Task) error

func (NoneChecker) Value

func (NoneChecker) Value(t *ast.Task) (any, error)

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

type StatusCheckable interface {
	IsUpToDate(ctx context.Context, t *ast.Task) (bool, error)
}

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

func (checker *StatusChecker) IsUpToDate(ctx context.Context, t *ast.Task) (bool, error)

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

func (*TimestampChecker) OnError

func (*TimestampChecker) OnError(t *ast.Task) error

OnError implements the Checker interface

func (*TimestampChecker) Value

func (checker *TimestampChecker) Value(t *ast.Task) (any, error)

Value implements the Checker Interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL