indcode

package
v0.0.0-...-d790968 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayoutYYYYMMDD     = "2006/02/01"
	LayoutDDMMYYYY     = "02/01/2006"
	LayoutDDMMYYYYfull = "02/01/2006 15:04:05 -03"
	Layout             = "22 Jan 2006 15:04:05"
)
View Source
const (
	Layout20060127     = "2006/01/27"
	Layout27012006     = "27/01/2006"
	Layout27012006full = "27/01/2006 15:04:03 time.UTC"
	Layout012006       = "01/2006"
)

Variables

This section is empty.

Functions

func FStrToSlices

func FStrToSlices(s string) ([]time.Time, []float64)

FStrToSlices takes a slice of strings and returns two slices of different types

func FcumulatedVar

func FcumulatedVar(data []IndexesSeries) ([]float64, error)

FcumulatedVar returns the cumulated variations at an interval

func FgetMonthlyVariationsByDate

func FgetMonthlyVariationsByDate(data []IndexesSeries, date time.Time) (float64, error)

FgetMonthlyVariationsByDate returns the monthly variation by date

func FgetMonthlyVariationsInRange

func FgetMonthlyVariationsInRange(data []IndexesSeries, startDate, endDate time.Time) []float64

FgetMonthlyVariationsInRange returns the variation in an interval of dates

func FprintFormattedOutPut

func FprintFormattedOutPut(data []IndexesSeries)

FprintFormattedOutPut prints the formatted output using text/tabwriter

func FprintFormattedOutPut02

func FprintFormattedOutPut02(data []IndexesSeries)

FprintFormattedOutPut prints the formatted output without tabwriter

func ReadCSVtoSlices

func ReadCSVtoSlices(s string) [][]string

Types

type IndexValues

type IndexValues struct {
	Date       time.Time
	MonthlyVar float64
}

func FopenCSVfile

func FopenCSVfile(s string) ([]IndexValues, error)

FopenCSVfile opens the CSV file and returns ...

type IndexesSeries

type IndexesSeries struct {
	Date      time.Time
	Variation float64
}

func FFilterAndPrintWhitinInterval

func FFilterAndPrintWhitinInterval(data []IndexesSeries, startDate, endDate time.Time) ([]IndexesSeries, error)

FFilterAndPrintWhitinInterval returns the filtered data whitin an interval

func FgetMonthlyVariation

func FgetMonthlyVariation(data []IndexesSeries, date time.Time) (IndexesSeries, error)

FgetMonthlyVariation returns the date and the variation at a specific date

func FreadCSVdata

func FreadCSVdata(s string) ([]IndexesSeries, error)

FreadCSVdata opens and put the CSV file's content into a struct using a bufio.NewReader

func FreadCSVtoStruct

func FreadCSVtoStruct(s string) []IndexesSeries

FreadCSVtoStructs reads a CSV file into a struct

Jump to

Keyboard shortcuts

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