api-server: github.com/DevMine/api-server/config Index | Files

package config

import "github.com/DevMine/api-server/config"

Package config takes care of the configuration file parsing.

Index

Package Files

config.go

type Config Uses

type Config struct {
    Database DatabaseConfig `json:"database"`
    Server   ServerConfig   `json:"server"`
}

Config is the main configuration structure.

func ReadConfig Uses

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 Uses

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 ServerConfig Uses

type ServerConfig struct {
    HostName   string `json:"hostname"`
    Port       int    `json:"port"`
    EnableCors bool   `json:"enable_cors"`
}

ServerConfig is a configuration for the server on which api-server is going to run on.

Package config imports 4 packages (graph) and is imported by 2 packages. Updated 2016-07-21. Refresh now. Tools for package owners.