dollar

package
v0.0.0-...-a14305a Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTables

func CreateTables(ctx context.Context)

func Save

func Save(ctx context.Context, cot Cotacao) error

func SaveDollarPrice

func SaveDollarPrice(ctx context.Context) ([]byte, error)

Types

type ConvData

type ConvData struct {
	Code       string `json:"code"`
	Codein     string `json:"codein"`
	Name       string `json:"name"`
	High       string `json:"high"`
	Low        string `json:"low"`
	VarBid     string `json:"varBid"`
	PctChange  string `json:"pctChange"`
	Bid        string `json:"bid"`
	Ask        string `json:"ask"`
	Timestamp  string `json:"timestamp"`
	CreateDate string `json:"create_date"`
}

type Conversion

type Conversion struct {
	Id   string   `json:"id"`
	Data ConvData `json:"USDBRL"`
}

func RequestDollarPrice

func RequestDollarPrice(ctx context.Context) (*Conversion, error)

type Cotacao

type Cotacao struct {
	Id         string  `json:"id"`
	Code       string  `json:"code"`
	Codein     string  `json:"codein"`
	Name       string  `json:"name"`
	High       float64 `json:"high"`
	Low        float64 `json:"low"`
	VarBid     float64 `json:"varBid"`
	PctChange  float64 `json:"pctChange"`
	Bid        float64 `json:"bid"`
	Ask        float64 `json:"ask"`
	Timestamp  string  `json:"timestamp"`
	CreateDate string  `json:"create_date"`
}

func Read

func Read(ctx context.Context) ([]Cotacao, error)

type DatabaseConnection

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

Jump to

Keyboard shortcuts

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