dbhandler

package
v0.0.0-...-53e12df Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var COLLECTION = "STOCK"
View Source
var DATABASE = "DEBUG"
View Source
var DB, _ = NewDBHandler("mongodb+srv://username:password@cluster0.jm9ahx2.mongodb.net/test")

Functions

func DisConnect

func DisConnect()

Types

type DBHandler

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

func NewDBHandler

func NewDBHandler(srv string) (*DBHandler, error)

func (*DBHandler) GetStockByCode

func (r *DBHandler) GetStockByCode(code string) (*model.Stock, error)

func (*DBHandler) InsertRecord

func (r *DBHandler) InsertRecord(code string, record model.DailyRecord) (bool, error)

func (*DBHandler) InsertStock

func (r *DBHandler) InsertStock(stock model.NewStock) (*model.Stock, error)

func (*DBHandler) UpdateRecord

func (r *DBHandler) UpdateRecord(code string, record model.NewRecord) error

Jump to

Keyboard shortcuts

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