Documentation ¶
Index ¶
- Variables
- func IsDate(date string) bool
- func IsURL(str string) bool
- func JoinURL(base string, paths ...string) string
- func LastBusinessDay(n int) string
- func LastBusinessDayOfYear(year int) string
- func MonthsFromToday(n int) []string
- type Dividend
- type FIIDetails
- type FIIStorage
- type Logger
- type Monthly
- type StockStorage
Constants ¶
This section is empty.
Variables ¶
var ( ErrRecordExists = errors.New("insert ignored, register already exists") ErrFileNotUpdated = errors.New("file not updated") ErrInvalidAPIKey = errors.New("apiKey inválida, configure uma chave em" + " https://www.alphavantage.co/support/#api-key e adicione no arquivo" + " config.yml") ErrInvalidDate = errors.New("invalid date format") )
Error codes
Functions ¶
func LastBusinessDay ¶ added in v1.1.0
LastBusinessDay returns the most recent business day 'n' days before today. Returns date as YYYY-MM-DD.
func LastBusinessDayOfYear ¶ added in v1.1.0
LastBusinessDayOfYear returns the last business day of the 'year' (the business day before Dec 30). If current year, returns last business day before today. Returns date as YYYY-MM-DD.
func MonthsFromToday ¶ added in v1.0.0
MonthsFromToday returns a list of months including the current. Date formatted as YYYY-MM.
Types ¶
type Dividend ¶ added in v1.0.0
Dividend contains the stock 'Code', and the 'Date' for the stock dividend 'Val'.
type FIIDetails ¶ added in v1.0.0
type FIIDetails struct { DetailFund struct { Acronym string `json:"acronym"` TradingName string `json:"tradingName"` TradingCode string `json:"tradingCode"` TradingCodeOthers string `json:"tradingCodeOthers"` CNPJ string `json:"cnpj"` Classification string `json:"classification"` WebSite string `json:"webSite"` FundAddress string `json:"fundAddress"` FundPhoneNumberDDD string `json:"fundPhoneNumberDDD"` FundPhoneNumber string `json:"fundPhoneNumber"` FundPhoneNumberFax string `json:"fundPhoneNumberFax"` PositionManager string `json:"positionManager"` ManagerName string `json:"managerName"` CompanyAddress string `json:"companyAddress"` CompanyPhoneNumberDDD string `json:"companyPhoneNumberDDD"` CompanyPhoneNumber string `json:"companyPhoneNumber"` CompanyPhoneNumberFax string `json:"companyPhoneNumberFax"` CompanyEmail string `json:"companyEmail"` CompanyName string `json:"companyName"` QuotaCount string `json:"quotaCount"` QuotaDateApproved string `json:"quotaDateApproved"` Codes []string `json:"codes"` CodesOther interface{} `json:"codesOther"` Segment interface{} `json:"segment"` } `json:"detailFund"` ShareHolderName string `json:"shareHolderName"` ShareHolderAddress string `json:"shareHolderAddress"` ShareHolderPhoneNumberDDD string `json:"shareHolderPhoneNumberDDD"` ShareHolderPhoneNumber string `json:"shareHolderPhoneNumber"` ShareHolderFaxNumber string `json:"shareHolderFaxNumber"` ShareHolderEmail string `json:"shareHolderEmail"` } `json:"shareHolder"` }
FIIDetails details (ID field: DetailFund.CNPJ)
type FIIStorage ¶ added in v1.1.0
type FIIStorage interface { Details(code string) (*FIIDetails, error) SaveDetails(stream []byte) error Dividends(code, monthYear string) (*[]Dividend, error) SaveDividend(stream map[string]string) (*Dividend, error) }
FIIStorage is the interface that contains the methods needed to parse, save and retrieve FII data to/from a storage.
type Logger ¶ added in v1.0.0
type Logger interface { Run(format string, v ...interface{}) Ok() Nok() Printf(format string, v ...interface{}) Trace(format string, v ...interface{}) Debug(format string, v ...interface{}) Info(format string, v ...interface{}) Warn(format string, v ...interface{}) Error(format string, v ...interface{}) SetOut(out io.Writer) }
Logger interface contains the methods needed to poperly display log messages.
type Monthly ¶ added in v1.1.0
type Monthly struct { }
Monthly contains the FII monthly report fields
type StockStorage ¶ added in v1.1.0
type StockStorage interface { Quote(code, date string) (float64, error) Code(companyName, stockType string) (string, error) Save(stream io.Reader, code string) (int, error) }
StockStorage is the interface that contains the methods needed to parse, save and retrieve stock data to/from a storage.