exampleflaky

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "example-flaky"

Variables

This section is empty.

Functions

This section is empty.

Types

type ExampleFlaky

type ExampleFlaky struct{}

ExampleFlaky demonstrates retry behavior with state. It tracks how many times it has been called in a temp file. It fails on the first attempts and succeeds on the last retry. On success it cleans up the temp file so the next run starts fresh.

func New

func New() (*ExampleFlaky, error)

func (*ExampleFlaky) MaxRetries

func (f *ExampleFlaky) MaxRetries() int

MaxRetries makes ExampleFlaky implement the Retryable interface.

func (*ExampleFlaky) Name

func (f *ExampleFlaky) Name() string

func (*ExampleFlaky) RetryDelay

func (f *ExampleFlaky) RetryDelay() time.Duration

func (*ExampleFlaky) Run

func (f *ExampleFlaky) Run(
	ctx context.Context,
) error

func (*ExampleFlaky) Stop

func (f *ExampleFlaky) Stop(
	_ context.Context,
) error

Jump to

Keyboard shortcuts

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