Documentation ¶
Index ¶
- Variables
- func ActionsMap() map[string]bool
- func ChartRanges() []string
- func ChartRangesMap() map[string]time.Duration
- func Clean(config *CleanConfig) error
- func ColorschemeHelpString() string
- func CurrencySymbol(currency string) string
- func DefaultShortcuts() map[string]string
- func GetBytes(key interface{}) ([]byte, error)
- func HexToAnsi(h string) (uint8, bool)
- func PrintBitcoinDominance(config *DominanceConfig) error
- func PrintPrice(config *PriceConfig) error
- func PrintVersion()
- func Reset(config *ResetConfig) error
- func Slugify(s string) string
- func TableColumnOrder() []string
- func Version() string
- type APIKeys
- type ChartView
- type CleanConfig
- 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) CancelSearch() error
- func (ct *Cointop) ChartPoints(symbol string, name string) error
- func (ct *Cointop) ClampedWidth() int
- func (ct *Cointop) CoinBySymbol(symbol string) *Coin
- func (ct *Cointop) CoinHoldings(coin *Coin) float64
- func (ct *Cointop) ConfigDirPath() string
- func (ct *Cointop) ConfigFilePath() string
- func (ct *Cointop) CreateConfigIfNotExists() error
- func (ct *Cointop) CurrencySymbol() string
- func (ct *Cointop) CurrentDisplayPage() int
- func (ct *Cointop) CurrentPage() int
- func (ct *Cointop) CursorDown() error
- func (ct *Cointop) CursorDownOrNextPage() error
- func (ct *Cointop) CursorUp() error
- func (ct *Cointop) CursorUpOrPreviousPage() error
- func (ct *Cointop) DoSearch() error
- func (ct *Cointop) EnlargeChart() error
- func (ct *Cointop) Exit()
- func (ct *Cointop) FirstChartRange() error
- func (ct *Cointop) FirstPage() error
- func (ct *Cointop) GetFavoritesSlice() []*Coin
- func (ct *Cointop) GetListCount() int
- func (ct *Cointop) GetPortfolioSlice() []*Coin
- func (ct *Cointop) GetPortfolioTotal() float64
- func (ct *Cointop) GetSortColIndex() int
- func (ct *Cointop) GetTableCoinsSlice() []*Coin
- func (ct *Cointop) GoToGlobalIndex(idx int) error
- func (ct *Cointop) GoToPageRowIndex(idx int) error
- func (ct *Cointop) HideConvertMenu() error
- func (ct *Cointop) HideHelp() error
- func (ct *Cointop) HidePortfolioUpdateMenu() error
- func (ct *Cointop) HighlightRow(idx int) error
- func (ct *Cointop) HighlightedPageRowIndex() int
- func (ct *Cointop) HighlightedRowCoin() *Coin
- func (ct *Cointop) HighlightedRowIndex() int
- func (ct *Cointop) IsFirstPage() bool
- func (ct *Cointop) IsFirstRow() bool
- func (ct *Cointop) IsLastPage() bool
- func (ct *Cointop) IsLastRow() bool
- func (ct *Cointop) IsPageFirstLine() bool
- func (ct *Cointop) IsPageLastLine() bool
- func (ct *Cointop) IsPageMiddleLine() bool
- func (ct *Cointop) IsRunning() bool
- func (ct *Cointop) Keybindings(g *gocui.Gui) error
- func (ct *Cointop) Keyfn(fn func() error) func(g *gocui.Gui, v *gocui.View) error
- func (ct *Cointop) LastChartRange() error
- func (ct *Cointop) LastPage() error
- func (ct *Cointop) NavigateFirstLine() error
- func (ct *Cointop) NavigateLastLine() error
- func (ct *Cointop) NavigatePageFirstLine() error
- func (ct *Cointop) NavigatePageMiddleLine() error
- func (ct *Cointop) NextChartRange() error
- func (ct *Cointop) NextPage() error
- func (ct *Cointop) Noop() error
- func (ct *Cointop) OpenLink() error
- func (ct *Cointop) PageDown() error
- func (ct *Cointop) PageUp() error
- func (ct *Cointop) ParseKeys(s string) (interface{}, gocui.Modifier)
- func (ct *Cointop) PortfolioChart() error
- func (ct *Cointop) PortfolioEntriesCount() int
- func (ct *Cointop) PortfolioEntry(c *Coin) (*PortfolioEntry, bool)
- func (ct *Cointop) PortfolioEntryExists(c *Coin) bool
- func (ct *Cointop) PrevChartRange() error
- func (ct *Cointop) PrevPage() error
- func (ct *Cointop) PrevPageTop() error
- func (ct *Cointop) PrintHoldingsTable(options *TablePrintOptions) error
- func (ct *Cointop) PrintTotalHoldings(options *TablePrintOptions) error
- func (ct *Cointop) Quit() error
- func (ct *Cointop) QuitView() error
- func (ct *Cointop) ReadAPIKeyFromStdin(name string) (string, error)
- func (ct *Cointop) Refresh() error
- func (ct *Cointop) RefreshAll() error
- func (ct *Cointop) RefreshPortfolioCoins() error
- func (ct *Cointop) RefreshRowLink() error
- func (ct *Cointop) RefreshTable() error
- func (ct *Cointop) RemovePortfolioEntry(coin string)
- 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) SaveConfig() error
- func (ct *Cointop) Search(q string) error
- func (ct *Cointop) SelectedCoinName() string
- func (ct *Cointop) SelectedCoinSymbol() string
- func (ct *Cointop) SetActiveView(v string) error
- func (ct *Cointop) SetCurrencyConverstionFn(convert string) func() error
- func (ct *Cointop) SetKeybindingMod(key interface{}, mod gocui.Modifier, ...) error
- func (ct *Cointop) SetPage(page int) int
- func (ct *Cointop) SetPortfolioEntry(coin string, holdings float64) error
- func (ct *Cointop) SetPortfolioHoldings() error
- func (ct *Cointop) SetSavingStatus()
- func (ct *Cointop) SetViewOnBottom(v string) error
- func (ct *Cointop) SetupConfig() error
- func (ct *Cointop) ShortenChart() error
- func (ct *Cointop) ShowChartLoader() error
- func (ct *Cointop) ShowConvertMenu() error
- func (ct *Cointop) ShowHelp() error
- func (ct *Cointop) ShowPortfolioUpdateMenu() error
- func (ct *Cointop) Sort(sortBy string, desc bool, list []*Coin, renderHeaders bool)
- func (ct *Cointop) SortAsc() error
- func (ct *Cointop) SortDesc() error
- func (ct *Cointop) SortNextCol() error
- func (ct *Cointop) SortPrevCol() error
- func (ct *Cointop) SortToggle(sortBy string, desc bool) error
- func (ct *Cointop) SortedSupportedCurrencyConversions() []string
- func (ct *Cointop) Sortfn(sortBy string, desc bool) func(g *gocui.Gui, v *gocui.View) error
- func (ct *Cointop) SupportedCryptoCurrencyConversions() map[string]string
- func (ct *Cointop) SupportedCurrencyConversions() map[string]string
- func (ct *Cointop) SupportedFiatCurrencyConversions() map[string]string
- func (ct *Cointop) ToggleCoinChart() error
- func (ct *Cointop) ToggleConvertMenu() error
- func (ct *Cointop) ToggleFavorite() error
- func (ct *Cointop) ToggleHelp() error
- func (ct *Cointop) TogglePortfolio() error
- func (ct *Cointop) TogglePortfolioUpdateMenu() error
- func (ct *Cointop) ToggleShowFavorites() error
- func (ct *Cointop) ToggleShowPortfolio() error
- func (ct *Cointop) ToggleTableFullscreen() error
- func (ct *Cointop) TotalPages() int
- func (ct *Cointop) TotalPagesDisplay() int
- func (ct *Cointop) TotalPerPage() int
- func (ct *Cointop) Update(f func() error)
- func (ct *Cointop) UpdateChart() error
- func (ct *Cointop) UpdateCoins() error
- func (ct *Cointop) UpdateConvertMenu()
- func (ct *Cointop) UpdateHelp()
- func (ct *Cointop) UpdateMarketbar() error
- func (ct *Cointop) UpdatePortfolioUpdateMenu()
- 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 DominanceConfig
- type HelpView
- type ISprintf
- type IView
- type InputView
- type MarketbarView
- type Portfolio
- type PortfolioEntry
- type PortfolioUpdateMenuView
- type PriceConfig
- type ResetConfig
- type SearchFieldView
- type State
- type StatusbarView
- type TableHeaderView
- type TablePrintOptions
- 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 CryptocurrencyNames = map[string]string{
"BTC": "Bitcoin",
"ETH": "Ethereum",
}
CryptocurrencyNames is a map of cryptocurrency symbols to name
var CurrencySymbolMap = map[string]string{
"AUD": "$",
"BGN": "Лв.",
"BRL": "R$",
"BTC": "Ƀ",
"CAD": "$",
"CFH": "₣",
"CLP": "$",
"CNY": "¥",
"CZK": "Kč",
"DKK": "Kr",
"ETH": "Ξ",
"EUR": "€",
"GBP": "£",
"HKD": "$",
"HRK": "kn",
"HUF": "Ft",
"IDR": "Rp.",
"ILS": "₪",
"INR": "₹",
"ISK": "kr",
"JPY": "¥",
"KRW": "₩",
"MXN": "$",
"MYR": "RM",
"NOK": "kr",
"NZD": "$",
"PHP": "₱",
"PKR": "₨",
"PLN": "zł",
"RON": "lei",
"RUB": "Ꝑ",
"SEK": "kr",
"SGD": "S$",
"THB": "฿",
"TRY": "₺",
"TWD": "NT$",
"USD": "$",
"VND": "₫",
"ZAR": "R",
}
CurrencySymbolMap is map of fiat currency symbols to names. Keep these in alphabetical order.
var DefaultCacheDir = filecache.DefaultCacheDir
DefaultCacheDir ...
var DefaultColors = `` /* 1611-byte string literal not displayed */
DefaultColors is the default color scheme
var DefaultColorscheme = "cointop"
DefaultColorscheme ...
var DefaultConfigFilepath = pathutil.NormalizePath(":PREFERRED_CONFIG_HOME:/cointop/config.toml")
DefaultConfigFilepath ...
var DefaultPerPage uint = 100
DefaultPerPage ...
var ErrInvalidAPIChoice = errors.New("Invalid API choice")
ErrInvalidAPIChoice is error for invalid API choice
var FiatCurrencyNames = map[string]string{
"AUD": "Australian Dollar",
"BGN": "Bulgarian lev",
"BRL": "Brazilian Real",
"CAD": "Canadian Dollar",
"CFH": "Swiss Franc",
"CLP": "Chilean Peso",
"CNY": "Chinese Yuan",
"CZK": "Czech Koruna",
"DKK": "Danish Krone",
"EUR": "Euro",
"GBP": "British Pound",
"HKD": "Hong Kong Dollar",
"HRK": "Croatian kuna",
"HUF": "Hungarian Forint",
"IDR": "Indonesian Rupiah",
"ILS": "Israeli New Shekel",
"INR": "Indian Rupee",
"ISK": "Icelandic króna",
"JPY": "Japanese Yen",
"KRW": "South Korean Won",
"MXN": "Mexican Peso",
"MYR": "Malaysian Ringgit",
"NOK": "Norwegian Krone",
"NZD": "New Zealand Dollar",
"PHP": "Philippine Peso",
"PKR": "Pakistani Rupe",
"PLN": "Polish złoty",
"RON": "Romanian leu",
"RUB": "Russian Ruble",
"SEK": "Swedish Krona",
"SGD": "Singapore Dollar",
"THB": "Thai Baht",
"TRY": "Turkish lira",
"TWD": "New Taiwan Dollar",
"USD": "US Dollar",
"VND": "Vietnamese Dong",
"ZAR": "South African Rand",
}
FiatCurrencyNames is a mpa of currency symbols to names. Keep these in alphabetical order.
Functions ¶
func ActionsMap ¶
ActionsMap returns a map of all the available actions
func ChartRangesMap ¶
ChartRangesMap returns map of chart range time ranges
func ColorschemeHelpString ¶ added in v1.5.2
func ColorschemeHelpString() string
ColorschemeHelpString ...
func CurrencySymbol ¶
CurrencySymbol returns the symbol for the currency name
func DefaultShortcuts ¶
DefaultShortcuts is a map of the default shortcuts
func PrintBitcoinDominance ¶ added in v1.5.2
func PrintBitcoinDominance(config *DominanceConfig) error
PrintBitcoinDominance outputs the dominance percentage of bitcoin
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
Types ¶
type APIKeys ¶
type APIKeys struct {
// contains filtered or unexported fields
}
APIKeys is api keys structure
type CleanConfig ¶
CleanConfig is the config for the clean function
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 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) CancelSearch ¶
CancelSearch closes the search field
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) CoinHoldings ¶
CoinHoldings returns portfolio coin holdings
func (*Cointop) ConfigDirPath ¶
ConfigDirPath returns the config directory path
func (*Cointop) ConfigFilePath ¶
ConfigFilePath return the config file path
func (*Cointop) CreateConfigIfNotExists ¶
CreateConfigIfNotExists creates config file if it doesn't exist
func (*Cointop) CurrencySymbol ¶
CurrencySymbol returns the symbol for the currency conversion
func (*Cointop) CurrentDisplayPage ¶
CurrentDisplayPage returns the current page in human readable format
func (*Cointop) CurrentPage ¶
CurrentPage returns the current page
func (*Cointop) CursorDown ¶
CursorDown moves the cursor one row down
func (*Cointop) CursorDownOrNextPage ¶
CursorDownOrNextPage moves the cursor down one row or goes to the next page if cursor is on the last row
func (*Cointop) CursorUpOrPreviousPage ¶
CursorUpOrPreviousPage moves the cursor up one row or goes to the previous page if cursor is on the first row
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) GetFavoritesSlice ¶
GetFavoritesSlice returns coin favorites as slice
func (*Cointop) GetListCount ¶
GetListCount returns count of coins list
func (*Cointop) GetPortfolioSlice ¶
GetPortfolioSlice returns portfolio entries as a slice
func (*Cointop) GetPortfolioTotal ¶
GetPortfolioTotal returns the total balance of portfolio entries
func (*Cointop) GetSortColIndex ¶
GetSortColIndex gets the sort column index
func (*Cointop) GetTableCoinsSlice ¶
GetTableCoinsSlice returns a slice of the table rows
func (*Cointop) GoToGlobalIndex ¶
GoToGlobalIndex navigates to the selected row index of all page rows
func (*Cointop) GoToPageRowIndex ¶
GoToPageRowIndex navigates to the selected row index of the page
func (*Cointop) HideConvertMenu ¶
HideConvertMenu hides the convert menu view
func (*Cointop) HidePortfolioUpdateMenu ¶
HidePortfolioUpdateMenu hides the portfolio update menu
func (*Cointop) HighlightRow ¶
HighlightRow highlights the row at index
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) IsFirstPage ¶
IsFirstPage returns true if cursor is on the first page
func (*Cointop) IsFirstRow ¶
IsFirstRow returns true if cursor is on first row
func (*Cointop) IsLastPage ¶
IsLastPage returns true if cursor is on the last page
func (*Cointop) IsPageFirstLine ¶
IsPageFirstLine returns true if the cursor is on the visible first row
func (*Cointop) IsPageLastLine ¶
IsPageLastLine returns true if the cursor is on the visible last row
func (*Cointop) IsPageMiddleLine ¶
IsPageMiddleLine returns true if the cursor is on the visible middle row
func (*Cointop) Keybindings ¶
Keybindings sets keyboard shortcut key bindings
func (*Cointop) LastChartRange ¶
LastChartRange sets the chart to the last range option
func (*Cointop) NavigateFirstLine ¶
NavigateFirstLine moves the cursor to the first row of the table
func (*Cointop) NavigateLastLine ¶
NavigateLastLine moves the cursor to the last row of the table
func (*Cointop) NavigatePageFirstLine ¶
NavigatePageFirstLine moves the cursor to the visible first row of the table
func (*Cointop) NavigatePageMiddleLine ¶
NavigatePageMiddleLine moves the cursor to the visible middle row of the table
func (*Cointop) NextChartRange ¶
NextChartRange sets the chart to the next range option
func (*Cointop) PortfolioChart ¶
PortfolioChart renders the portfolio chart
func (*Cointop) PortfolioEntriesCount ¶
PortfolioEntriesCount returns the count of portfolio entries
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) PrevPageTop ¶
PrevPageTop navigates to the first row of the previous page
func (*Cointop) PrintHoldingsTable ¶ added in v1.5.2
func (ct *Cointop) PrintHoldingsTable(options *TablePrintOptions) error
PrintHoldingsTable prints the holdings in an ASCII table
func (*Cointop) PrintTotalHoldings ¶ added in v1.5.2
func (ct *Cointop) PrintTotalHoldings(options *TablePrintOptions) error
PrintTotalHoldings prints the total holdings amount
func (*Cointop) ReadAPIKeyFromStdin ¶
ReadAPIKeyFromStdin reads the user inputed API from the stdin prompt
func (*Cointop) RefreshAll ¶
RefreshAll triggers a force refresh of all data
func (*Cointop) RefreshPortfolioCoins ¶ added in v1.5.2
RefreshPortfolioCoins refreshes portfolio entry coin data
func (*Cointop) RefreshRowLink ¶
RefreshRowLink updates the row link in the statusbar
func (*Cointop) RefreshTable ¶
RefreshTable refreshes the table
func (*Cointop) RemovePortfolioEntry ¶
RemovePortfolioEntry removes a portfolio entry
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) SaveConfig ¶
SaveConfig writes settings to the config file
func (*Cointop) SelectedCoinName ¶
SelectedCoinName returns the selected coin name
func (*Cointop) SelectedCoinSymbol ¶
SelectedCoinSymbol returns the selected coin symbol
func (*Cointop) SetActiveView ¶
SetActiveView sets the active view
func (*Cointop) SetCurrencyConverstionFn ¶
SetCurrencyConverstionFn sets the currency conversion function
func (*Cointop) SetKeybindingMod ¶
func (ct *Cointop) SetKeybindingMod(key interface{}, mod gocui.Modifier, callback func(g *gocui.Gui, v *gocui.View) error, view string) error
SetKeybindingMod sets the keybinding modifier key
func (*Cointop) SetPortfolioEntry ¶
SetPortfolioEntry sets a portfolio entry
func (*Cointop) SetPortfolioHoldings ¶
SetPortfolioHoldings sets portfolio entry holdings from inputed value
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) ShowConvertMenu ¶
ShowConvertMenu shows the convert menu view
func (*Cointop) ShowPortfolioUpdateMenu ¶
ShowPortfolioUpdateMenu shows the portfolio update menu
func (*Cointop) SortNextCol ¶
SortNextCol sorts the next column
func (*Cointop) SortPrevCol ¶
SortPrevCol sorts the previous column
func (*Cointop) SortToggle ¶
SortToggle toggles the sort order
func (*Cointop) SortedSupportedCurrencyConversions ¶
SortedSupportedCurrencyConversions returns sorted list of supported currencies for conversion
func (*Cointop) SupportedCryptoCurrencyConversions ¶
SupportedCryptoCurrencyConversions returns map of supported cryptocurrencies for conversion
func (*Cointop) SupportedCurrencyConversions ¶
SupportedCurrencyConversions returns a map of all supported currencies for conversion
func (*Cointop) SupportedFiatCurrencyConversions ¶
SupportedFiatCurrencyConversions returns map of supported fiat currencies for conversion
func (*Cointop) ToggleCoinChart ¶
ToggleCoinChart toggles between the global chart and the coin chart
func (*Cointop) ToggleConvertMenu ¶
ToggleConvertMenu toggles the convert menu view
func (*Cointop) ToggleFavorite ¶
ToggleFavorite toggles coin as favorite
func (*Cointop) TogglePortfolio ¶
TogglePortfolio toggles the portfolio view
func (*Cointop) TogglePortfolioUpdateMenu ¶
TogglePortfolioUpdateMenu toggles the portfolio update menu
func (*Cointop) ToggleShowFavorites ¶
ToggleShowFavorites toggles the favorites view
func (*Cointop) ToggleShowPortfolio ¶
ToggleShowPortfolio shows the portfolio view
func (*Cointop) ToggleTableFullscreen ¶
ToggleTableFullscreen toggles the table fullscreen mode
func (*Cointop) TotalPages ¶
TotalPages returns the number of total pages
func (*Cointop) TotalPagesDisplay ¶
TotalPagesDisplay returns the number of total pages in human readable format
func (*Cointop) TotalPerPage ¶
TotalPerPage returns the number max rows per page
func (*Cointop) UpdateChart ¶
UpdateChart updates the chart view
func (*Cointop) UpdateConvertMenu ¶
func (ct *Cointop) UpdateConvertMenu()
UpdateConvertMenu updates the convert menu
func (*Cointop) UpdateMarketbar ¶
UpdateMarketbar updates the market bar view
func (*Cointop) UpdatePortfolioUpdateMenu ¶
func (ct *Cointop) UpdatePortfolioUpdateMenu()
UpdatePortfolioUpdateMenu updates the portfolio update menu 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 CacheDir string Colorscheme string ConfigFilepath string CoinMarketCapAPIKey string NoPrompts bool HideMarketbar bool HideChart bool HideStatusbar bool NoCache bool OnlyTable bool RefreshRate *uint PerPage 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 DominanceConfig ¶ added in v1.5.2
DominanceConfig is the config options for the dominance command
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 ResetConfig ¶
ResetConfig is the config for the reset function
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 TablePrintOptions ¶ added in v1.5.2
type TablePrintOptions struct { SortBy string SortDesc bool HumanReadable bool Format string Filter []string }
TablePrintOptions are options for ascii table output.
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
- dominance.go
- events.go
- favorites.go
- help.go
- keybindings.go
- layout.go
- list.go
- marketbar.go
- navigation.go
- portfolio.go
- price.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. |