server

package module
v0.0.0-...-8ee6ed4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URL_ECONOMIA = "https://economia.awesomeapi.com.br/json/last/"
	CODE         = "USD"
	CODEIN       = "BRL"
	EP           = "cotacao"
	PORT         = "8080"
)

Variables

View Source
var CotacaoTest = NewCotacao(
	"USD",
	"BRL",
	"Dólar Americano/Real Brasileiro",
	"5.3471",
	"5.2792",
	"0.0446",
	"0.84",
	"5.322",
	"5.3245",
	"1671124497",
	"2022-12-15 14:51:33",
)

Functions

func SaveCotacao

func SaveCotacao(ctx context.Context, cotacao Cotacao) (err error)

Types

type Cotacao

type Cotacao struct {
	Id         string `json:"id"`
	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"`
}

func NewCotacao

func NewCotacao(code string, codein string, name string, high string, low string, varBid string, pctChange string, bid string, ask string, timestamp string, create_date string) (cotacao Cotacao)

type CotacaoDtoOut

type CotacaoDtoOut struct {
	Valor string `json:"valor"`
}

func GetCotacao

func GetCotacao(ctx context.Context, cancel context.CancelFunc, ctxDB context.Context, cancelDB context.CancelFunc) (cotacaoOut CotacaoDtoOut, err error)

type Symbol

type Symbol struct {
	Symbol Cotacao `json:"USDBRL"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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