cointop

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const CoinGecko = "coingecko"

CoinGecko is API choice

View Source
const CoinMarketCap = "coinmarketcap"

CoinMarketCap is API choice

View Source
const CoinsView = "coins"

CoinsView is coins table constant

View Source
const FavoritesView = "favorites"

FavoritesView is favorites table constant

View Source
const PortfolioView = "portfolio"

PortfolioView is portfolio table constant

View Source
const PriceAlertsView = "price_alerts"

PriceAlertsView is price alerts table constant

Variables

View Source
var ArrowDown = "▼"

ArrowDown is down arrow unicode character

View Source
var ArrowUp = "▲"

ArrowUp is up arrow unicode character

View Source
var BgColorschemeColorsMap = map[string]fcolor.Attribute{
	"black":   fcolor.BgBlack,
	"blue":    fcolor.BgBlue,
	"cyan":    fcolor.BgCyan,
	"green":   fcolor.BgGreen,
	"magenta": fcolor.BgMagenta,
	"red":     fcolor.BgRed,
	"white":   fcolor.BgWhite,
	"yellow":  fcolor.BgYellow,
}
View Source
var CryptocurrencyNames = map[string]string{
	"BTC": "Bitcoin",
	"ETH": "Ethereum",
}

CryptocurrencyNames is a map of cryptocurrency symbols to name

View Source
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$",
	"UAH": "₴",
	"USD": "$",
	"VND": "₫",
	"ZAR": "R",
}

CurrencySymbolMap is map of fiat currency symbols to names. Keep these in alphabetical order.

View Source
var DefaultCacheDir = filecache.DefaultCacheDir

DefaultCacheDir ...

View Source
var DefaultChartRange = "1Y"

DefaultChartRange ...

View Source
var DefaultCoinTableHeaders = []string{
	"rank",
	"name",
	"symbol",
	"price",
	"1h_change",
	"24h_change",
	"7d_change",
	"24h_volume",
	"market_cap",
	"available_supply",
	"total_supply",
	"last_updated",
}

DefaultCoinTableHeaders are the default coin table header columns

View Source
var DefaultColors = `` /* 1611-byte string literal not displayed */

DefaultColors is the default color scheme

View Source
var DefaultColorsDir = fmt.Sprintf("%s/colors", DefaultConfigFilepath)

DefaultColorsDir ...

View Source
var DefaultColorscheme = "cointop"

DefaultColorscheme ...

View Source
var DefaultConfigFilepath = pathutil.NormalizePath(":PREFERRED_CONFIG_HOME:/cointop/config.toml")

DefaultConfigFilepath ...

View Source
var DefaultCurrency = "USD"

DefaultCurrency ...

View Source
var DefaultMaxPages uint = 35

MaxPages

View Source
var DefaultPerPage uint = 100

DefaultPerPage ...

View Source
var DefaultPortfolioTableHeaders = []string{
	"rank",
	"name",
	"symbol",
	"price",
	"holdings",
	"balance",
	"1h_change",
	"24h_change",
	"7d_change",
	"percent_holdings",
	"last_updated",
}

DefaultPortfolioTableHeaders are the default portfolio table header columns

View Source
var DefaultSortBy = "rank"

DefaultSortBy ...

View Source
var ErrCoinNameOrSymbolRequired = errors.New("coin name or symbol is required")

ErrCoinNameOrSymbolRequired is error for when coin name or symbol is required

View Source
var ErrInvalidAPIChoice = errors.New("invalid API choice")

ErrInvalidAPIChoice is error for invalid API choice

View Source
var ErrInvalidPriceAlert = errors.New("invalid price alert value")

ErrInvalidPriceAlert is error for invalid price alert value

View Source
var FgColorschemeColorsMap = map[string]fcolor.Attribute{
	"black":   fcolor.FgBlack,
	"blue":    fcolor.FgBlue,
	"cyan":    fcolor.FgCyan,
	"green":   fcolor.FgGreen,
	"magenta": fcolor.FgMagenta,
	"red":     fcolor.FgRed,
	"white":   fcolor.FgWhite,
	"yellow":  fcolor.FgYellow,
}
View Source
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",
	"UAH": "Ukrainian hryvnia",
	"USD": "US Dollar",
	"VND": "Vietnamese Dong",
	"ZAR": "South African Rand",
}

FiatCurrencyNames is a mpa of currency symbols to names. Keep these in alphabetical order.

View Source
var FilePerm = os.FileMode(0644)

FilePerm is the default file permissions

View Source
var GocuiColorschemeColorsMap = map[string]gocui.Attribute{
	"black":   gocui.ColorBlack,
	"blue":    gocui.ColorBlue,
	"cyan":    gocui.ColorCyan,
	"green":   gocui.ColorGreen,
	"magenta": gocui.ColorMagenta,
	"red":     gocui.ColorRed,
	"white":   gocui.ColorWhite,
	"yellow":  gocui.ColorYellow,
}
View Source
var HeaderColumns = map[string]*HeaderColumn{
	"rank": &HeaderColumn{
		Slug:       "rank",
		Label:      "[r]ank",
		PlainLabel: "rank",
	},
	"name": &HeaderColumn{
		Slug:       "name",
		Label:      "[n]ame",
		PlainLabel: "name",
	},
	"symbol": &HeaderColumn{
		Slug:       "symbol",
		Label:      "[s]ymbol",
		PlainLabel: "symbol",
	},
	"target_price": &HeaderColumn{
		Slug:       "target_price",
		Label:      "[t]target price",
		PlainLabel: "target price",
	},
	"price": &HeaderColumn{
		Slug:       "price",
		Label:      "[p]rice",
		PlainLabel: "price",
	},
	"frequency": &HeaderColumn{
		Slug:       "frequency",
		Label:      "frequency",
		PlainLabel: "frequency",
	},
	"holdings": &HeaderColumn{
		Slug:       "holdings",
		Label:      "[h]oldings",
		PlainLabel: "holdings",
	},
	"balance": &HeaderColumn{
		Slug:       "balance",
		Label:      "[b]alance",
		PlainLabel: "balance",
	},
	"market_cap": &HeaderColumn{
		Slug:       "market_cap",
		Label:      "[m]arket cap",
		PlainLabel: "market cap",
	},
	"24h_volume": &HeaderColumn{
		Slug:       "24h_volume",
		Label:      "24H [v]olume",
		PlainLabel: "24H volume",
	},
	"1h_change": &HeaderColumn{
		Slug:       "1h_change",
		Label:      "[1]H%",
		PlainLabel: "1H%",
	},
	"24h_change": &HeaderColumn{
		Slug:       "24h_change",
		Label:      "[2]4H%",
		PlainLabel: "24H%",
	},
	"7d_change": &HeaderColumn{
		Slug:       "7d_change",
		Label:      "[7]D%",
		PlainLabel: "7D%",
	},
	"30d_change": &HeaderColumn{
		Slug:       "30d_change",
		Label:      "[3]0D%",
		PlainLabel: "30D%",
	},
	"1y_change": &HeaderColumn{
		Slug:       "1y_change",
		Label:      "1[y]%",
		PlainLabel: "1Y%",
	},
	"total_supply": &HeaderColumn{
		Slug:       "total_supply",
		Label:      "[t]otal supply",
		PlainLabel: "total supply",
	},
	"available_supply": &HeaderColumn{
		Slug:       "available_supply",
		Label:      "[a]vailable supply",
		PlainLabel: "available supply",
	},
	"percent_holdings": &HeaderColumn{
		Slug:       "percent_holdings",
		Label:      "[%]holdings",
		PlainLabel: "%holdings",
	},
	"last_updated": &HeaderColumn{
		Slug:       "last_updated",
		Label:      "last [u]pdated",
		PlainLabel: "last updated",
	},
}

HeaderColumns are the header column widths

View Source
var HiddenBalanceChars = "********"

HiddenBalanceChars are the characters to show when hidding balances

View Source
var PossibleConfigPaths = []string{
	":PREFERRED_CONFIG_HOME:/cointop/config.toml",
	":HOME:/.config/cointop/config.toml",
	":HOME:/.config/cointop/config",
	":HOME:/.cointop/config",
	":HOME:/.cointop/config.toml",
}

PossibleConfigPaths are the the possible config file paths. NOTE: this is to support previous default config filepaths

View Source
var PriceAlertFrequencyMap = map[string]bool{
	"once":        true,
	"reoccurring": true,
}

PriceAlertFrequencyMap is map of valid price alert frequency values

View Source
var PriceAlertOperatorMap = map[string]string{
	">":  ">",
	"<":  "<",
	">=": "≥",
	"<=": "≤",
	"=":  "=",
}

PriceAlertOperatorMap is map of valid price alert operator symbols

View Source
var SupportedCoinTableHeaders = []string{
	"rank",
	"name",
	"symbol",
	"price",
	"1h_change",
	"24h_change",
	"7d_change",
	"30d_change",
	"1y_change",
	"24h_volume",
	"market_cap",
	"available_supply",
	"total_supply",
	"last_updated",
}

SupportedCoinTableHeaders are all the supported coin table header columns

View Source
var SupportedPortfolioTableHeaders = []string{
	"rank",
	"name",
	"symbol",
	"price",
	"holdings",
	"balance",
	"1h_change",
	"24h_change",
	"7d_change",
	"30d_change",
	"1y_change",
	"percent_holdings",
	"last_updated",
}

SupportedPortfolioTableHeaders are all the supported portfolio table header columns

Functions

func ActionsMap

func ActionsMap() map[string]bool

ActionsMap returns a map of all the available actions

func ChartRanges

func ChartRanges() []string

ChartRanges returns list of chart ranges available

func ChartRangesMap

func ChartRangesMap() map[string]time.Duration

ChartRangesMap returns map of chart range time ranges

func Clean

func Clean(config *CleanConfig) error

Clean removes cache files

func ColorschemeHelpString added in v1.5.2

func ColorschemeHelpString() string

ColorschemeHelpString ...

func CurrencySymbol

func CurrencySymbol(currency string) string

CurrencySymbol returns the symbol for the currency name

func DefaultShortcuts

func DefaultShortcuts() map[string]string

DefaultShortcuts is a map of the default shortcuts

func GetBytes

func GetBytes(key interface{}) ([]byte, error)

GetBytes returns the interface in bytes form

func GetCoinPrices added in v1.6.1

func GetCoinPrices(config *PricesConfig) ([]string, error)

GetCoinPrices returns the current price of the specified coins

func HexToAnsi

func HexToAnsi(h string) (uint8, bool)

HexToAnsi converts a hex color string to a uint8 ansi code

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 PrintPrices added in v1.6.1

func PrintPrices(config *PricesConfig) error

PrintPrices outputs the current price of the coins

func PrintVersion

func PrintVersion()

PrintVersion prints the version

func Reset

func Reset(config *ResetConfig) error

Reset removes configuration and cache files

func Slugify

func Slugify(s string) string

Slugify returns a slugified string

func TruncateString added in v1.6.0

func TruncateString(value string, maxLen int) string

TruncateString returns a truncated string

func Version

func Version() string

Version returns cointop version

Types

type APIKeys

type APIKeys struct {
	// contains filtered or unexported fields
}

APIKeys is api keys structure

type ChartView

type ChartView = ui.View

ChartView is structure for chart view

func NewChartView

func NewChartView() *ChartView

NewChartView returns a new chart view

type CleanConfig

type CleanConfig struct {
	Log      bool
	CacheDir string
}

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
	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

	Views *Views
	// contains filtered or unexported fields
}

Cointop cointop

func NewCointop

func NewCointop(config *Config) (*Cointop, error)

NewCointop initializes cointop

func (*Cointop) ActionExists

func (ct *Cointop) ActionExists(action string) bool

ActionExists returns true if action exists

func (*Cointop) ActivePriceAlerts added in v1.6.0

func (ct *Cointop) ActivePriceAlerts() []*PriceAlert

ActivePriceAlerts returns the active price alerts

func (*Cointop) ActivePriceAlertsLen added in v1.6.0

func (ct *Cointop) ActivePriceAlertsLen() int

ActivePriceAlertsLen returns the number of active price alerts

func (*Cointop) AllCoins

func (ct *Cointop) AllCoins() []*Coin

AllCoins returns a slice of all the coins

func (*Cointop) CacheAllCoinsSlugMap

func (ct *Cointop) CacheAllCoinsSlugMap()

CacheAllCoinsSlugMap writes the coins map to the memory and disk cache

func (*Cointop) CacheKey

func (ct *Cointop) CacheKey(key string) string

CacheKey returns cached value given key

func (*Cointop) CancelSearch

func (ct *Cointop) CancelSearch() error

CancelSearch closes the search field

func (*Cointop) ChartPoints

func (ct *Cointop) ChartPoints(symbol string, name string) error

ChartPoints calculates the the chart points

func (*Cointop) ChartWidth added in v1.6.0

func (ct *Cointop) ChartWidth() int

ChartWidth returns the width for chart

func (*Cointop) CheckPriceAlert added in v1.6.0

func (ct *Cointop) CheckPriceAlert(alert *PriceAlert) error

CheckPriceAlert checks the price alert

func (*Cointop) ClampedWidth

func (ct *Cointop) ClampedWidth() int

ClampedWidth returns the clamped width

func (*Cointop) ClearSyncMap added in v1.6.0

func (ct *Cointop) ClearSyncMap(syncMap sync.Map)

ClearSyncMap clears a sync.Map

func (*Cointop) CoinByID added in v1.6.4

func (ct *Cointop) CoinByID(id string) *Coin

CoinByID returns the coin struct given the ID

func (*Cointop) CoinByName added in v1.6.4

func (ct *Cointop) CoinByName(name string) *Coin

CoinByName returns the coin struct given the name

func (*Cointop) CoinBySymbol

func (ct *Cointop) CoinBySymbol(symbol string) *Coin

CoinBySymbol returns the coin struct given the symbol

func (*Cointop) CoinHoldings

func (ct *Cointop) CoinHoldings(coin *Coin) float64

CoinHoldings returns portfolio coin holdings

func (*Cointop) ConfigDirPath

func (ct *Cointop) ConfigDirPath() string

ConfigDirPath returns the config directory path

func (*Cointop) ConfigFilePath

func (ct *Cointop) ConfigFilePath() string

ConfigFilePath return the config file path

func (*Cointop) ConfigToToml added in v1.6.7

func (ct *Cointop) ConfigToToml() ([]byte, error)

ConfigToToml encodes config struct to TOML

func (*Cointop) CreateConfigIfNotExists

func (ct *Cointop) CreateConfigIfNotExists() error

CreateConfigIfNotExists creates config file if it doesn't exist

func (*Cointop) CreatePriceAlert added in v1.6.0

func (ct *Cointop) CreatePriceAlert() error

CreatePriceAlert sets price from inputed value

func (*Cointop) CurrencySymbol

func (ct *Cointop) CurrencySymbol() string

CurrencySymbol returns the symbol for the currency conversion

func (*Cointop) CurrentDisplayPage

func (ct *Cointop) CurrentDisplayPage() int

CurrentDisplayPage returns the current page in human readable format

func (*Cointop) CurrentPage

func (ct *Cointop) CurrentPage() int

CurrentPage returns the current page

func (*Cointop) CursorDown

func (ct *Cointop) CursorDown() error

CursorDown moves the cursor one row down

func (*Cointop) CursorDownOrNextPage

func (ct *Cointop) CursorDownOrNextPage() error

CursorDownOrNextPage moves the cursor down one row or goes to the next page if cursor is on the last row

func (*Cointop) CursorUp

func (ct *Cointop) CursorUp() error

CursorUp moves the cursor one row up

func (*Cointop) CursorUpOrPreviousPage

func (ct *Cointop) CursorUpOrPreviousPage() error

CursorUpOrPreviousPage moves the cursor up one row or goes to the previous page if cursor is on the first row

func (*Cointop) DeleteKeybinding added in v1.6.7

func (ct *Cointop) DeleteKeybinding(shortcutKey string) error

DeleteKeybinding ...

func (*Cointop) DeleteKeybindingMod added in v1.6.7

func (ct *Cointop) DeleteKeybindingMod(key interface{}, mod gocui.Modifier, view string) error

DeleteKeybindingMod ...

func (*Cointop) DoSearch

func (ct *Cointop) DoSearch() error

DoSearch triggers the search and sets views

func (*Cointop) EnlargeChart

func (ct *Cointop) EnlargeChart() error

EnlargeChart increases the chart height by one row

func (*Cointop) EnterKeyPressHandler added in v1.6.0

func (ct *Cointop) EnterKeyPressHandler() error

EnterKeyPressHandler is the key press handle for update menus

func (*Cointop) Exit

func (ct *Cointop) Exit()

Exit safely exits the program

func (*Cointop) FavoritesLen added in v1.6.3

func (ct *Cointop) FavoritesLen() int

FavoritesLen returns the number of favorite coins

func (*Cointop) FirstChartRange

func (ct *Cointop) FirstChartRange() error

FirstChartRange sets the chart to the first range option

func (*Cointop) FirstPage

func (ct *Cointop) FirstPage() error

FirstPage navigates to the first page

func (*Cointop) FormatPrice added in v1.6.6

func (ct *Cointop) FormatPrice(price float64) string

FormatPrice formats the coin price number of decimals and currency format

func (*Cointop) GetActiveTableHeaders added in v1.6.3

func (ct *Cointop) GetActiveTableHeaders() []string

GetActiveTableHeaders returns the list of active table headers

func (*Cointop) GetActiveTableSlice added in v1.6.3

func (ct *Cointop) GetActiveTableSlice() []*Coin

GetActiveTableSlice returns the rows slice for the active table

func (*Cointop) GetCoinRowIndex added in v1.6.3

func (ct *Cointop) GetCoinRowIndex(coin *Coin) int

GetCoinRowIndex returns the index of the coin in from the visible coins list

func (*Cointop) GetCoinsTable added in v1.6.0

func (ct *Cointop) GetCoinsTable() *table.Table

GetCoinsTable returns the table for diplaying the coins

func (*Cointop) GetCoinsTableHeaders added in v1.6.0

func (ct *Cointop) GetCoinsTableHeaders() []string

GetCoinsTableHeaders returns the coins table headers

func (*Cointop) GetColorschemeColors added in v1.6.7

func (ct *Cointop) GetColorschemeColors() (map[string]interface{}, error)

GetColorschemeColors loads colors from colorsheme file to struct

func (*Cointop) GetFavoritesSlice

func (ct *Cointop) GetFavoritesSlice() []*Coin

GetFavoritesSlice returns coin favorites as slice

func (*Cointop) GetFavoritesTableHeaders added in v1.6.0

func (ct *Cointop) GetFavoritesTableHeaders() []string

GetFavoritesTableHeaders returns the favorites table headers

func (*Cointop) GetGlobalCoinIndex added in v1.6.2

func (ct *Cointop) GetGlobalCoinIndex(coin *Coin) int

GetGlobalCoinIndex returns the index of the coin in from the gloal coins list

func (*Cointop) GetLastPortfolioRowIndex added in v1.6.3

func (ct *Cointop) GetLastPortfolioRowIndex() int

func (*Cointop) GetLastSelectedRowCoinIndex added in v1.6.3

func (ct *Cointop) GetLastSelectedRowCoinIndex() int

GetLastSelectedRowCoinIndex returns the index of the last selected row coin

func (*Cointop) GetListCount

func (ct *Cointop) GetListCount() int

GetListCount returns count of coins list

func (*Cointop) GetPortfolioCoinIndex added in v1.6.3

func (ct *Cointop) GetPortfolioCoinIndex(coin *Coin) int

GetPortfolioCoinIndex returns the row index of coin in portfolio

func (*Cointop) GetPortfolioSlice

func (ct *Cointop) GetPortfolioSlice() []*Coin

GetPortfolioSlice returns portfolio entries as a slice

func (*Cointop) GetPortfolioTable added in v1.6.0

func (ct *Cointop) GetPortfolioTable() *table.Table

GetPortfolioTable returns the table for displaying portfolio holdings

func (*Cointop) GetPortfolioTableHeaders added in v1.6.0

func (ct *Cointop) GetPortfolioTableHeaders() []string

GetPortfolioTableHeaders returns the portfolio table headers

func (*Cointop) GetPortfolioTotal

func (ct *Cointop) GetPortfolioTotal() float64

GetPortfolioTotal returns the total balance of portfolio entries

func (*Cointop) GetPriceAlertsTable added in v1.6.0

func (ct *Cointop) GetPriceAlertsTable() *table.Table

GetPriceAlertsTable returns the table for displaying alerts

func (*Cointop) GetPriceAlertsTableHeaders added in v1.6.0

func (ct *Cointop) GetPriceAlertsTableHeaders() []string

GetPriceAlertsTableHeaders returns the alerts table headers

func (*Cointop) GetSortColIndex

func (ct *Cointop) GetSortColIndex() int

GetSortColIndex gets the sort column index

func (*Cointop) GetTableCoinsSlice

func (ct *Cointop) GetTableCoinsSlice() []*Coin

GetTableCoinsSlice returns a slice of the table rows

func (*Cointop) GetTableColumnAlignLeft added in v1.6.0

func (ct *Cointop) GetTableColumnAlignLeft(header string) bool

GetTableColumnAlignLeft gets the column alignment direction for header

func (*Cointop) GetTableColumnWidth added in v1.6.0

func (ct *Cointop) GetTableColumnWidth(header string) int

GetTableColumnWidth gets the column width for header

func (*Cointop) GoToCoinRow added in v1.6.2

func (ct *Cointop) GoToCoinRow(coin *Coin) error

GoToCoinRow navigates to the row of the matched coin

func (*Cointop) GoToGlobalIndex

func (ct *Cointop) GoToGlobalIndex(idx int) error

GoToGlobalIndex navigates to the selected row index of all page rows

func (*Cointop) GoToPageRowIndex

func (ct *Cointop) GoToPageRowIndex(idx int) error

GoToPageRowIndex navigates to the selected row index of the page

func (*Cointop) Height added in v1.6.7

func (ct *Cointop) Height() int

Height returns window height

func (*Cointop) HideConvertMenu

func (ct *Cointop) HideConvertMenu() error

HideConvertMenu hides the convert menu view

func (*Cointop) HideHelp

func (ct *Cointop) HideHelp() error

HideHelp hides the help view

func (*Cointop) HideMenu added in v1.6.0

func (ct *Cointop) HideMenu() error

HideMenu hides the menu view

func (*Cointop) HidePortfolioUpdateMenu

func (ct *Cointop) HidePortfolioUpdateMenu() error

HidePortfolioUpdateMenu hides the portfolio update menu

func (*Cointop) HidePriceAlertsUpdateMenu added in v1.6.0

func (ct *Cointop) HidePriceAlertsUpdateMenu() error

HidePriceAlertsUpdateMenu hides the alerts update menu

func (*Cointop) HighlightRow

func (ct *Cointop) HighlightRow(pageRowIndex int) error

HighlightRow highlights the row at index within page

func (*Cointop) HighlightedPageRowIndex

func (ct *Cointop) HighlightedPageRowIndex() int

HighlightedPageRowIndex returns the index of page row of the highlighted row

func (*Cointop) HighlightedRowCoin

func (ct *Cointop) HighlightedRowCoin() *Coin

HighlightedRowCoin returns the coin at the index of the highlighted row

func (*Cointop) HighlightedRowIndex

func (ct *Cointop) HighlightedRowIndex() int

HighlightedRowIndex returns the index of the highlighted row within the per-page limit

func (*Cointop) InterfaceToFloat64 added in v1.6.0

func (ct *Cointop) InterfaceToFloat64(value interface{}) (float64, error)

InterfaceToFloat64 attempts to convert interface to float64

func (*Cointop) IsFavoritesVisible added in v1.6.0

func (ct *Cointop) IsFavoritesVisible() bool

IsFavoritesVisible returns true if favorites view is visible

func (*Cointop) IsFirstPage

func (ct *Cointop) IsFirstPage() bool

IsFirstPage returns true if cursor is on the first page

func (*Cointop) IsFirstRow

func (ct *Cointop) IsFirstRow() bool

IsFirstRow returns true if cursor is on first row

func (*Cointop) IsLastPage

func (ct *Cointop) IsLastPage() bool

IsLastPage returns true if cursor is on the last page

func (*Cointop) IsLastRow

func (ct *Cointop) IsLastRow() bool

IsLastRow returns true if cursor is on last row

func (*Cointop) IsPageFirstLine

func (ct *Cointop) IsPageFirstLine() bool

IsPageFirstLine returns true if the cursor is on the visible first row

func (*Cointop) IsPageLastLine

func (ct *Cointop) IsPageLastLine() bool

IsPageLastLine returns true if the cursor is on the visible last row

func (*Cointop) IsPageMiddleLine

func (ct *Cointop) IsPageMiddleLine() bool

IsPageMiddleLine returns true if the cursor is on the visible middle row

func (*Cointop) IsPortfolioVisible added in v1.6.0

func (ct *Cointop) IsPortfolioVisible() bool

IsPortfolioVisible returns true if portfolio view is visible

func (*Cointop) IsPriceAlertsVisible added in v1.6.0

func (ct *Cointop) IsPriceAlertsVisible() bool

IsPriceAlertsVisible returns true if alerts view is visible

func (*Cointop) IsRunning added in v1.5.2

func (ct *Cointop) IsRunning() bool

IsRunning returns true if cointop is running

func (*Cointop) IsSupportedCurrencyConversion added in v1.5.5

func (ct *Cointop) IsSupportedCurrencyConversion(convert string) bool

IsSupportedCurrencyConversion returns true if it's a supported currency conversion

func (*Cointop) Keyfn

func (ct *Cointop) Keyfn(fn func() error) func(g *gocui.Gui, v *gocui.View) error

Keyfn returns the keybinding function as a wrapped gocui view function

func (*Cointop) LastChartRange

func (ct *Cointop) LastChartRange() error

LastChartRange sets the chart to the last range option

func (*Cointop) LastPage

func (ct *Cointop) LastPage() error

LastPage navigates to the last page

func (*Cointop) MakeConfigDir added in v1.6.7

func (ct *Cointop) MakeConfigDir() error

ConfigPath return the config file path

func (*Cointop) MakeConfigFile added in v1.6.7

func (ct *Cointop) MakeConfigFile() error

MakeConfigFile creates a new config file

func (*Cointop) MouseLeftClick added in v1.6.0

func (ct *Cointop) MouseLeftClick() error

MouseLeftClick is called on mouse left click event

func (*Cointop) MouseMiddleClick added in v1.6.0

func (ct *Cointop) MouseMiddleClick() error

MouseMiddleClick is called on mouse middle click event

func (*Cointop) MouseRelease added in v1.6.0

func (ct *Cointop) MouseRelease() error

MouseRelease is called on mouse releae event

func (*Cointop) MouseRightClick added in v1.6.0

func (ct *Cointop) MouseRightClick() error

MouseRightClick is called on mouse right click event

func (*Cointop) MouseWheelDown added in v1.6.0

func (ct *Cointop) MouseWheelDown() error

MouseWheelDown is called on mouse wheel down event

func (*Cointop) MouseWheelUp added in v1.6.0

func (ct *Cointop) MouseWheelUp() error

MouseWheelUp is called on mouse wheel up event

func (*Cointop) NavigateFirstLine

func (ct *Cointop) NavigateFirstLine() error

NavigateFirstLine moves the cursor to the first row of the table

func (*Cointop) NavigateLastLine

func (ct *Cointop) NavigateLastLine() error

NavigateLastLine moves the cursor to the last row of the table

func (*Cointop) NavigatePageFirstLine

func (ct *Cointop) NavigatePageFirstLine() error

NavigatePageFirstLine moves the cursor to the visible first row of the table

func (*Cointop) NavigatePageMiddleLine

func (ct *Cointop) NavigatePageMiddleLine() error

NavigatePageMiddleLine moves the cursor to the visible middle row of the table

func (*Cointop) NextChartRange

func (ct *Cointop) NextChartRange() error

NextChartRange sets the chart to the next range option

func (*Cointop) NextPage

func (ct *Cointop) NextPage() error

NextPage navigates to the next page

func (*Cointop) Noop

func (ct *Cointop) Noop() error

Noop is a no-operation function

func (ct *Cointop) OpenLink() error

OpenLink opens the url in a browser

func (*Cointop) OpenSearch added in v1.6.7

func (ct *Cointop) OpenSearch() error

OpenSearch opens the search field

func (*Cointop) PageDown

func (ct *Cointop) PageDown() error

PageDown moves the cursor one page down

func (*Cointop) PageUp

func (ct *Cointop) PageUp() error

PageUp moves the cursor one page up

func (*Cointop) ParseConfig added in v1.6.7

func (ct *Cointop) ParseConfig() error

ParseConfig decodes the toml config file

func (*Cointop) ParseKeys

func (ct *Cointop) ParseKeys(s string) (interface{}, gocui.Modifier)

ParseKeys returns string keyboard key as gocui key type

func (*Cointop) ParsePriceAlertInput added in v1.6.0

func (ct *Cointop) ParsePriceAlertInput(value string) (string, float64, error)

ParsePriceAlertInput parses price alert input field value

func (*Cointop) PortfolioChart

func (ct *Cointop) PortfolioChart() error

PortfolioChart renders the portfolio chart

func (*Cointop) PortfolioEntriesCount

func (ct *Cointop) PortfolioEntriesCount() int

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

func (ct *Cointop) PortfolioEntryExists(c *Coin) bool

PortfolioEntryExists returns true if portfolio entry exists

func (*Cointop) PortfolioLen added in v1.6.3

func (ct *Cointop) PortfolioLen() int

PortfolioLen returns the number of portfolio entries

func (*Cointop) PrevChartRange

func (ct *Cointop) PrevChartRange() error

PrevChartRange sets the chart to the prevous range option

func (*Cointop) PrevPage

func (ct *Cointop) PrevPage() error

PrevPage navigates to the previous page

func (*Cointop) PrevPageTop

func (ct *Cointop) PrevPageTop() error

PrevPageTop navigates to the first row of the previous page

func (*Cointop) PriceAlertWatcher added in v1.6.0

func (ct *Cointop) PriceAlertWatcher() error

PriceAlertWatcher starts the price alert watcher

func (*Cointop) PrintHoldings24HChange added in v1.6.5

func (ct *Cointop) PrintHoldings24HChange(options *TablePrintOptions) error

PrintHoldings24HChange prints the total holdings amount

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) PrintHoldingsTotal added in v1.6.5

func (ct *Cointop) PrintHoldingsTotal(options *TablePrintOptions) error

PrintHoldingsTotal prints the total holdings amount

func (*Cointop) Quit

func (ct *Cointop) Quit() error

Quit quits the program

func (*Cointop) QuitView

func (ct *Cointop) QuitView() error

QuitView exists the current view

func (*Cointop) ReadAPIKeyFromStdin

func (ct *Cointop) ReadAPIKeyFromStdin(name string) (string, error)

ReadAPIKeyFromStdin reads the user inputed API from the stdin prompt

func (*Cointop) ReadAndParsePriceAlertInput added in v1.6.0

func (ct *Cointop) ReadAndParsePriceAlertInput() (string, float64, error)

ReadAndParsePriceAlertInput reads and parses price alert input field value

func (*Cointop) Refresh

func (ct *Cointop) Refresh() error

Refresh triggers a force refresh of coin data

func (*Cointop) RefreshAll

func (ct *Cointop) RefreshAll() error

RefreshAll triggers a force refresh of all data

func (*Cointop) RefreshPortfolioCoins added in v1.5.2

func (ct *Cointop) RefreshPortfolioCoins() error

RefreshPortfolioCoins refreshes portfolio entry coin data

func (ct *Cointop) RefreshRowLink() error

RefreshRowLink updates the row link in the statusbar

func (*Cointop) RefreshTable

func (ct *Cointop) RefreshTable() error

RefreshTable refreshes the table

func (*Cointop) RemovePortfolioEntry

func (ct *Cointop) RemovePortfolioEntry(coin string) error

RemovePortfolioEntry removes a portfolio entry

func (*Cointop) RemovePriceAlert added in v1.6.3

func (ct *Cointop) RemovePriceAlert(id string) error

RemovePriceAlert removes a price alert entry

func (*Cointop) RowChanged

func (ct *Cointop) RowChanged()

RowChanged is called when the row is updated

func (ct *Cointop) RowLink() string

RowLink returns the row url link

func (*Cointop) RowLinkShort

func (ct *Cointop) RowLinkShort() string

RowLinkShort returns a shortened version of the row url link

func (*Cointop) Run

func (ct *Cointop) Run() error

Run runs cointop

func (*Cointop) Save

func (ct *Cointop) Save() error

Save saves the cointop settings to the config file

func (*Cointop) SaveConfig

func (ct *Cointop) SaveConfig() error

SaveConfig writes settings to the config file

func (*Cointop) Search

func (ct *Cointop) Search(q string) error

Search performs the search and filtering

func (*Cointop) SelectedCoinName

func (ct *Cointop) SelectedCoinName() string

SelectedCoinName returns the selected coin name

func (*Cointop) SelectedCoinSymbol

func (ct *Cointop) SelectedCoinSymbol() string

SelectedCoinSymbol returns the selected coin symbol

func (*Cointop) SetActiveView

func (ct *Cointop) SetActiveView(v string) error

SetActiveView sets the active view

func (*Cointop) SetCurrencyConverstion added in v1.5.5

func (ct *Cointop) SetCurrencyConverstion(convert string) error

SetCurrencyConverstion sets the currency conversion

func (*Cointop) SetCurrencyConverstionFn

func (ct *Cointop) SetCurrencyConverstionFn(convert string) func() error

SetCurrencyConverstionFn sets the currency conversion function

func (*Cointop) SetKeybindingAction added in v1.6.7

func (ct *Cointop) SetKeybindingAction(shortcutKey string, action string) error

SetKeybindingAction maps a shortcut key to an action

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) SetKeybindings added in v1.6.7

func (ct *Cointop) SetKeybindings() error

SetKeybindings sets keyboard shortcut key bindings

func (*Cointop) SetPage

func (ct *Cointop) SetPage(page int) int

SetPage navigates to the selected page

func (*Cointop) SetPortfolioEntry

func (ct *Cointop) SetPortfolioEntry(coin string, holdings float64) error

SetPortfolioEntry sets a portfolio entry

func (*Cointop) SetPortfolioHoldings

func (ct *Cointop) SetPortfolioHoldings() error

SetPortfolioHoldings sets portfolio entry holdings from inputed value

func (*Cointop) SetPriceAlert added in v1.6.0

func (ct *Cointop) SetPriceAlert(coinName string, operator string, targetPrice float64) error

SetPriceAlert sets a price alert

func (*Cointop) SetSavingStatus

func (ct *Cointop) SetSavingStatus()

SetSavingStatus sets the saving indicator in the statusbar

func (*Cointop) SetSelectedView added in v1.6.0

func (ct *Cointop) SetSelectedView(viewName string)

SetSelectedView sets the active table view

func (*Cointop) SetTableColumnAlignLeft added in v1.6.0

func (ct *Cointop) SetTableColumnAlignLeft(header string, alignLeft bool)

SetTableColumnAlignLeft sets the column alignment direction for header

func (*Cointop) SetTableColumnWidth added in v1.6.0

func (ct *Cointop) SetTableColumnWidth(header string, width int)

SetTableColumnWidth sets the column width for header

func (*Cointop) SetTableColumnWidthFromString added in v1.6.0

func (ct *Cointop) SetTableColumnWidthFromString(header string, text string)

SetTableColumnWidthFromString sets the column width for header given size of string

func (*Cointop) SetupConfig

func (ct *Cointop) SetupConfig() error

SetupConfig loads config file

func (*Cointop) ShortenChart

func (ct *Cointop) ShortenChart() error

ShortenChart decreases the chart height by one row

func (*Cointop) ShowChartLoader

func (ct *Cointop) ShowChartLoader() error

ShowChartLoader shows chart loading indicator

func (*Cointop) ShowConvertMenu

func (ct *Cointop) ShowConvertMenu() error

ShowConvertMenu shows the convert menu view

func (*Cointop) ShowHelp

func (ct *Cointop) ShowHelp() error

ShowHelp shows the help view

func (*Cointop) ShowPortfolioUpdateMenu

func (ct *Cointop) ShowPortfolioUpdateMenu() error

ShowPortfolioUpdateMenu shows the portfolio update menu

func (*Cointop) ShowPriceAlertsAddMenu added in v1.6.0

func (ct *Cointop) ShowPriceAlertsAddMenu() error

ShowPriceAlertsAddMenu shows the alert add menu

func (*Cointop) ShowPriceAlertsUpdateMenu added in v1.6.0

func (ct *Cointop) ShowPriceAlertsUpdateMenu() error

ShowPriceAlertsUpdateMenu shows the alerts update menu

func (*Cointop) Size added in v1.6.7

func (ct *Cointop) Size() (int, int)

Size returns window width and height

func (*Cointop) Sort

func (ct *Cointop) Sort(sortBy string, desc bool, list []*Coin, renderHeaders bool)

Sort sorts the list of coins

func (*Cointop) SortAsc

func (ct *Cointop) SortAsc() error

SortAsc sorts list of coins in ascending order

func (*Cointop) SortDesc

func (ct *Cointop) SortDesc() error

SortDesc sorts list of coins in descending order

func (*Cointop) SortNextCol

func (ct *Cointop) SortNextCol() error

SortNextCol sorts the next column

func (*Cointop) SortPrevCol

func (ct *Cointop) SortPrevCol() error

SortPrevCol sorts the previous column

func (*Cointop) SortToggle

func (ct *Cointop) SortToggle(sortBy string, desc bool) error

SortToggle toggles the sort order

func (*Cointop) SortedSupportedCurrencyConversions

func (ct *Cointop) SortedSupportedCurrencyConversions() []string

SortedSupportedCurrencyConversions returns sorted list of supported currencies for conversion

func (*Cointop) Sortfn

func (ct *Cointop) Sortfn(sortBy string, desc bool) func(g *gocui.Gui, v *gocui.View) error

Sortfn returns the sort function as a wrapped gocui keybinding function

func (*Cointop) SupportedCryptoCurrencyConversions

func (ct *Cointop) SupportedCryptoCurrencyConversions() map[string]string

SupportedCryptoCurrencyConversions returns map of supported cryptocurrencies for conversion

func (*Cointop) SupportedCurrencyConversions

func (ct *Cointop) SupportedCurrencyConversions() map[string]string

SupportedCurrencyConversions returns a map of all supported currencies for conversion

func (*Cointop) SupportedFiatCurrencyConversions

func (ct *Cointop) SupportedFiatCurrencyConversions() map[string]string

SupportedFiatCurrencyConversions returns map of supported fiat currencies for conversion

func (*Cointop) TableCoinsLen added in v1.6.3

func (ct *Cointop) TableCoinsLen() int

TableCoinsLen returns the number of coins in coins table

func (*Cointop) TableRowsLen added in v1.6.0

func (ct *Cointop) TableRowsLen() int

TableRowsLen returns the number of table row entries

func (*Cointop) TableScrollLeft added in v1.6.0

func (ct *Cointop) TableScrollLeft() error

TableScrollLeft scrolls the table to the left

func (*Cointop) TableScrollRight added in v1.6.0

func (ct *Cointop) TableScrollRight() error

TableScrollRight scrolls the the table to the right

func (*Cointop) ToggleChartFullscreen added in v1.6.5

func (ct *Cointop) ToggleChartFullscreen() error

ToggleChartFullscreen toggles the chart fullscreen mode

func (*Cointop) ToggleCoinChart

func (ct *Cointop) ToggleCoinChart() error

ToggleCoinChart toggles between the global chart and the coin chart

func (*Cointop) ToggleConvertMenu

func (ct *Cointop) ToggleConvertMenu() error

ToggleConvertMenu toggles the convert menu view

func (*Cointop) ToggleFavorite

func (ct *Cointop) ToggleFavorite() error

ToggleFavorite toggles coin as favorite

func (*Cointop) ToggleFavorites added in v1.6.0

func (ct *Cointop) ToggleFavorites() error

ToggleFavorites toggles the favorites view

func (*Cointop) ToggleHelp

func (ct *Cointop) ToggleHelp() error

ToggleHelp toggles the help view

func (*Cointop) TogglePortfolio

func (ct *Cointop) TogglePortfolio() error

TogglePortfolio toggles the portfolio view

func (*Cointop) TogglePortfolioBalances added in v1.6.7

func (ct *Cointop) TogglePortfolioBalances() error

TogglePortfolioBalances toggles hide/show portfolio balances. Useful for keeping balances secret when sharing screen or taking screenshots.

func (*Cointop) TogglePortfolioUpdateMenu

func (ct *Cointop) TogglePortfolioUpdateMenu() error

TogglePortfolioUpdateMenu toggles the portfolio update menu

func (*Cointop) TogglePriceAlerts added in v1.6.0

func (ct *Cointop) TogglePriceAlerts() error

TogglePriceAlerts toggles the price alerts view

func (*Cointop) ToggleSelectedView added in v1.6.0

func (ct *Cointop) ToggleSelectedView(viewName string)

ToggleSelectedView toggles between current table view and last selected table view

func (*Cointop) ToggleShowFavorites

func (ct *Cointop) ToggleShowFavorites() error

ToggleShowFavorites shows the favorites view

func (*Cointop) ToggleShowPortfolio

func (ct *Cointop) ToggleShowPortfolio() error

ToggleShowPortfolio shows the portfolio view

func (*Cointop) ToggleTableFullscreen

func (ct *Cointop) ToggleTableFullscreen() error

ToggleTableFullscreen toggles the table fullscreen mode

func (*Cointop) TotalPages

func (ct *Cointop) TotalPages() int

TotalPages returns the number of total pages

func (*Cointop) TotalPagesDisplay

func (ct *Cointop) TotalPagesDisplay() int

TotalPagesDisplay returns the number of total pages in human readable format

func (*Cointop) TotalPerPage

func (ct *Cointop) TotalPerPage() int

TotalPerPage returns the number max rows per page

func (*Cointop) UpdateChart

func (ct *Cointop) UpdateChart() error

UpdateChart updates the chart view

func (*Cointop) UpdateCoins

func (ct *Cointop) UpdateCoins() error

UpdateCoins updates coins view

func (*Cointop) UpdateConvertMenu

func (ct *Cointop) UpdateConvertMenu() error

UpdateConvertMenu updates the convert menu

func (*Cointop) UpdateHelp

func (ct *Cointop) UpdateHelp()

UpdateHelp updates the help views

func (*Cointop) UpdateMarketbar

func (ct *Cointop) UpdateMarketbar() error

UpdateMarketbar updates the market bar view

func (*Cointop) UpdatePortfolioUpdateMenu

func (ct *Cointop) UpdatePortfolioUpdateMenu() error

UpdatePortfolioUpdateMenu updates the portfolio update menu view

func (*Cointop) UpdatePriceAlertsUpdateMenu added in v1.6.0

func (ct *Cointop) UpdatePriceAlertsUpdateMenu(isNew bool, coin *Coin) error

UpdatePriceAlertsUpdateMenu updates the alerts update menu view

func (*Cointop) UpdateStatusbar

func (ct *Cointop) UpdateStatusbar(s string) error

UpdateStatusbar updates the statusbar view

func (*Cointop) UpdateTable

func (ct *Cointop) UpdateTable() error

UpdateTable updates the table

func (*Cointop) UpdateTableHeader

func (ct *Cointop) UpdateTableHeader() error

UpdateTableHeader renders the table header

func (*Cointop) UpdateUI added in v1.6.0

func (ct *Cointop) UpdateUI(f func() error)

UpdateUI takes a callback which updates the view

func (*Cointop) ValidCoinsTableHeader added in v1.6.0

func (ct *Cointop) ValidCoinsTableHeader(name string) bool

ValidCoinsTableHeader returns true if it's a valid table header name

func (*Cointop) ValidPortfolioTableHeader added in v1.6.0

func (ct *Cointop) ValidPortfolioTableHeader(name string) bool

ValidPortfolioTableHeader returns the portfolio table headers

func (*Cointop) Version

func (ct *Cointop) Version() string

Version returns the cointop version

func (*Cointop) ViewWidth added in v1.6.0

func (ct *Cointop) ViewWidth(view string) int

ViewWidth returns view width

func (*Cointop) Width added in v1.6.7

func (ct *Cointop) Width() int

Width returns window width

type ColorCache added in v1.6.7

type ColorCache map[string]ISprintf

colorCache is a map of color string names to sprintf functions

type Colorscheme

type Colorscheme struct {
	// contains filtered or unexported fields
}

Colorscheme is the struct for colorscheme

func NewColorscheme

func NewColorscheme(colors ColorschemeColors) *Colorscheme

NewColorscheme ...

func (*Colorscheme) BaseBg

func (c *Colorscheme) BaseBg() gocui.Attribute

BaseBg ...

func (*Colorscheme) BaseFg

func (c *Colorscheme) BaseFg() gocui.Attribute

BaseFg ...

func (*Colorscheme) Chart

func (c *Colorscheme) Chart(a ...interface{}) string

Chart ...

func (*Colorscheme) Color added in v1.6.7

func (c *Colorscheme) Color(name string, a ...interface{}) string

func (*Colorscheme) Default added in v1.6.0

func (c *Colorscheme) Default(a ...interface{}) string

Default ...

func (*Colorscheme) GocuiBgColor added in v1.6.7

func (c *Colorscheme) GocuiBgColor(name string) gocui.Attribute

func (*Colorscheme) GocuiFgColor added in v1.6.7

func (c *Colorscheme) GocuiFgColor(name string) gocui.Attribute

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) Menu

func (c *Colorscheme) Menu(a ...interface{}) string

Menu ...

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) 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) TableRow

func (c *Colorscheme) TableRow(a ...interface{}) string

TableRow ...

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 ...

func (*Colorscheme) ToBgAttr added in v1.6.7

func (c *Colorscheme) ToBgAttr(v string) (fcolor.Attribute, bool)

func (*Colorscheme) ToBoldAttr added in v1.6.7

func (c *Colorscheme) ToBoldAttr(v bool) (fcolor.Attribute, bool)

toBoldAttr converts a boolean to an Attribute type

func (*Colorscheme) ToFgAttr added in v1.6.7

func (c *Colorscheme) ToFgAttr(v string) (fcolor.Attribute, bool)

func (*Colorscheme) ToGocuiAttr added in v1.6.7

func (c *Colorscheme) ToGocuiAttr(v string) (gocui.Attribute, bool)

toGocuiAttr converts a color string name to a gocui Attribute type

func (*Colorscheme) ToSprintf added in v1.6.7

func (c *Colorscheme) ToSprintf(name string) ISprintf

func (*Colorscheme) ToUnderlineAttr added in v1.6.7

func (c *Colorscheme) ToUnderlineAttr(v bool) (fcolor.Attribute, bool)

toUnderlineAttr converts a boolean to an Attribute type

type ColorschemeColors added in v1.6.7

type ColorschemeColors map[string]interface{}

ColorschemeColors is a map of color string names to Attribute types

type Config

type Config struct {
	APIChoice             string
	CacheDir              string
	ColorsDir             string
	Colorscheme           string
	ConfigFilepath        string
	CoinMarketCapAPIKey   string
	NoPrompts             bool
	HideMarketbar         bool
	HideChart             bool
	HideTable             bool
	HideStatusbar         bool
	HidePortfolioBalances bool
	NoCache               bool
	OnlyTable             bool
	OnlyChart             bool
	RefreshRate           *uint
	PerPage               uint
	MaxPages              uint
}

Config config options

type ConfigFileConfig added in v1.6.7

type ConfigFileConfig struct {
	Shortcuts         map[string]interface{} `toml:"shortcuts"`
	Favorites         map[string]interface{} `toml:"favorites"`
	Portfolio         map[string]interface{} `toml:"portfolio"`
	PriceAlerts       map[string]interface{} `toml:"price_alerts"`
	Currency          interface{}            `toml:"currency"`
	DefaultView       interface{}            `toml:"default_view"`
	DefaultChartRange interface{}            `toml:"default_chart_range"`
	CoinMarketCap     map[string]interface{} `toml:"coinmarketcap"`
	API               interface{}            `toml:"api"`
	Colorscheme       interface{}            `toml:"colorscheme"`
	RefreshRate       interface{}            `toml:"refresh_rate"`
	CacheDir          interface{}            `toml:"cache_dir"`
	Table             map[string]interface{} `toml:"table"`
}

ConfigFileConfig is the config file structure

type DominanceConfig added in v1.5.2

type DominanceConfig struct {
	Currency  string
	APIChoice string
}

DominanceConfig is the config options for the dominance command

type HeaderColumn added in v1.6.0

type HeaderColumn struct {
	Slug       string
	Label      string
	PlainLabel string
}

HeaderColumn is header column struct

type ISprintf

type ISprintf func(...interface{}) string

ISprintf is a sprintf interface

type InputView

type InputView = ui.View

InputView is structure for help view

func NewInputView

func NewInputView() *InputView

NewInputView returns a new help view

type MarketbarView

type MarketbarView = ui.View

MarketbarView is structure for marketbar view

func NewMarketbarView

func NewMarketbarView() *MarketbarView

NewMarketbarView returns a new marketbar view

type MenuView = ui.View

MenuView is structure for menu view

func NewMenuView added in v1.6.0

func NewMenuView() *MenuView

NewMenuView returns a new menu view

type Portfolio

type Portfolio struct {
	Entries map[string]*PortfolioEntry
}

Portfolio is portfolio structure

type PortfolioEntry

type PortfolioEntry struct {
	Coin     string
	Holdings float64
}

PortfolioEntry is portfolio entry

type PriceAlert added in v1.6.0

type PriceAlert struct {
	ID          string
	CoinName    string
	TargetPrice float64
	Operator    string
	Frequency   string
	CreatedAt   string
	Expired     bool
}

PriceAlert is price alert structure

type PriceAlerts added in v1.6.0

type PriceAlerts struct {
	Entries      []*PriceAlert
	SoundEnabled bool
}

PriceAlerts is price alerts structure

type PriceConfig

type PriceConfig struct {
	Coin      string
	Currency  string
	APIChoice string
}

PriceConfig is the config options for the coin price method

type PricesConfig added in v1.6.1

type PricesConfig struct {
	Coins     []string
	Currency  string
	APIChoice string
}

PricesConfig is the config options for the coin prices method

type ResetConfig

type ResetConfig struct {
	Log      bool
	CacheDir string
}

ResetConfig is the config for the reset function

type SearchFieldView

type SearchFieldView = ui.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 = ui.View

StatusbarView is structure for statusbar view

func NewStatusbarView

func NewStatusbarView() *StatusbarView

NewStatusbarView returns a new statusbar view

type TableHeaderView

type TableHeaderView = ui.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
	Cols             []string
	Convert          string
	NoHeader         bool
	PercentChange24H bool
	HideBalances     bool
}

TablePrintOptions are options for ascii table output.

type TableView

type TableView = ui.View

TableView is structure for table view

func NewTableView

func NewTableView() *TableView

NewTableView returns a new table view

type Views

type Views struct {
	Chart       *ChartView
	Table       *TableView
	TableHeader *TableHeaderView
	Marketbar   *MarketbarView
	SearchField *SearchFieldView
	Statusbar   *StatusbarView
	Menu        *MenuView
	Input       *InputView
}

Views are all views in cointop

Jump to

Keyboard shortcuts

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