faketime

package
v0.0.0-...-bae1bac Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileRead = fmt.Errorf("failed to read faketime file")
)
View Source
var (
	ErrInvalidFaketimeFileContent = errors.New("invalid faketime file content")
)

Functions

This section is empty.

Types

type FakeTime

type FakeTime struct {
	Time  time.Time
	Ratio float64
}

func Parse

func Parse(s string, layout string) (*FakeTime, error)

func (*FakeTime) Run

func (ft *FakeTime) Run(ctx context.Context, fn func(context.Context) error) error

type File

type File struct {
	FilePath string
	// contains filtered or unexported fields
}

func NewFile

func NewFile(filePath string, layout string) *File

func (*File) Delete

func (f *File) Delete() error

func (*File) Save

func (f *File) Save(t time.Time) (rerr error)

type FileProvider

type FileProvider struct {
	// contains filtered or unexported fields
}

func NewFileProvider

func NewFileProvider(filePath string) *FileProvider

func (*FileProvider) Get

func (p *FileProvider) Get(ctx context.Context) (string, error)

type Provider

type Provider interface {
	Get(ctx context.Context) (string, error)
}

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(provider Provider, layout string) *Runner

func (*Runner) Start

func (r *Runner) Start(ctx context.Context, fn func(context.Context) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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