exampledatabase

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "example-database"

Variables

This section is empty.

Functions

This section is empty.

Types

type ExampleDatabase

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

ExampleDatabase demonstrates retry and readiness behavior. It simulates a database connection pool that retries on failure and signals ready after a short startup delay. Dependent services (like example-api) won't start until this signals ready.

func New

func New() (*ExampleDatabase, error)

func (*ExampleDatabase) MaxRetries

func (d *ExampleDatabase) MaxRetries() int

MaxRetries makes ExampleDatabase implement the Retryable interface.

func (*ExampleDatabase) Name

func (d *ExampleDatabase) Name() string

func (*ExampleDatabase) Ready added in v1.0.2

func (d *ExampleDatabase) Ready() <-chan struct{}

Ready makes ExampleDatabase implement the ReadyNotifier interface. The service manager waits for this before starting dependent services.

func (*ExampleDatabase) RetryDelay

func (d *ExampleDatabase) RetryDelay() time.Duration

func (*ExampleDatabase) Run

func (d *ExampleDatabase) Run(
	ctx context.Context,
) error

func (*ExampleDatabase) Stop

func (d *ExampleDatabase) Stop(
	ctx context.Context,
) error

Jump to

Keyboard shortcuts

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