Documentation ¶
Overview ¶
Package config provides the configuration for Janus. All configurations should be set in environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppdashTracing ¶
type AppdashTracing struct { DSN string `envconfig:"TRACING_APPDASH_DSN"` URL string `envconfig:"TRACING_APPDASH_URL"` }
AppdashTracing holds the Appdash tracing configuration
type Credentials ¶
type Credentials struct { // Algorithm defines admin JWT signing algorithm. // Currently the following algorithms are supported: HS256, HS384, HS512. Algorithm string `envconfig:"ALGORITHM"` Secret string `envconfig:"SECRET"` JanusAdminTeam string `envconfig:"JANUS_ADMIN_TEAM"` Github Github Basic Basic }
Credentials represents the credentials that are going to be used by admin JWT configuration
type Database ¶
type Database struct {
DSN string `envconfig:"DATABASE_DSN"`
}
Database holds the configuration for a database
type Github ¶
type Github struct { Organizations []string `envconfig:"GITHUB_ORGANIZATIONS"` Teams map[string]string `envconfig:"GITHUB_TEAMS"` }
Github holds the github configurations
func (*Github) IsConfigured ¶
IsConfigured checks if github is enabled
type GoogleCloudTracing ¶
type GoogleCloudTracing struct { ProjectID string `envconfig:"TRACING_GC_PROJECT_ID"` Email string `envconfig:"TRACING_GC_EMAIL"` PrivateKey string `envconfig:"TRACING_GC_PRIVATE_KEY"` PrivateKeyID string `envconfig:"TRACING_GC_PRIVATE_ID"` }
GoogleCloudTracing holds the Google Application Default Credentials
type Prometheus ¶
type Prometheus struct { Enabled bool `envconfig:"PROMETHEUS_ENABLED"` MetricPath string `envconfig:"PROMETHEUS_METRIC_PATH"` }
Prometheus represents prometheus integration configuration
type Specification ¶
type Specification struct { Port int `envconfig:"PORT"` Debug bool `envconfig:"DEBUG"` GraceTimeOut int64 `envconfig:"GRACE_TIMEOUT"` MaxIdleConnsPerHost int `envconfig:"MAX_IDLE_CONNS_PER_HOST"` BackendFlushInterval time.Duration `envconfig:"BACKEND_FLUSH_INTERVAL"` CloseIdleConnsPeriod time.Duration `envconfig:"CLOSE_IDLE_CONNS_PERIOD"` Log logging.LogConfig Web Web Database Database Storage Storage Stats Stats Tracing Tracing TLS TLS Prometheus Prometheus }
Specification for basic configurations
func LoadEnv ¶
func LoadEnv() (*Specification, error)
LoadEnv loads configuration from environment variables
type Stats ¶
type Stats struct { DSN string `envconfig:"STATS_DSN"` Prefix string `envconfig:"STATS_PREFIX"` IDs string `envconfig:"STATS_IDS"` AutoDiscoverThreshold uint `envconfig:"STATS_AUTO_DISCOVER_THRESHOLD"` AutoDiscoverWhiteList []string `envconfig:"STATS_AUTO_DISCOVER_WHITE_LIST"` ErrorsSection string `envconfig:"STATS_ERRORS_SECTION"` }
Stats holds the configuration for stats
type Storage ¶
type Storage struct {
DSN string `envconfig:"STORAGE_DSN"`
}
Storage holds the configuration for a storage
type TLS ¶
type TLS struct { Port int `envconfig:"PORT"` CertFile string `envconfig:"CERT_PATH"` KeyFile string `envconfig:"KEY_PATH"` Redirect bool `envconfig:"REDIRECT"` }
TLS represents the TLS configurations
type Tracing ¶
type Tracing struct { GoogleCloudTracing GoogleCloudTracing `mapstructure:"googleCloud"` AppdashTracing AppdashTracing `mapstructure:"appdash"` }
Tracing represents the distributed tracing configuration
func (Tracing) IsAppdashEnabled ¶
IsAppdashEnabled checks if appdash is enabled
func (Tracing) IsGoogleCloudEnabled ¶
IsGoogleCloudEnabled checks if google cloud is enabled