Documentation
¶
Overview ¶
Package clientinfra provides shared Mongo client setup helpers.
Index ¶
- func EnsureIndexes(timeout time.Duration, ensure func(context.Context) error) error
- func Ping(ctx context.Context, client *mongodriver.Client, normalizeNil bool) error
- func ResolveTimeout(timeout time.Duration, defaultTimeout time.Duration) time.Duration
- func ValidateMongoOptions(client *mongodriver.Client, database string) error
- func WithTimeout(ctx context.Context, timeout time.Duration, normalizeNil bool) (context.Context, context.CancelFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureIndexes ¶
EnsureIndexes runs index initialization with a timeout-bounded background context.
func ResolveTimeout ¶
ResolveTimeout applies the package default when the configured timeout is not positive.
func ValidateMongoOptions ¶
func ValidateMongoOptions(client *mongodriver.Client, database string) error
ValidateMongoOptions checks the shared required Mongo constructor inputs.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.