Documentation ¶
Index ¶
- Variables
- func ActionsMap() map[string]bool
- func Clean() error
- func DefaultShortcuts() map[string]string
- func GetBytes(key interface{}) ([]byte, error)
- func NormalizePath(path string) string
- func PrintPrice(config *PriceConfig) error
- func PrintVersion()
- func Reset() error
- func Slugify(s string) string
- func TableColumnOrder() []string
- func UserPreferredHomeDir() string
- func Version() string
- type APIKeys
- type ChartView
- type Coin
- type Cointop
- func (ct *Cointop) ActionExists(action string) bool
- func (ct *Cointop) ActiveViewName() string
- func (ct *Cointop) AllCoins() []*Coin
- func (ct *Cointop) CacheAllCoinsSlugMap()
- func (ct *Cointop) CacheKey(key string) string
- func (ct *Cointop) ChartPoints(symbol string, name string) error
- func (ct *Cointop) ClampedWidth() int
- func (ct *Cointop) CoinBySymbol(symbol string) *Coin
- func (ct *Cointop) CursorDownOrNextPage() error
- func (ct *Cointop) CursorUpOrPreviousPage() error
- func (ct *Cointop) EnlargeChart() error
- func (ct *Cointop) Exit()
- func (ct *Cointop) FirstChartRange() error
- func (ct *Cointop) GetTableCoinsSlice() []*Coin
- func (ct *Cointop) HighlightedPageRowIndex() int
- func (ct *Cointop) HighlightedRowCoin() *Coin
- func (ct *Cointop) HighlightedRowIndex() int
- func (ct *Cointop) LastChartRange() error
- func (ct *Cointop) NextChartRange() error
- func (ct *Cointop) OpenLink() error
- func (ct *Cointop) PortfolioChart() error
- func (ct *Cointop) PortfolioEntry(c *Coin) (*PortfolioEntry, bool)
- func (ct *Cointop) PortfolioEntryExists(c *Coin) bool
- func (ct *Cointop) PrevChartRange() error
- func (ct *Cointop) Quit() error
- func (ct *Cointop) QuitView() error
- func (ct *Cointop) ReadAPIKeyFromStdin(name string) (string, error)
- func (ct *Cointop) RefreshRowLink() error
- func (ct *Cointop) RefreshTable() error
- func (ct *Cointop) RowChanged()
- func (ct *Cointop) RowLink() string
- func (ct *Cointop) RowLinkShort() string
- func (ct *Cointop) Run() error
- func (ct *Cointop) Save() error
- func (ct *Cointop) SetActiveView(v string) error
- func (ct *Cointop) SetSavingStatus()
- func (ct *Cointop) SetViewOnBottom(v string) error
- func (ct *Cointop) ShortenChart() error
- func (ct *Cointop) ShowChartLoader() error
- func (ct *Cointop) ToggleCoinChart() error
- func (ct *Cointop) ToggleTableFullscreen() error
- func (ct *Cointop) Update(f func() error)
- func (ct *Cointop) UpdateChart() error
- func (ct *Cointop) UpdateStatusbar(s string) error
- func (ct *Cointop) UpdateTable() error
- func (ct *Cointop) UpdateTableHeader()
- func (ct *Cointop) Version() string
- type Colorscheme
- func (c *Colorscheme) BaseBg() gocui.Attribute
- func (c *Colorscheme) BaseFg() gocui.Attribute
- func (c *Colorscheme) Chart(a ...interface{}) string
- func (c *Colorscheme) MarketBarLabelActive(a ...interface{}) string
- func (c *Colorscheme) Marketbar(a ...interface{}) string
- func (c *Colorscheme) MarketbarChangeDownSprintf() ISprintf
- func (c *Colorscheme) MarketbarChangeSprintf() ISprintf
- func (c *Colorscheme) MarketbarChangeUpSprintf() ISprintf
- func (c *Colorscheme) MarketbarSprintf() ISprintf
- func (c *Colorscheme) Menu(a ...interface{}) string
- func (c *Colorscheme) MenuHeader(a ...interface{}) string
- func (c *Colorscheme) MenuLabel(a ...interface{}) string
- func (c *Colorscheme) MenuLabelActive(a ...interface{}) string
- func (c *Colorscheme) Searchbar(a ...interface{}) string
- func (c *Colorscheme) SetViewActiveColor(view *gocui.View, name string)
- func (c *Colorscheme) SetViewColor(view *gocui.View, name string)
- func (c *Colorscheme) Statusbar(a ...interface{}) string
- func (c *Colorscheme) TableColumnChange(a ...interface{}) string
- func (c *Colorscheme) TableColumnChangeDown(a ...interface{}) string
- func (c *Colorscheme) TableColumnChangeDownSprintf() ISprintf
- func (c *Colorscheme) TableColumnChangeSprintf() ISprintf
- func (c *Colorscheme) TableColumnChangeUp(a ...interface{}) string
- func (c *Colorscheme) TableColumnChangeUpSprintf() ISprintf
- func (c *Colorscheme) TableColumnPrice(a ...interface{}) string
- func (c *Colorscheme) TableColumnPriceSprintf() ISprintf
- func (c *Colorscheme) TableHeader(a ...interface{}) string
- func (c *Colorscheme) TableHeaderColumnActive(a ...interface{}) string
- func (c *Colorscheme) TableHeaderColumnActiveSprintf() ISprintf
- func (c *Colorscheme) TableHeaderSprintf() ISprintf
- func (c *Colorscheme) TableRow(a ...interface{}) string
- func (c *Colorscheme) TableRowActive(a ...interface{}) string
- func (c *Colorscheme) TableRowFavorite(a ...interface{}) string
- func (c *Colorscheme) TableRowFavoriteSprintf() ISprintf
- func (c *Colorscheme) TableRowSprintf() ISprintf
- type Config
- type ConvertMenuView
- type HelpView
- type ISprintf
- type IView
- type InputView
- type MarketbarView
- type Portfolio
- type PortfolioEntry
- type PortfolioUpdateMenuView
- type PriceConfig
- type SearchFieldView
- type State
- type StatusbarView
- type TableHeaderView
- type TableView
- type View
- type Views
Constants ¶
This section is empty.
Variables ¶
var CoinGecko = "coingecko"
CoinGecko is API choice
var CoinMarketCap = "coinmarketcap"
CoinMarketCap is API choice
var DefaultColors = `` /* 1611-byte string literal not displayed */
DefaultColors is the default color scheme
var ErrInvalidAPIChoice = errors.New("Invalid API choice")
ErrInvalidAPIChoice is error for invalid API choice
Functions ¶
func ActionsMap ¶
ActionsMap returns a map of all the available actions
func DefaultShortcuts ¶
DefaultShortcuts is a map of the default shortcuts
func NormalizePath ¶
NormalizePath normalizes and extends the path string
func PrintPrice ¶
func PrintPrice(config *PriceConfig) error
PrintPrice outputs the current price of the coin
func TableColumnOrder ¶
func TableColumnOrder() []string
TableColumnOrder returns the default order of the table columns
func UserPreferredHomeDir ¶
func UserPreferredHomeDir() string
UserPreferredHomeDir returns the preferred home directory for the user
Types ¶
type APIKeys ¶
type APIKeys struct {
// contains filtered or unexported fields
}
APIKeys is api keys structure
type Coin ¶
type Coin struct { ID string Name string Slug string Symbol string Rank int Price float64 Volume24H float64 MarketCap float64 AvailableSupply float64 TotalSupply float64 PercentChange1H float64 PercentChange24H float64 PercentChange7D float64 PercentChange30D float64 PercentChange1Y float64 LastUpdated string // for favorites Favorite bool // for portfolio Holdings float64 Balance float64 }
Coin is the row structure
type Cointop ¶
type Cointop struct { ActionsMap map[string]bool State *State TableColumnOrder []string Views *Views // contains filtered or unexported fields }
Cointop cointop
func (*Cointop) ActionExists ¶
ActionExists returns true if action exists
func (*Cointop) ActiveViewName ¶
ActiveViewName returns the name of the active view
func (*Cointop) CacheAllCoinsSlugMap ¶
func (ct *Cointop) CacheAllCoinsSlugMap()
CacheAllCoinsSlugMap writes the coins map to the memory and disk cache
func (*Cointop) ChartPoints ¶
ChartPoints calculates the the chart points
func (*Cointop) ClampedWidth ¶
ClampedWidth returns the clamped width
func (*Cointop) CoinBySymbol ¶
CoinBySymbol returns the coin struct given the symbol
func (*Cointop) CursorDownOrNextPage ¶
CursorDownOrNextPage ...
func (*Cointop) CursorUpOrPreviousPage ¶
CursorUpOrPreviousPage ...
func (*Cointop) EnlargeChart ¶
EnlargeChart increases the chart height by one row
func (*Cointop) FirstChartRange ¶
FirstChartRange sets the chart to the first range option
func (*Cointop) GetTableCoinsSlice ¶
GetTableCoinsSlice returns a slice of the table rows
func (*Cointop) HighlightedPageRowIndex ¶
HighlightedPageRowIndex returns the index of page row of the highlighted row
func (*Cointop) HighlightedRowCoin ¶
HighlightedRowCoin returns the coin at the index of the highlighted row
func (*Cointop) HighlightedRowIndex ¶
HighlightedRowIndex returns the index of the highlighted row
func (*Cointop) LastChartRange ¶
LastChartRange sets the chart to the last range option
func (*Cointop) NextChartRange ¶
NextChartRange sets the chart to the next range option
func (*Cointop) PortfolioChart ¶
PortfolioChart renders the portfolio chart
func (*Cointop) PortfolioEntry ¶
func (ct *Cointop) PortfolioEntry(c *Coin) (*PortfolioEntry, bool)
PortfolioEntry returns a portfolio entry
func (*Cointop) PortfolioEntryExists ¶
PortfolioEntryExists returns true if portfolio entry exists
func (*Cointop) PrevChartRange ¶
PrevChartRange sets the chart to the prevous range option
func (*Cointop) ReadAPIKeyFromStdin ¶
ReadAPIKeyFromStdin reads the user inputed API from the stdin prompt
func (*Cointop) RefreshRowLink ¶
RefreshRowLink updates the row link in the statusbar
func (*Cointop) RefreshTable ¶
RefreshTable refreshes the table
func (*Cointop) RowChanged ¶
func (ct *Cointop) RowChanged()
RowChanged is called when the row is updated
func (*Cointop) RowLinkShort ¶
RowLinkShort returns a shortened version of the row url link
func (*Cointop) SetActiveView ¶
SetActiveView sets the active view
func (*Cointop) SetSavingStatus ¶
func (ct *Cointop) SetSavingStatus()
SetSavingStatus sets the saving indicator in the statusbar
func (*Cointop) SetViewOnBottom ¶
SetViewOnBottom sets the view to the bottom layer
func (*Cointop) ShortenChart ¶
ShortenChart decreases the chart height by one row
func (*Cointop) ShowChartLoader ¶
ShowChartLoader shows chart loading indicator
func (*Cointop) ToggleCoinChart ¶
ToggleCoinChart toggles between the global chart and the coin chart
func (*Cointop) ToggleTableFullscreen ¶
ToggleTableFullscreen toggles the table fullscreen mode
func (*Cointop) UpdateChart ¶
UpdateChart updates the chart view
func (*Cointop) UpdateStatusbar ¶
UpdateStatusbar updates the statusbar view
func (*Cointop) UpdateTableHeader ¶
func (ct *Cointop) UpdateTableHeader()
UpdateTableHeader renders the table header
type Colorscheme ¶
type Colorscheme struct {
// contains filtered or unexported fields
}
Colorscheme is the struct for colorscheme
func (*Colorscheme) MarketBarLabelActive ¶
func (c *Colorscheme) MarketBarLabelActive(a ...interface{}) string
MarketBarLabelActive ...
func (*Colorscheme) Marketbar ¶
func (c *Colorscheme) Marketbar(a ...interface{}) string
Marketbar ...
func (*Colorscheme) MarketbarChangeDownSprintf ¶
func (c *Colorscheme) MarketbarChangeDownSprintf() ISprintf
MarketbarChangeDownSprintf ...
func (*Colorscheme) MarketbarChangeSprintf ¶
func (c *Colorscheme) MarketbarChangeSprintf() ISprintf
MarketbarChangeSprintf ...
func (*Colorscheme) MarketbarChangeUpSprintf ¶
func (c *Colorscheme) MarketbarChangeUpSprintf() ISprintf
MarketbarChangeUpSprintf ...
func (*Colorscheme) MarketbarSprintf ¶
func (c *Colorscheme) MarketbarSprintf() ISprintf
MarketbarSprintf ...
func (*Colorscheme) MenuHeader ¶
func (c *Colorscheme) MenuHeader(a ...interface{}) string
MenuHeader ...
func (*Colorscheme) MenuLabel ¶
func (c *Colorscheme) MenuLabel(a ...interface{}) string
MenuLabel ...
func (*Colorscheme) MenuLabelActive ¶
func (c *Colorscheme) MenuLabelActive(a ...interface{}) string
MenuLabelActive ...
func (*Colorscheme) Searchbar ¶
func (c *Colorscheme) Searchbar(a ...interface{}) string
Searchbar ...
func (*Colorscheme) SetViewActiveColor ¶
func (c *Colorscheme) SetViewActiveColor(view *gocui.View, name string)
SetViewActiveColor ...
func (*Colorscheme) SetViewColor ¶
func (c *Colorscheme) SetViewColor(view *gocui.View, name string)
SetViewColor ...
func (*Colorscheme) Statusbar ¶
func (c *Colorscheme) Statusbar(a ...interface{}) string
Statusbar ...
func (*Colorscheme) TableColumnChange ¶
func (c *Colorscheme) TableColumnChange(a ...interface{}) string
TableColumnChange ...
func (*Colorscheme) TableColumnChangeDown ¶
func (c *Colorscheme) TableColumnChangeDown(a ...interface{}) string
TableColumnChangeDown ...
func (*Colorscheme) TableColumnChangeDownSprintf ¶
func (c *Colorscheme) TableColumnChangeDownSprintf() ISprintf
TableColumnChangeDownSprintf ...
func (*Colorscheme) TableColumnChangeSprintf ¶
func (c *Colorscheme) TableColumnChangeSprintf() ISprintf
TableColumnChangeSprintf ...
func (*Colorscheme) TableColumnChangeUp ¶
func (c *Colorscheme) TableColumnChangeUp(a ...interface{}) string
TableColumnChangeUp ...
func (*Colorscheme) TableColumnChangeUpSprintf ¶
func (c *Colorscheme) TableColumnChangeUpSprintf() ISprintf
TableColumnChangeUpSprintf ...
func (*Colorscheme) TableColumnPrice ¶
func (c *Colorscheme) TableColumnPrice(a ...interface{}) string
TableColumnPrice ...
func (*Colorscheme) TableColumnPriceSprintf ¶
func (c *Colorscheme) TableColumnPriceSprintf() ISprintf
TableColumnPriceSprintf ...
func (*Colorscheme) TableHeader ¶
func (c *Colorscheme) TableHeader(a ...interface{}) string
TableHeader ...
func (*Colorscheme) TableHeaderColumnActive ¶
func (c *Colorscheme) TableHeaderColumnActive(a ...interface{}) string
TableHeaderColumnActive ...
func (*Colorscheme) TableHeaderColumnActiveSprintf ¶
func (c *Colorscheme) TableHeaderColumnActiveSprintf() ISprintf
TableHeaderColumnActiveSprintf ...
func (*Colorscheme) TableHeaderSprintf ¶
func (c *Colorscheme) TableHeaderSprintf() ISprintf
TableHeaderSprintf ...
func (*Colorscheme) TableRowActive ¶
func (c *Colorscheme) TableRowActive(a ...interface{}) string
TableRowActive ...
func (*Colorscheme) TableRowFavorite ¶
func (c *Colorscheme) TableRowFavorite(a ...interface{}) string
TableRowFavorite ...
func (*Colorscheme) TableRowFavoriteSprintf ¶
func (c *Colorscheme) TableRowFavoriteSprintf() ISprintf
TableRowFavoriteSprintf ...
func (*Colorscheme) TableRowSprintf ¶
func (c *Colorscheme) TableRowSprintf() ISprintf
TableRowSprintf ...
type Config ¶
type Config struct { APIChoice string Colorscheme string ConfigFilepath string CoinMarketCapAPIKey string NoPrompts bool HideMarketbar bool HideChart bool HideStatusbar bool OnlyTable bool RefreshRate *uint }
Config config options
type ConvertMenuView ¶
type ConvertMenuView struct {
*View
}
ConvertMenuView is structure for convert menu view
func NewConvertMenuView ¶
func NewConvertMenuView() *ConvertMenuView
NewConvertMenuView returns a new convert menu view
type MarketbarView ¶
type MarketbarView struct {
*View
}
MarketbarView is structure for marketbar view
func NewMarketbarView ¶
func NewMarketbarView() *MarketbarView
NewMarketbarView returns a new marketbar view
type Portfolio ¶
type Portfolio struct {
Entries map[string]*PortfolioEntry
}
Portfolio is portfolio structure
type PortfolioEntry ¶
PortfolioEntry is portfolio entry
type PortfolioUpdateMenuView ¶
type PortfolioUpdateMenuView struct {
*View
}
PortfolioUpdateMenuView is structure for portfolio update menu view
func NewPortfolioUpdateMenuView ¶
func NewPortfolioUpdateMenuView() *PortfolioUpdateMenuView
NewPortfolioUpdateMenuView returns a new portfolio update menu view
type PriceConfig ¶
PriceConfig is the config options for the price command
type SearchFieldView ¶
type SearchFieldView struct {
*View
}
SearchFieldView is structure for search field view
func NewSearchFieldView ¶
func NewSearchFieldView() *SearchFieldView
NewSearchFieldView returns a new search field view
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is the state preferences of cointop
type StatusbarView ¶
type StatusbarView struct {
*View
}
StatusbarView is structure for statusbar view
func NewStatusbarView ¶
func NewStatusbarView() *StatusbarView
NewStatusbarView returns a new statusbar view
func (*StatusbarView) Update ¶
func (statusbar *StatusbarView) Update(str string) error
Update updates the content of the statusbar
type TableHeaderView ¶
type TableHeaderView struct {
*View
}
TableHeaderView is structure for table header view
func NewTableHeaderView ¶
func NewTableHeaderView() *TableHeaderView
NewTableHeaderView returns a new table header view
type View ¶
type View struct {
// contains filtered or unexported fields
}
View is a cointop view
func (*View) SetBacking ¶
SetBacking sets the backing gocui view
type Views ¶
type Views struct { Chart *ChartView Table *TableView TableHeader *TableHeaderView Marketbar *MarketbarView SearchField *SearchFieldView Statusbar *StatusbarView Help *HelpView ConvertMenu *ConvertMenuView Input *InputView PortfolioUpdateMenu *PortfolioUpdateMenuView }
Views are all views in cointop
Source Files ¶
- actions.go
- cache.go
- chart.go
- coin.go
- cointop.go
- colorscheme.go
- config.go
- conversion.go
- debug.go
- default_colors.go
- events.go
- favorites.go
- help.go
- keybindings.go
- layout.go
- list.go
- marketbar.go
- navigation.go
- portfolio.go
- quit.go
- refresh.go
- save.go
- search.go
- selection.go
- shortcuts.go
- size.go
- sort.go
- statusbar.go
- stdin.go
- table.go
- table_header.go
- update.go
- util.go
- version.go
- view.go
Directories ¶
Path | Synopsis |
---|---|
api
|
|
coingecko/v3
Package coingecko is forked from https://github.com/superoo7/go-gecko
|
Package coingecko is forked from https://github.com/superoo7/go-gecko |
common
|
|
gizak/termui
Package termui is a library designed for creating command line UI.
|
Package termui is a library designed for creating command line UI. |