Go API Documentation

github.com/go-task/task/v3/internal/fingerprint

No package summary is available.

Package

Files: 9. Third party imports: 2. Imports from organisation: 0. Tests: 0. Benchmarks: 0.

Vars

Types

ChecksumChecker

ChecksumChecker validates if a task is up to date by calculating its source files checksum

Field name Field type Comment
tempDir

string

No comment on field.
dry

bool

No comment on field.

MockSourcesCheckable

MockSourcesCheckable is an autogenerated mock type for the SourcesCheckable type

Field name Field type Comment

mock.Mock

No comment on field.

MockSourcesCheckable_Expecter

This type doesn't have documentation.

Field name Field type Comment
mock

*mock.Mock

No comment on field.

MockSourcesCheckable_IsUpToDate_Call

MockSourcesCheckable_IsUpToDate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsUpToDate'

Field name Field type Comment

*mock.Call

No comment on field.

MockSourcesCheckable_Kind_Call

MockSourcesCheckable_Kind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Kind'

Field name Field type Comment

*mock.Call

No comment on field.

MockSourcesCheckable_OnError_Call

MockSourcesCheckable_OnError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnError'

Field name Field type Comment

*mock.Call

No comment on field.

MockSourcesCheckable_Value_Call

MockSourcesCheckable_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value'

Field name Field type Comment

*mock.Call

No comment on field.

MockStatusCheckable

MockStatusCheckable is an autogenerated mock type for the StatusCheckable type

Field name Field type Comment

mock.Mock

No comment on field.

MockStatusCheckable_Expecter

This type doesn't have documentation.

Field name Field type Comment
mock

*mock.Mock

No comment on field.

MockStatusCheckable_IsUpToDate_Call

MockStatusCheckable_IsUpToDate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsUpToDate'

Field name Field type Comment

*mock.Call

No comment on field.

NoneChecker

NoneChecker is a no-op Checker. It will always report that the task is not up-to-date.

SourcesCheckable

SourcesCheckable defines any type that can check if the sources of a task are up-to-date.

Field name Field type Comment
type

any

No comment on field.

StatusCheckable

StatusCheckable defines any type that can check if the status of a task is up-to-date.

Field name Field type Comment
type

any

No comment on field.

StatusChecker

This type doesn't have documentation.

Field name Field type Comment
logger

*logger.Logger

No comment on field.

TimestampChecker

TimestampChecker checks if any source change compared with the generated files, using file modifications timestamps.

Field name Field type Comment
tempDir

string

No comment on field.
dry

bool

No comment on field.

CheckerOption, CheckerConfig

This type doesn't have documentation.

Field name Field type Comment
type

func(*CheckerConfig)

No comment on field.
method

string

No comment on field.
dry

bool

No comment on field.
tempDir

string

No comment on field.
logger

*logger.Logger

No comment on field.
statusChecker

StatusCheckable

No comment on field.
sourcesChecker

SourcesCheckable

No comment on field.

Functions

func Globs

func IsTaskUpToDate

func NewChecksumChecker

func NewMockSourcesCheckable

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 NewMockStatusCheckable

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 NewSourcesChecker

Uses: fmt.Errorf.

func NewStatusChecker

func NewTimestampChecker

func WithDry

func WithLogger

func WithMethod

func WithSourcesChecker

func WithStatusChecker

func WithTempDir

func (*ChecksumChecker) IsUpToDate

Uses: filepathext.SmartJoin, os.IsNotExist, os.MkdirAll, os.ReadFile, os.WriteFile, strings.TrimSpace.

func (*ChecksumChecker) Kind

func (*ChecksumChecker) OnError

Uses: os.Remove.

func (*ChecksumChecker) Value

func (*MockSourcesCheckable) EXPECT

func (*MockSourcesCheckable) IsUpToDate

IsUpToDate provides a mock function for the type MockSourcesCheckable

Uses: ast.Task.

func (*MockSourcesCheckable) Kind

Kind provides a mock function for the type MockSourcesCheckable

func (*MockSourcesCheckable) OnError

OnError provides a mock function for the type MockSourcesCheckable

Uses: ast.Task.

func (*MockSourcesCheckable) Value

Value provides a mock function for the type MockSourcesCheckable

Uses: ast.Task.

func (*MockSourcesCheckable_Expecter) IsUpToDate

IsUpToDate is a helper method to define mock.On call

  • t

func (*MockSourcesCheckable_Expecter) Kind

Kind is a helper method to define mock.On call

func (*MockSourcesCheckable_Expecter) OnError

OnError is a helper method to define mock.On call

  • t

func (*MockSourcesCheckable_Expecter) Value

Value is a helper method to define mock.On call

  • t

func (*MockSourcesCheckable_IsUpToDate_Call) Return

func (*MockSourcesCheckable_IsUpToDate_Call) Run

Uses: ast.Task, mock.Arguments.

func (*MockSourcesCheckable_IsUpToDate_Call) RunAndReturn

func (*MockSourcesCheckable_Kind_Call) Return

func (*MockSourcesCheckable_Kind_Call) Run

Uses: mock.Arguments.

func (*MockSourcesCheckable_Kind_Call) RunAndReturn

func (*MockSourcesCheckable_OnError_Call) Return

func (*MockSourcesCheckable_OnError_Call) Run

Uses: ast.Task, mock.Arguments.

func (*MockSourcesCheckable_OnError_Call) RunAndReturn

func (*MockSourcesCheckable_Value_Call) Return

func (*MockSourcesCheckable_Value_Call) Run

Uses: ast.Task, mock.Arguments.

func (*MockSourcesCheckable_Value_Call) RunAndReturn

func (*MockStatusCheckable) EXPECT

func (*MockStatusCheckable) IsUpToDate

IsUpToDate provides a mock function for the type MockStatusCheckable

Uses: ast.Task, context.Context.

func (*MockStatusCheckable_Expecter) IsUpToDate

IsUpToDate is a helper method to define mock.On call

  • ctx
  • t

func (*MockStatusCheckable_IsUpToDate_Call) Return

func (*MockStatusCheckable_IsUpToDate_Call) Run

Uses: ast.Task, context.Context, mock.Arguments.

func (*MockStatusCheckable_IsUpToDate_Call) RunAndReturn

func (*StatusChecker) IsUpToDate

Uses: env.Get, execext.RunCommand, execext.RunCommandOptions, logger.Yellow.

func (*TimestampChecker) IsUpToDate

IsUpToDate implements the Checker interface

Uses: filepath.Dir, os.Chtimes, os.Create, os.MkdirAll, os.Stat, time.Now.

func (*TimestampChecker) Kind

func (*TimestampChecker) OnError

OnError implements the Checker interface

func (*TimestampChecker) Value

Value implements the Checker Interface

Uses: time.Now, time.Unix.

func (NoneChecker) IsUpToDate

func (NoneChecker) Kind

func (NoneChecker) OnError

func (NoneChecker) Value

Private functions

func anyFileNewerThan

If the modification time of any of the files is newer than the the given time, returns true. This function is lazy, as it stops when it finds a file newer than the given time.

References: os.Stat.

func collectKeys

References: sort.Strings.

func getMaxTime

References: os.Stat, time.Time.

func glob

References: execext.ExpandFields, filepathext.SmartJoin, os.Stat.

func maxTime

func normalizeFilename

replaces invalid characters on filenames with "-"

func checksum

References: filepath.Base, fmt.Sprintf, io.CopyBuffer, os.Open, strings.NewReader, xxh3.New.

func checksumFilePath

References: filepath.Join.

func timestampFilePath

References: filepath.Join.


Tests

Files: 2. Third party imports: 3. Imports from organisation: 0. Tests: 2. Benchmarks: 0.

Test functions

TestIsTaskUpToDate

References: assert.Equal, ast.Glob, ast.Task, context.Background, mock.Anything, require.NoError, testing.T.

TestNormalizeFilename

References: assert.Equal.