conf

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// RootURLPath gets just the path portion of the base application url.
	// E.g., if the app sits at http://www.example.com/path/to/gomp,
	// this setting would be "/path/to/gomp"
	RootURLPath string `json:"root_url_path"`

	// Port gets the port number under which the site is being hosted.
	Port int `json:"port"`

	// UploadDriver is used to select which backend data store is used for file uploads.
	// Available choises are: fs, s3
	UploadDriver string `json:"upload_driver"`

	// UploadPath gets the path (full or relative) under which to store uploads.
	// When using Amazon S3, this should be set to the bucket name.
	UploadPath string `json:"upload_path"`

	// IsDevelopment defines whether to run the application in "development mode".
	// Development mode turns on additional features, such as logging, that may
	// not be desirable in a production environment.
	IsDevelopment bool `json:"is_development"`

	// SecretKey is used to keep data safe.
	SecretKey string `json:"secret_key"`

	// ApplicationTitle is used where the application name (title) is displayed on screen.
	ApplicationTitle string `json:"application_title"`

	// DatabaseDriver gets which database/sql driver to use.
	// Supported drivers: sqlite3, postgres
	DatabaseDriver string `json:"database_driver"`

	// DatabaseUrl gets the url (or path, connection string, etc) to use with the associated
	// database driver when opening the database connection.
	DatabaseURL string `json:"database_url"`

	// AwsRegion defines the region to use for the S3 upload driver.
	AwsRegion string `json:"aws_region"`

	// AwsAccessKeyID defines the Access Key to use for S3 upload driver.
	AwsAccessKeyID string `json:"aws_access_key_id"`

	// AwsRegion defines the Secret Access Key to use for the S3 upload driver.
	AwsSecretAccessKey string `json:"aws_secret_access_key"`
}

Config contains the application configuration settings

func Load added in v0.3.0

func Load(path string) *Config

Load reads the configuration file from the specified path

func (*Config) Validate added in v0.8.0

func (c *Config) Validate() error

Validate checks whether the current configuration settings are valid.

Jump to

Keyboard shortcuts

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