models

package
v0.0.0-...-2bd0660 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package models provides models.

Index

Constants

View Source
const (
	EnvDevelopment = "development"
	EnvTest        = "test"
	EnvStaging     = "staging"
	EnvProduction  = "production"
)

Env consts

Variables

View Source
var (
	ErrConfigFilePathNotSpecified = errors.New("config file path is not specified")
)

Errors

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Env string `yaml:"env"`
}

AppConfig represents a configuration for the application

func (*AppConfig) Development

func (app *AppConfig) Development() bool

Development returns true if the Env == envDevelopment.

func (*AppConfig) Production

func (app *AppConfig) Production() bool

Production returns true if the Env == envProduction.

func (*AppConfig) Staging

func (app *AppConfig) Staging() bool

Staging returns true if the Env == envStaging.

func (*AppConfig) Test

func (app *AppConfig) Test() bool

Test returns true if the Env == envTest.

type Config

type Config struct {
	App    AppConfig    `yaml:"app"`
	Server ServerConfig `yaml:"server"`
}

Config represents a configuration for Orgs.io.

func NewConfig

func NewConfig(flags *Flags) (*Config, error)

NewConfig parses the configuration file, creates and returns a config.

type Flags

type Flags struct {
	// ConfigFilePath represents a configuration file path.
	ConfigFilePath string
}

Flags presents command line flags.

func NewFlags

func NewFlags() (*Flags, error)

NewFlags parses the command-line flags, creates and returns flags.

type ServerConfig

type ServerConfig struct {
	Port string `yaml:"port"`
	CPUs int    `yaml:"cpus"`
}

ServerConfig represents a configuration for the server.

Jump to

Keyboard shortcuts

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