database

package
v0.0.0-...-13dfe30 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FAKE_CURRENCY_CODE = "USD"
View Source
const FAKE_ITEM_PRICE = 3.12
View Source
const FATEL_PRICE_ERROR = "Fatal price error "

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentPrice

type CurrentPrice struct {
	ID           string  `json:"id"`
	Value        float64 `json:"value"`
	CurrencyCode string  `json:"currency_code"`
	Error        string  `json:"error"`
}

type IMongoDb

type IMongoDb interface {
	Connect() error
	GetPriceInfo(id string, currentPrice chan CurrentPrice)
	PutPriceInfo(price CurrentPrice) error
}

type Mock

type Mock struct{}

func (Mock) Connect

func (Mock) Connect() error

func (Mock) GetPriceInfo

func (Mock) GetPriceInfo(id string, currentPrice chan CurrentPrice)

func (Mock) PutPriceInfo

func (Mock) PutPriceInfo(price CurrentPrice) error

type Request

type Request struct{}

func (Request) Connect

func (Request) Connect() error

func (Request) GetPriceInfo

func (Request) GetPriceInfo(id string, currentPrice chan CurrentPrice)

Get price information for given item from database

func (Request) PutPriceInfo

func (Request) PutPriceInfo(price CurrentPrice) error

Update or insert price information for given item

Jump to

Keyboard shortcuts

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