internal

package
v0.0.0-...-c83a561 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTabPane

func CreateTabPane(x int, y int) *widgets.TabPane

func CreateTable

func CreateTable(title string, rows int, y int) *widgets.Table

func DataReader

func DataReader(data *Data, dispatcher *workerpool.Dispatcher)

func GetRecordFromCoordinates

func GetRecordFromCoordinates(table *widgets.Table, mouseEvent *ui.Mouse) (int, interface{})

func HandleMouseClick

func HandleMouseClick(mouseEvent *ui.Mouse, quotesTable *widgets.Table, dispatcher *workerpool.Dispatcher, client *finnhub.Client, data *Data, candlePlot *CandlePlot, tabPane *widgets.TabPane)

func RequestCandle

func RequestCandle(symbol string, from time.Time, to time.Time, resolution string, dispatcher *workerpool.Dispatcher, client *finnhub.Client)

func RequestQuotes

func RequestQuotes(quotes *QuoteData, dispatcher *workerpool.Dispatcher, client *finnhub.Client)

func RequestRates

func RequestRates(base string, dispatcher *workerpool.Dispatcher, client *finnhub.Client)

func UpdateData

func UpdateData(dispatcher *workerpool.Dispatcher, client *finnhub.Client, data *Data, quoteTable *widgets.Table, ratesTable *widgets.Table, candlePlot *CandlePlot, tabPane *widgets.TabPane)

func UpdatePlot

func UpdatePlot(plot *SimplePlot, data interface{})

func UpdatePlotData

func UpdatePlotData(dispatcher *workerpool.Dispatcher, client *finnhub.Client, data *Data, candlePlot *CandlePlot, tabPane *widgets.TabPane)

func UpdateTable

func UpdateTable(table *widgets.Table, data interface{})

Types

type CandleData

type CandleData finnhub.Candle

type CandlePlot

type CandlePlot struct {
	Plot   *SimplePlot
	Symbol string
	From   time.Time
	To     time.Time
	Active bool
}

func CreateCandlePlot

func CreateCandlePlot(y int) *CandlePlot

type Configuration

type Configuration struct {
	ApiKey       string   `json:"apiKey"`
	UserQuotes   []string `json:"quotes"`
	BaseCurrency string   `json:"base"`
}

func ReadConfiguration

func ReadConfiguration() Configuration

type Data

type Data struct {
	Quotes QuoteData
	Rates  RatesData
	Candle finnhub.Candle
}

func (*Data) Initialize

func (data *Data) Initialize(quotes []string, base string)

type PlotMarker

type PlotMarker uint
const (
	MarkerBraille PlotMarker = iota
	MarkerDot
)

type QuoteData

type QuoteData map[string]finnhub.Quote

type RatesData

type RatesData finnhub.Rates

type SimplePlot

type SimplePlot struct {
	Block

	Data       []float64
	DataLabels []string

	Marker     PlotMarker
	LineColors []Color
	AxesColor  Color
	ShowAxes   bool
	// contains filtered or unexported fields
}

func NewSimplePlot

func NewSimplePlot() *SimplePlot

func (*SimplePlot) Draw

func (self *SimplePlot) Draw(buf *Buffer)

Jump to

Keyboard shortcuts

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