database

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URI               string
	DBName            string `yaml:"db_name"`
	ConnectionTimeout int16  `yaml:"connection_timeout_in_ms"`
	QueryTimeout      int16  `yaml:"query_timeout_in_ms"`
}

type Database

type Database struct {
	DBName       string
	QueryTimeout time.Duration
	Client       *mongo.Client
}

func Connect

func Connect(cfg Config) (*Database, error)

func (*Database) Stop

func (db *Database) Stop() error

Jump to

Keyboard shortcuts

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