connections

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectWithFields

func ConnectWithFields(
	host string, port uint16, username string, password string, options *ConnectionOptions,
) (*mongo.Client, error)

ConnectWithFields makes a client out of the given input arguments.

func ConnectWithURL

func ConnectWithURL(url string, options *ConnectionOptions) (*mongo.Client, error)

ConnectWithURL makes a client out of the given input URL.

func Disconnect

func Disconnect(client *mongo.Client, options *ConnectionOptions) error

Disconnect disconnect.

Types

type ConnectionOptions

type ConnectionOptions struct {
	// contains filtered or unexported fields
}

ConnectionOptions stands for the options related to the connection (either to connect, disconnect or interact).

func WithClientOptions

func WithClientOptions() *ConnectionOptions

WithClientOptions creates a connection options.

func (*ConnectionOptions) SetTimeout

func (options *ConnectionOptions) SetTimeout(timeout int64) *ConnectionOptions

SetTimeout sets the timeout for the connection options.

Jump to

Keyboard shortcuts

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