Back to godoc.org

Package postgres

v0.0.0-...-20dc6fc
Latest Go to latest

The latest major version is .

Published: Nov 22, 2019 | License: MIT | Module: github.com/KyberNetwork/tokenrate

Index

Variables

var (
	// ErrNotFound return when data not found
	ErrNotFound = errors.New("not found")
)

type TokenPriceDB

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

TokenPriceDB is storage of token price

func NewTokenPriceDB

func NewTokenPriceDB(sugar *zap.SugaredLogger, db *sqlx.DB) (*TokenPriceDB, error)

NewTokenPriceDB return instance of TokenPriceDB

func (*TokenPriceDB) GetTokenPrice

func (x *TokenPriceDB) GetTokenPrice(token, currency, provider string, timestamp time.Time) (float64, error)

GetTokenPrice save token price data

func (*TokenPriceDB) SaveTokenPrice

func (x *TokenPriceDB) SaveTokenPrice(token, currency, provider string, timestamp time.Time, price float64) error

SaveTokenPrice save token price data

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier