model

package
v0.0.0-...-641a1b5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCSV

func ParseCSV[T any](data []byte, out *[]T) error

Types

type BRL

type BRL float64

func (*BRL) UnmarshalCSV

func (b *BRL) UnmarshalCSV(data string) error

type GetBondByNameResponse

type GetBondByNameResponse struct {
	Bond      ScraperBond `json:"bond"`
	UpdatedAt string      `json:"updated_at"`
}

type Invest

type Invest struct {
	Name                    string `csv:"Título"`
	AnnualInvestmentRate    string `csv:"Rendimento anual do título"`
	UnitaryInvestmentValue  BRL    `csv:"Preço unitário de investimento"`
	MinimumInvestmentAmount BRL    `csv:"Investimento mínimo"`
	Maturity                string `csv:"Vencimento do Título"`
}

type ListAllBondsResponse

type ListAllBondsResponse struct {
	Bonds     []ScraperBond `json:"bonds"`
	UpdatedAt string        `json:"updated_at"`
}

type Redeem

type Redeem struct {
	Name                   string `csv:"Título"`
	AnnualRedemptionRate   string `csv:"Rendimento anual do título"`
	UnitaryRedemptionValue BRL    `csv:"Preço unitário de resgate"`
	Maturity               string `csv:"Vencimento do Título"`
}

type SaveBondsRequest

type SaveBondsRequest struct {
	InvestData []byte `json:"invest"`
	RedeemData []byte `json:"redeem"`
}

type ScraperBond

type ScraperBond struct {
	Name                    string  `json:"name"`
	Investable              bool    `json:"investable"`
	AnnualInvestmentRate    string  `json:"annual_investment_rate"`
	UnitaryInvestmentValue  float64 `json:"unitary_investment_value"`
	MinimumInvestmentAmount float64 `json:"minimum_investment_amount"`
	AnnualRedemptionRate    string  `json:"annual_redemption_rate"`
	UnitaryRedemptionValue  float64 `json:"unitary_redemption_value"`
	Maturity                string  `json:"maturity"`
}

type ScraperCache

type ScraperCache struct {
	BondsMap  map[string]ScraperBond
	BondsList []ScraperBond
	UpdatedAt string
	sync.RWMutex
}

func (*ScraperCache) Save

func (sc *ScraperCache) Save(investData []Invest, redeemData []Redeem)

Jump to

Keyboard shortcuts

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