Documentation ¶
Overview ¶
Package config provides data structures for Application configurations.
Index ¶
- type CassandraConfig
- type CassandraDBConfig
- type EmailConfig
- type GeneralConfig
- type PGDBConfig
- func (dbconf *PGDBConfig) GetHost(clusterID int64) *sqlx.DB
- func (dbconf *PGDBConfig) GetTSCheck(clusterID int64) *sqlx.DB
- func (dbconf *PGDBConfig) GetTSEvent(clusterID int64) *sqlx.DB
- func (dbconf *PGDBConfig) GetTSLog(clusterID int64) *sqlx.DB
- func (dbconf *PGDBConfig) GetTSMetric(clusterID int64) *sqlx.DB
- type PostgreSQLPerClusterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CassandraConfig ¶
type CassandraDBConfig ¶
type CassandraDBConfig struct { TSMetric *gocql.ClusterConfig TSMetricSession *gocql.Session TSLog *gocql.ClusterConfig TSLogSession *gocql.Session TSEvent *gocql.ClusterConfig TSEventSession *gocql.Session }
CassandraDBConfig stores all database configuration data.
func NewCassandraDBConfig ¶
func NewCassandraDBConfig(generalConfig GeneralConfig) (*CassandraDBConfig, error)
NewCassandraDBConfig connects to all the databases and returns them in CassandraDBConfig instance.
type EmailConfig ¶
type EmailConfig struct { From string SubjectPrefix string Host string Port int Username string Password string Identity string }
EmailConfig stores all email configuration data.
type GeneralConfig ¶
type GeneralConfig struct { Addr string LogLevel string CookieSecret string RequestShutdownTimeout string EnablePeriodicPruneJobs bool JustAPI bool VIPAddr string VIPProtocol string PostgreSQL struct { DSN string MaxOpenConnections int64 } LocalAgent struct { GraphiteTCPPort string ReportMetricsInterval string } RateLimiters struct { PostSignup int GeneralAPI int } HTTPS struct { CertFile string KeyFile string } MessageBus struct { URL string Peers []string } Hosts struct { PostgreSQL PostgreSQLPerClusterConfig } Metrics struct { PostgreSQL PostgreSQLPerClusterConfig `toml:",omitempty"` Cassandra CassandraConfig `toml:",omitempty"` DataRetention int } Events struct { PostgreSQL PostgreSQLPerClusterConfig `toml:",omitempty"` Cassandra CassandraConfig `toml:",omitempty"` DataRetention int } Logs struct { PostgreSQL PostgreSQLPerClusterConfig `toml:",omitempty"` Cassandra CassandraConfig `toml:",omitempty"` DataRetention int } Checks struct { Email *EmailConfig SMSEmailGateway map[string]string PostgreSQL PostgreSQLPerClusterConfig DataRetention int } Email *EmailConfig }
GeneralConfig stores all configuration data.
func NewGeneralConfig ¶
func NewGeneralConfig(configDir string) (config GeneralConfig, err error)
NewGeneralConfig is the constructor for GeneralConfig.
func (GeneralConfig) GetEventsDBType ¶
func (conf GeneralConfig) GetEventsDBType() string
func (GeneralConfig) GetLogsDBType ¶
func (conf GeneralConfig) GetLogsDBType() string
func (GeneralConfig) GetMetricsDBType ¶
func (conf GeneralConfig) GetMetricsDBType() string
type PGDBConfig ¶
type PGDBConfig struct { Core *sqlx.DB Host *sqlx.DB HostByClusterID map[int64]*sqlx.DB TSMetric *sqlx.DB TSMetricByClusterID map[int64]*sqlx.DB TSEvent *sqlx.DB TSEventByClusterID map[int64]*sqlx.DB TSLog *sqlx.DB TSLogByClusterID map[int64]*sqlx.DB TSCheck *sqlx.DB TSCheckByClusterID map[int64]*sqlx.DB }
PGDBConfig stores all database configuration data.
func NewPGDBConfig ¶
func NewPGDBConfig(generalConfig GeneralConfig) (*PGDBConfig, error)
NewPGDBConfig connects to all the databases and returns them in PGDBConfig instance.
func (*PGDBConfig) GetTSCheck ¶
func (dbconf *PGDBConfig) GetTSCheck(clusterID int64) *sqlx.DB
func (*PGDBConfig) GetTSEvent ¶
func (dbconf *PGDBConfig) GetTSEvent(clusterID int64) *sqlx.DB
func (*PGDBConfig) GetTSMetric ¶
func (dbconf *PGDBConfig) GetTSMetric(clusterID int64) *sqlx.DB
Click to show internal directories.
Click to hide internal directories.