Documentation ¶
Index ¶
- func Run(cfg *Config) error
- type Config
- type GUI
- func (g *GUI) Close() error
- func (g *GUI) DetermineTickersForRender(globalOffset float32) []*models.Ticker
- func (g *GUI) RenderLoop(ctx context.Context) error
- func (g *GUI) Run(ctx context.Context) error
- func (g *GUI) Setup() error
- func (g *GUI) SystemPanel()
- func (g *GUI) TickerOffset(globalOffset float32, ticker *models.Ticker) float32
- type Logo
- type LogoManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GUI ¶
type GUI struct {
// contains filtered or unexported fields
}
func (*GUI) Close ¶
Close shuts down the GUI. nolint:unparam // We want to match the io.Closer interface.
func (*GUI) DetermineTickersForRender ¶
DetermineTickersForRender takes a global offset and returns the ticker indices which are within visiable positions ( should be rendered ).
func (*GUI) SystemPanel ¶
func (g *GUI) SystemPanel()
func (*GUI) TickerOffset ¶
TickerOffset determines what the offset should be for this ticker, on this screen. TODO: We should calculate each tickers offset and allow for dynamic width tickers. When
there is a 4 letter ticker with a 4 digit price, it's much wider than a 2 letter ticker and 2 digit price
type Logo ¶
type Logo struct { Status logoStatus NanovImgID int // contains filtered or unexported fields }
type LogoManager ¶
type LogoManager struct { sync.RWMutex // NeedsRenderAccess is a flag we set when we need access to the main render thread. // We cannot load images into context unless it's on the main render thread. NeedsRenderAccess bool // contains filtered or unexported fields }
func NewLogosManager ¶
func NewLogosManager() *LogoManager
func (*LogoManager) DownloadLogo ¶
func (l *LogoManager) DownloadLogo(ticker *models.Ticker) error
func (*LogoManager) GetTickerImage ¶
func (l *LogoManager) GetTickerImage(ticker *models.Ticker) *Logo
GetTickerImage attempts to get the tickers logo. If it does not exist it will start the download process and return a placeholder image instead.
func (*LogoManager) RenderThread ¶
func (l *LogoManager) RenderThread()
RenderThread is called in the main rendering thread ( so be fast ). This is required to change the context. Without being in the main thread it will cause panics.