Documentation
¶
Index ¶
- Constants
- func HTMLServer(opts ...ServerOption)
- func ListCompanies(db *sql.DB) (names []string, err error)
- func ListCompaniesProfits(db *sql.DB, rate float32) error
- func ListSector(db *sql.DB, company, yamlFile string) (err error)
- func Report(p Parms) error
- type CompanyInfo
- type Excel
- type FIITerminal
- type Logger
- func (l *Logger) Debug(format string, v ...interface{})
- func (l *Logger) Error(format string, v ...interface{})
- func (l *Logger) Info(format string, v ...interface{})
- func (l *Logger) Nok()
- func (l *Logger) Ok()
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Run(format string, v ...interface{})
- func (l *Logger) SetOut(out io.Writer)
- func (l *Logger) Trace(format string, v ...interface{})
- func (l *Logger) Warn(format string, v ...interface{})
- type Parms
- type Server
- type ServerOption
- type Sheet
Constants ¶
const ( DEFAULT = iota + 1 // Number format GENERAL NUMBER INDEX PERCENT EMPTY // Text position LEFT RIGHT CENTER )
Used by style
const ( Rtable = iota + 1 Rcsv Rcsvrend )
Type of report output
Variables ¶
This section is empty.
Functions ¶
func HTMLServer ¶ added in v1.0.0
func HTMLServer(opts ...ServerOption)
HTMLServer is a very basic html server to show the reports.
func ListCompanies ¶
ListCompanies shows all available companies
func ListCompaniesProfits ¶ added in v0.9.0
ListCompaniesProfits lists companies by net profit: more sustainable growth listed first
func ListSector ¶ added in v0.8.1
ListSector shows all companies from the same sector as 'company'
Types ¶
type CompanyInfo ¶ added in v0.9.0
type CompanyInfo struct {
// contains filtered or unexported fields
}
CompanyInfo contains the company name and CNPJ
type Excel ¶
type Excel struct {
// contains filtered or unexported fields
}
Excel instance reachable data
type FIITerminal ¶ added in v1.0.0
type FIITerminal struct {
// contains filtered or unexported fields
}
FIITerminal implements reports related to FII funds on the terminal.
func NewFIITerminal ¶ added in v1.0.0
func NewFIITerminal(db *sql.DB, apiKey, dataDir string) (*FIITerminal, error)
NewFIITerminal creates a new instace of a FIITerminal
func (FIITerminal) Dividends ¶ added in v1.0.0
func (t FIITerminal) Dividends(codes []string, n int) error
Dividends prints the dividends report on terminal.
func (*FIITerminal) SetParms ¶ added in v1.0.0
func (t *FIITerminal) SetParms(parms map[string]string)
SetParms set the terminal reports parameters.
type Logger ¶ added in v1.0.0
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) Nok ¶ added in v1.0.0
func (l *Logger) Nok()
Nok prints a x mark after a unsuccessful Run()
func (*Logger) Ok ¶ added in v1.0.0
func (l *Logger) Ok()
Ok prints a checkmark after a successful Run()
type Parms ¶ added in v0.13.1
type Parms struct { // DB database handle DB *sql.DB // Company name to be processed Company string // Filename: path and filename of the output xlsx Filename string // YamlFile: file with the companies' sectors YamlFile string // Reports is a map with the reports and reports items to be printed: // - ExtraRatios: enables some extra financial ratios on report // - ShowShares: shows the number of shares and free float on report // - Sector: creates a sheet with the sector report Reports map[string]bool }
Parms holds the input parameters
type ServerOption ¶ added in v1.0.0
type ServerOption func(*Server)
func WithAPIKey ¶ added in v1.0.0
func WithAPIKey(apiKey string) ServerOption
func WithDB ¶ added in v1.0.0
func WithDB(db *sql.DB) ServerOption
func WithDataDir ¶ added in v1.0.0
func WithDataDir(dataDir string) ServerOption