db

package
v0.0.0-...-9214b66 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToMongoDB

func ConnectToMongoDB(ctx context.Context) (*mongo.Client, error)

func InsertToDB

func InsertToDB(ctx context.Context, client *mongo.Client, logData types.LogData) error
func Search(c echo.Context, client *mongo.Client, searchData types.SearchData) ([]types.LogData, error)

Types

type MongoDBLogPersister

type MongoDBLogPersister struct {
	MongoClient *mongo.Client
}

func NewMongoDBLogPersister

func NewMongoDBLogPersister(mongoClient *mongo.Client) *MongoDBLogPersister

func (*MongoDBLogPersister) PersistLog

func (mg *MongoDBLogPersister) PersistLog(ctx context.Context, logData types.LogData) error

type PostgreSQL

type PostgreSQL struct {
	Conn string
}

func NewPostgresql

func NewPostgresql(conn string) *PostgreSQL

func (*PostgreSQL) Connect

func (p *PostgreSQL) Connect() (*sql.DB, error)

func (*PostgreSQL) Insert

func (p *PostgreSQL) Insert(db *sql.DB, data types.LogData) error

Jump to

Keyboard shortcuts

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