reports

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: MIT Imports: 24 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 HTMLServer added in v1.0.0

func HTMLServer(opts ...ServerOption)

HTMLServer is a very basic html server to show the reports.

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 Report

func Report(p Parms) error

Report of company data from DB to Excel

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 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 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 Server added in v1.0.0

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

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

type Sheet

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

Sheet struct

Jump to

Keyboard shortcuts

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