repository

package
v0.0.0-...-a1e0f3c Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DB_NAME = "audit"
View Source
const LOG_COLLECTION_NAME = "logs"

Variables

This section is empty.

Functions

func NewMongoDB

func NewMongoDB(ctx context.Context, cfg Config) (*mongo.Client, error)

NewMongoDB - open connect and ping trying

Types

type Config

type Config struct {
	Username, Password, Url string
}

Config - db

type Repository

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

Repository

func NewRepository

func NewRepository(db *mongo.Client) *Repository

NewRepository

func (*Repository) Insert

func (r *Repository) Insert(ctx context.Context, item models.LogItem) error

Insert - save data to DB

Jump to

Keyboard shortcuts

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