config

package
v0.0.0-...-cddd04e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Hint = `Run dcrextdata < --http > to start http server or dcrextdata < --help > for help.`

	// log levels
	TraceLogLevel   = "trace"
	DebugLogLevel   = "debug"
	InfoLogLevel    = "info"
	WarningLogLevel = "warning"
	ErrorLogLevel   = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandLineOptions

type CommandLineOptions struct {
	Reset      bool   `short:"R" long:"reset" description:"Drop all database tables and start over"`
	ResetCache bool   `short:"E" long:"reset-cache" description:"Drop all database tables used in storing computed cache data"`
	ConfigFile string `short:"C" long:"configfile" description:"Path to Configuration file"`
	HttpMode   string `long:"http" description:"Launch http server"`
}

CommandLineOptions holds the top-level options/flags that are displayed on the command-line menu

type CommunityStatOptions

type CommunityStatOptions struct {
	// Community stat
	DisableCommunityStat bool     `long:"disablecommstat" description:"Disables periodic community stat collection"`
	RedditStatInterval   int64    `long:"redditstatinterval" description:"Collection interval for Reddit community stat"`
	Subreddit            []string `long:"subreddit" description:"List of subreddit for community stat collection"`
	TwitterHandles       []string `long:"twitterhandle" description:"List of twitter handles community stat collection"`
	TwitterStatInterval  int      `long:"twitterstatinterval" description:"Number of minutes between Twitter stat collection"`
	GithubRepositories   []string `long:"githubrepository" description:"List of Github repositories to track"`
	GithubStatInterval   int      `long:"githubstatinterval" description:"Number of minutes between Github stat collection"`
	YoutubeChannelName   []string `long:"youtubechannelname" description:"List of Youtube channel names to be tracked"`
	YoutubeChannelId     []string `long:"youtubechannelid" description:"List of Youtube channel ID to be tracked"`
	YoutubeStatInterval  int      `long:"youtubestatinterval" description:"Number of minutes between Youtube stat collection"`
	YoutubeDataApiKey    string   `long:"youtubedataapikey" description:"Youtube data API key gotten from google developer console"`
}

type Config

type Config struct {
	ConfigFileOptions
	CommandLineOptions
}

func LoadConfig

func LoadConfig() (*Config, []string, error)

type ConfigFileOptions

type ConfigFileOptions struct {
	// General application behaviour
	LogFile  string `short:"L" long:"logfile" description:"File name of the log file"`
	LogLevel string `long:"loglevel" description:"Logging level {trace, debug, info, warn, error, critical}"`
	Quiet    bool   `short:"q" long:"quiet" description:"Easy way to set debuglevel to error"`
	CacheDir string `long:"cachedir" description:"The directory for store cache data"`

	// Postgresql Configuration
	DBHost string `long:"dbhost" description:"Database host"`
	DBPort string `long:"dbport" description:"Database port"`
	DBUser string `long:"dbuser" description:"Database username"`
	DBPass string `long:"dbpass" description:"Database password"`
	DBName string `long:"dbname" description:"Database name"`

	// Http Server
	HTTPHost string `long:"httphost" description:"HTTP server host address or IP when running godcr in http mode."`
	HTTPPort string `long:"httpport" description:"HTTP server port when running godcr in http mode."`

	// pprof
	Cpuprofile string `long:"cpuprofile" description:"write cpu profile to file"`
	Memprofile string `long:"memprofile" description:"write memory profile to file"`

	// Exchange collector
	DisableExchangeTicks bool     `long:"disablexcticks" description:"Disables collection of ticker data from exchanges"`
	DisabledExchanges    []string `long:"disableexchange" description:"Disable data collection for this exchange"`

	// PoW collector
	DisablePow   bool     `long:"disablepow" description:"Disables collection of data for pows"`
	DisabledPows []string `long:"disabledpow" description:"Disable data collection for this Pow"`
	PowInterval  int64    `long:"powI" description:"Collection interval for Pow"`

	// VSP
	DisableVSP  bool  `long:"disablevsp" description:"Disables periodic voting service pool status collection"`
	VSPInterval int64 `long:"vspinterval" description:"Collection interval for pool status collection"`

	// Mempool
	DisableMempool  bool    `long:"disablemempool" description:"Disable mempool data collection"`
	MempoolInterval float64 `long:"mempoolinterval" description:"The duration of time between mempool collection"`
	DcrdRpcServer   string  `long:"dcrdrpcserver" description:"Dcrd rpc server host"`
	DcrdNetworkType string  `long:"dcrdnetworktype" description:"Dcrd rpc network type"`
	DcrdRpcUser     string  `long:"dcrdrpcuser" description:"Your Dcrd rpc username"`
	DcrdRpcPassword string  `long:"dcrdrpcpassword" description:"Your Dcrd rpc password"`
	DisableTLS      bool    `long:"dcrdisabletls" description:"DisableTLS specifies whether transport layer security should be disabled"`

	// sync
	DisableSync   bool     `long:"disablesync" description:"Disables data sharing operation"`
	SyncInterval  int      `long:"syncinterval" description:"The number of minuets between sync operations"`
	SyncSources   []string `long:"syncsource" description:"Address of remote instance to sync data from"`
	SyncDatabases []string `long:"syncdatabase" description:"Database to sync remote data to"`

	// charts
	EnableChartCache bool `long:"enablechartcache" description:"Enable chart data caching"`
	ChartsCacheDump  string

	CommunityStatOptions
	NetworkSnapshotOptions
}

type NetworkSnapshotOptions

type NetworkSnapshotOptions struct {
	DisableNetworkSnapshot   bool   `long:"disablesnapshot" description:"Disable network snapshot"`
	SnapshotInterval         int    `long:"snapshotinterval" description:"The number of minutes between snapshot (default 5)"`
	MaxPeerConnectionFailure int    `long:"maxPeerConnectionFailure" description:"Number of failed connection before a pair is marked a dead"`
	Seeder                   string `short:"s" long:"seeder" description:"IP address of a working node"`
	SeederPort               uint16 `short:"p" long:"seederport" description:"Port of a working node"`
	IpStackAccessKey         string `long:"ipStackAccessKey" description:"IP stack access key https://ipstack.com/"`
	IpLocationProvidingPeer  string `long:"ipLocationProvidingPeer" description:"An optional peer address for getting IP info"`
	TestNet                  bool   `long:"testnet" description:"Use testnet"`
}

Jump to

Keyboard shortcuts

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