package
Version:
v1.0.7257-282c6db
Opens a new window with list of versions in this module.
Published: Jul 14, 2023
License: MIT
Opens a new window with license information.
Imports: 14
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package mongoex contains a variety of tools for working safely with MongoDB.
There are tools for:
- observability (both for queries and connection info)
- health checks
-
func Load(ctx context.Context, appName string, cfg Config, sys *system.System) (*mongo.Client, error)
-
func New(ctx context.Context, appName string, cfg Config) (client *mongo.Client, err error)
-
func Span(ctx context.Context, entity, queryName string) (context.Context, o11y.Span)
-
type Config
Load connects to mongo. The context passed in is expected to carry an o11y provider
and is only used for reporting (not for cancellation),
New connects to mongo. The context passed in is expected to carry an o11y provider
and is only used for reporting (not for cancellation),
Span provides a o11y span to ensure our database queries are reported consistently.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.