reports

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT = iota + 1

	// Number format
	GENERAL
	NUMBER
	INDEX
	PERCENT

	EMPTY

	// Text position
	LEFT
	RIGHT
	CENTER
)

Used by style

View Source
const (
	Rtable = iota + 1
	Rcsv
	Rcsvrend
)

Type of report output

Variables

This section is empty.

Functions

func GetSpcfctnCd added in v1.1.0

func GetSpcfctnCd(db *sql.DB, companyName string, ticker string) string

ListTickers returns SpcfctnCd of a ticker

func ListCompanies

func ListCompanies(db *sql.DB) (names []string, err error)

ListCompanies shows all available companies

func ListCompaniesProfits added in v0.9.0

func ListCompaniesProfits(db *sql.DB, rate float32) error

ListCompaniesProfits lists companies by net profit: more sustainable growth listed first

func ListSector added in v0.8.1

func ListSector(db *sql.DB, company, yamlFile string) (err error)

ListSector shows all companies from the same sector as 'company'

func ListTickers added in v1.1.0

func ListTickers(db *sql.DB, companyName string) (names []string, err error)

ListTickers shows all available tickers for a companie name

func ReportToStdout added in v1.1.0

func ReportToStdout(parms map[string]interface{}) error

ReportToStdout reports company financial data from DB to Stdout.

func ReportToXlsx added in v1.1.0

func ReportToXlsx(parms map[string]interface{}) error

ReportToXlsx reports company financial data from DB to Excel.

Types

type AccountValue added in v1.1.0

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

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, opts FIITerminalOptions) (*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) Monthly added in v1.1.0

func (t FIITerminal) Monthly(codes []string, n int) error

func (*FIITerminal) SetParms added in v1.0.0

func (t *FIITerminal) SetParms(parms map[string]string)

SetParms set the terminal reports parameters.

type FIITerminalOptions added in v1.1.0

type FIITerminalOptions struct {
	APIKey, DataDir string
}

type Logger added in v1.0.0

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

func NewLogger added in v1.0.0

func NewLogger(out io.Writer) *Logger

New creates a new Logger

func (*Logger) Debug added in v1.0.0

func (l *Logger) Debug(format string, v ...interface{})

Debug for debugging information.

func (*Logger) Error added in v1.0.0

func (l *Logger) Error(format string, v ...interface{})

Error message. Always print to Stderr.

func (*Logger) Info added in v1.0.0

func (l *Logger) Info(format string, v ...interface{})

Info for something noteworthy.

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()

func (*Logger) Printf added in v1.0.0

func (l *Logger) Printf(format string, v ...interface{})

Printf prints the plain text.

func (*Logger) Run added in v1.0.0

func (l *Logger) Run(format string, v ...interface{})

Run prints a message before running a process.

func (*Logger) SetOut added in v1.0.0

func (l *Logger) SetOut(out io.Writer)

func (*Logger) Trace added in v1.0.0

func (l *Logger) Trace(format string, v ...interface{})

Trace for very low level logs.

func (*Logger) Warn added in v1.0.0

func (l *Logger) Warn(format string, v ...interface{})

Warn for a warning message.

type Report

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

Report parameters used in most functions

func New added in v1.1.0

func New(parms map[string]interface{}) (*Report, error)

func (Report) LastYearRange added in v1.1.0

func (r Report) LastYearRange(cid int) (int, int, error)

LastYearRange returns the 1st and last day from last year stored on the DB for this company id. Return dates in unix epoch format.

func (Report) RawAccounts added in v1.1.0

func (r Report) RawAccounts(cid, year int) ([]AccountValue, error)

func (*Report) Summary added in v1.1.0

func (r *Report) Summary(company string) (map[string]string, error)

type Sheet

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

Sheet struct

type TickerInfo added in v1.1.0

type TickerInfo struct {
	SpcfctnCd string
	// contains filtered or unexported fields
}

TickerInfo contains the ticker name and SpcfctnCd

Jump to

Keyboard shortcuts

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