mongodb

package
v0.0.0-...-f17446d Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 8 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 logger.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