fingerprint

package
v3.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Glob

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

func IsTaskUpToDate

func IsTaskUpToDate(
	ctx context.Context,
	t *taskfile.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 *taskfile.Task) (bool, error)

func (*ChecksumChecker) Kind

func (*ChecksumChecker) Kind() string

func (*ChecksumChecker) OnError

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

func (*ChecksumChecker) Value

func (checker *ChecksumChecker) Value(t *taskfile.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 *taskfile.Task) (bool, error)

func (NoneChecker) Kind

func (NoneChecker) Kind() string

func (NoneChecker) OnError

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

func (NoneChecker) Value

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

type SourcesCheckable

type SourcesCheckable interface {
	IsUpToDate(t *taskfile.Task) (bool, error)
	Value(t *taskfile.Task) (any, error)
	OnError(t *taskfile.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 *taskfile.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 *taskfile.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 *taskfile.Task) (bool, error)

IsUpToDate implements the Checker interface

func (*TimestampChecker) Kind

func (checker *TimestampChecker) Kind() string

func (*TimestampChecker) OnError

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

OnError implements the Checker interface

func (*TimestampChecker) Value

func (checker *TimestampChecker) Value(t *taskfile.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