config

package
v0.0.0-...-d3c47bb Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2015 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Overview

Package config takes care of the configuration file parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Database DatabaseConfig `json:"database"`
	Features FeaturesConfig `json:"features"`
}

Config is the main configuration structure.

func ReadConfig

func ReadConfig(path string) (*Config, error)

ReadConfig reads a JSON formatted configuration file, verifies the values of the configuration parameters and fills the Config structure.

type DatabaseConfig

type DatabaseConfig struct {
	HostName string `json:"hostname"`
	Port     int    `json:"port"`
	UserName string `json:"username"`
	Password string `json:"password"`
	DBName   string `json:"dbname"`

	// Can take values: disable, require, verify-ca or verify-full
	SSLMode string `json:"ssl_mode"`
}

DatabaseConfig is a configuration for PostgreSQL database connection information

type FeaturesConfig

type FeaturesConfig struct {
	AverageForks       bool `json:"average_forks"`
	AverageStars       bool `json:"average_stars"`
	CommitsCount       bool `json:"commits_count"`
	ContributionsCount bool `json:"contributions_count"`
	FollowersCount     bool `json:"followers_count"`
	Hireable           bool `json:"hireable"`
}

FeaturesConfig is used to specify some which features to compute.

Jump to

Keyboard shortcuts

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