mongodb

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mongodb contains repository implementations using MongoDB as the underlying database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(cfg Config, logger *slog.Logger) (*mongo.Database, error)

Connect creates a connection to the MongoDB instance.

func NewStateRepository

func NewStateRepository(db *mongo.Database) twins.StateRepository

NewStateRepository instantiates a MongoDB implementation of state repository.

func NewTwinRepository

func NewTwinRepository(db *mongo.Database) twins.TwinRepository

NewTwinRepository instantiates a MongoDB implementation of twin repository.

Types

type Config

type Config struct {
	Host string
	Port string
	Name string
}

Config defines the options that are used when connecting to a MongoDB instance.

Jump to

Keyboard shortcuts

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