package
0.0.0-20231027131641-93b1e7503408
Repository: https://github.com/lightstar/golib.git
Documentation: pkg.go.dev

# Functions

MustNewClient function creates new mongo client with provided options and panics on any error.
NewClient function creates new mongo client with provided options.
WithAddress option applies provided mongo server address.
WithConfig option retrieves configuration from provided configuration service.
WithConnectTimeout option applies provided mongo client connect timeout in seconds.
WithSocketTimeout option applies provided mongo client socket timeout in seconds.

# Constants

DefAddress is the default mongo server address.
DefConnectTimeout is the default mongo client connect timeout in seconds.
DefSocketTimeout is the default mongo client socket timeout in seconds.

# Structs

Client structure provides mongo client functionality.
Config structure with client's configuration.
Session structure provides access to operations with mongodb database and collection.

# Interfaces

ConfigService interface used to obtain configuration from somewhere into some specific structure.

# Type aliases

Data type is used to provide filters in various mongodb commands.
Option function that is fed to NewClient and MustNewClient.