mongoex

package
v1.0.2050-b46fae6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(ctx context.Context, appName string, cfg Config, sys *system.System) (*mongo.Client, error)

Load connects to mongo. The context passed in is expected to carry an o11y provider and is only used for reporting (not for cancellation),

func New

func New(ctx context.Context, appName string, cfg Config) (client *mongo.Client, err error)

New connects to mongo. The context passed in is expected to carry an o11y provider and is only used for reporting (not for cancellation),

func Span

func Span(ctx context.Context, entity, queryName string) (context.Context, o11y.Span)

Span provides a o11y span to ensure our database queries are reported consistently.

Types

type Config

type Config struct {
	URI    string
	UseTLS bool

	Options *options.ClientOptions
}

Jump to

Keyboard shortcuts

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