data

package
v0.0.0-...-864ad74 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package data provides an interface for logs

Package data provides an interface for logs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectMongo

func ConnectMongo() (*mongo.Client, error)

ConnectMongo connects to a mongodb instance

Types

type LogItem

type LogItem struct {
	ID        string    `bson:"_id,omitempty" json:"id,omitempty"`
	Name      string    `bson:"name" json:"name"`
	Data      string    `bson:"data" json:"data"`
	CreatedAt time.Time `bson:"created_at" json:"created_at"`
	UpdatedAt time.Time `bson:"updated_at" json:"updated_at"`
}

LogItem describes a log object

func (*LogItem) Insert

func (l *LogItem) Insert(entry LogItem) error

Insert puts a document in a mongodb collection

type Models

type Models struct {
	LogItem LogItem
}

Models describes all data models available to the application

func New

func New(mongo *mongo.Client) Models

New is the function used to create an instance of the data package

Jump to

Keyboard shortcuts

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