fx

package module
v0.0.0-...-26300ba Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryAttempts = 4
	RetryDelay    = 2 * time.Second
)

Variables

This section is empty.

Functions

func TryWithAttempts

func TryWithAttempts(f func() error, attempts uint, delay time.Duration) (err error)

TryWithAttempts tries to get non-error result of calling function f with delay.

func TryWithAttemptsCtx

func TryWithAttemptsCtx(ctx context.Context, f func(context.Context) error, attempts uint, delay time.Duration) (err error)

TryWithAttemptsCtx is helper function that calls TryWithAttempts with function f transformed to closure that does not require ctx as necessary argument.

Types

type Client

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

func New

func New(lc fx.Lifecycle, uri string, log *zap.Logger) (*Client, error)

New opens new postgres connection, configures it and return prepared client.

Jump to

Keyboard shortcuts

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