Documentation
¶
Index ¶
- Constants
- type ExampleDatabase
- func (d *ExampleDatabase) MaxRetries() int
- func (d *ExampleDatabase) Name() string
- func (d *ExampleDatabase) Ready() <-chan struct{}
- func (d *ExampleDatabase) RetryDelay() time.Duration
- func (d *ExampleDatabase) Run(ctx context.Context) error
- func (d *ExampleDatabase) Stop(ctx context.Context) error
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
Click to show internal directories.
Click to hide internal directories.