mongo

package
v0.0.0-...-535cf67 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientFromContext

func ClientFromContext(ctx context.Context) (*mongo.Client, bool)

ClientFromContext gets the mongo client from the current context if available

func NewClientContext

func NewClientContext(ctx context.Context, client *mongo.Client) context.Context

NewClientContext creates a new context with a mongo client

func SaveProperties

func SaveProperties(ctx context.Context, properties []reps.Property) error

SaveProperties saves the properties given using the client found in the given context

func SetupClient

func SetupClient(ctx context.Context) (context.Context, error)

SetupClient sets up and connects a mongo client and stores it in a new context derived from the given context

func Shutdown

func Shutdown(ctx context.Context)

Shutdown disconnects the mongo client found in the context if available

Types

This section is empty.

Jump to

Keyboard shortcuts

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