Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version string // git tag ... GitCommit string // git rev-parse --short HEAD GoVersion string // go version BuildTime string // when the executable was built OsArch string // uname -s -m )
set at compile time with
-ldflags="-X 'github.com/mmbros/quotes/cmd.Version=x.y.z' -X 'github.com/mmbros/quotes/cmd.GitCommit=...'"
Functions ¶
Types ¶
type Config ¶
type Config struct { Database string `json:"database,omitempty"` Workers int `json:"workers,omitempty"` Proxy string `json:"proxy,omitempty"` Proxies map[string]string `json:"proxies,omitempty"` Sources map[string]*sourceItem `json:"sources,omitempty"` Isins map[string]*isinItem `json:"isins,omitempty"` Mode string `json:"mode,omitempty"` // contains filtered or unexported fields }
Config is ...
func NewConfig ¶
func NewConfig(cfi *configfile.SourceInfo, flags *Flags, allSources []string) (*Config, error)
func (*Config) SourceIsinsList ¶
func (cfg *Config) SourceIsinsList() []*quotes.SourceIsins
SourceIsinsList ... If no sources, returns a list with zero items (it does not returns nil). NOTE: it assumes all isins and sources are enabled
type Flags ¶
type Flags struct {
// contains filtered or unexported fields
}
func (*Flags) Appname ¶
Appname returns the app name from the fullname of the command
Example:
fullname = "app cmd sub-cmd sub-sub-cmd" output = "app"
func (*Flags) IsPassed ¶
IsPassed checks if the flag was passed in the command-line arguments. names is a string that contains the comma separated aliases of the flag.
Click to show internal directories.
Click to hide internal directories.