types

package
v0.0.0-...-8276e37 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: NCSA Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	List struct {
		Providers bool
	}
	Providers     string
	Coins         string
	Fiats         string
	LiveCoinWatch struct {
		APIKey string
	}
	DuckDB struct {
		File    string
		Table   string
		Enabled bool
	}
	QuestDB struct {
		Host    string
		Port    uint16
		Table   string
		Timeout uint16
		Enabled bool
	}
	SQLite3 struct {
		File    string
		Table   string
		Enabled bool
	}
	Pushover struct {
		Token        string
		User         string
		IncludeLinks bool
		Enabled      bool
	}
	Disable struct {
		DuckDB   bool
		QuestDB  bool
		SQLite3  bool
		Pushover bool
	}
	Quiet                bool
	CompactOutput        bool
	VeryCompactOutput    bool
	PortfolioValueTop    bool
	PortfolioValueBottom bool
}

AppConfig is used to store application configuration.

type ExchangeRate

type ExchangeRate struct {
	// Provider contains the name of the provider from which the exchange rate was retrieved.
	Provider string
	// Market contains the market that was used for retrieving the exchange rate.
	Market string
	// ProviderWithMarket is the combination of Provider/Market.
	ProviderWithMarket string
	// AsOf contains the information when the exchange rate was retrieved.
	AsOf time.Time
	// Coin contains the common symbol of the coin.
	Coin string
	// Owned contains the amount of Coin owned.
	Owned float64
	// Fiat contains the common symbol of the fiat.
	Fiat string
	// Rate is the exchange rate "1 Coin = Rate Fiat".
	Rate float64
	// Error is used to convey possible errors.
	Error error
}

ExchangeRate represents a single exchange rate.

func (*ExchangeRate) String

func (r *ExchangeRate) String() string

String returns the ExchangeRate in a printable string representation.

func (*ExchangeRate) StringCompact

func (r *ExchangeRate) StringCompact() string

StringCompact is a compact variant of String(), omitting time information.

func (*ExchangeRate) StringVeryCompact

func (r *ExchangeRate) StringVeryCompact() string

StringVeryCompact is a very compact variant of String(), omitting time and provider information.

type ExchangeRates

type ExchangeRates struct {
	Mutex sync.Mutex
	Rates []ExchangeRate
}

ExchangeRates is a multi-threading-safe list of multiple ExchangeRate objects.

func (*ExchangeRates) Sort

func (r *ExchangeRates) Sort()

Sort sorts the list of ExchangeRate objects by Coin-Fiat-Provider-Market.

type PushoverReply

type PushoverReply struct {
	User    string   `json:"user"`
	Errors  []string `json:"errors"`
	Status  int      `json:"status"`
	Request string   `json:"request"`
}

PushoverReply encapsulates an answer from the Pushover API.

Jump to

Keyboard shortcuts

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