config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2015 License: BSD-3-Clause Imports: 4 Imported by: 3

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"`
	Data     DataConfig      `json:"data"`
}

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 DataConfig

type DataConfig struct {
	// TmpDir can be used to specify a temporary working directory. If
	// left unspecified, the default system temporary directory will be used.
	// If you have a ramdisk, you are advised to use it here.
	TmpDir string `json:"tmp_dir"`

	// TmpDirFileSizeLimit can be used to specify the maximum size in GB of an
	// object to be temporarily placed in TmpDir for processing. Files of size
	// larger than this value will not be processed in TmpDir.
	TmpDirFileSizeLimit float64 `json:"tmp_dir_file_size_limit"`

	CommitDeltas  bool `json:"commit_deltas"`
	CommitPatches bool `json:"commit_patches"`
}

DataConfig is used to specify some data to retrieve or not.

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"`

	// CommitsPerTransaction is useful to set how many commits to insert into
	// the database per transaction. Note that this option is only useful if
	// commit deltas are NOT inserted as well. Defaults to 1000000.
	CommitsPerTransaction uint `json:"commits_per_transaction"`
}

DatabaseConfig is a configuration for PostgreSQL database connection information

Jump to

Keyboard shortcuts

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