Documentation ¶
Index ¶
Constants ¶
View Source
const DevelopmentMode = 0
DevelopmentMode represents a config en set to DevelopementMode
View Source
const ProductionMode = 1
ProductionMode repesents a config env set to production
Variables ¶
View Source
var DefaultConfig = Config{ Addr: ":8080", Env: "dev", Static: StaticConfig{Dir: "./static", StripPrefix: "static"}, Heartbeat: "5m", Killbeat: "2m", TemplatesConfig: assets.TemplateConfig{ Dir: "./templates", Extension: ".tmpl", }, }
DefaultConfig provides a default configuration for the app
Functions ¶
func ConvertToInt ¶
ConvertToInt wraps the internal int coverter
Types ¶
type Config ¶
type Config struct { Name string `yaml:"name"` APIToken string `yaml:"api_token"` Addr string `yaml:"addr"` Mode int `yaml:"-"` Env string `yaml:"env"` Heartbeat string `yaml:"heartbeat"` //the timeout for graceful shutdown of server Killbeat string `yaml:"killbeat"` C TLSConfig `yaml:"tls"` Static StaticConfig `yaml:"static"` Db Db `yaml:"db"` TemplatesConfig assets.TemplateConfig `yaml:"templates"` }
Config provides configuration for Afro
type Db ¶
type Db struct { Type string `yaml:"type"` //can be 'sql','mgo Name string `yaml:"name"` Addr string `yaml:"addr"` User string `yaml:"user"` Pass string `yaml:"pass"` }
Db provides a generic db configuration value
type Engine ¶
type Engine struct { *relay.ChainRouter *Config Template *assets.TemplateDir //HeartBeats is run a constant rate every ms provided HeartBeats func(*Engine) //BeforeInit is run right before the server is started BeforeInit func(*Engine) //AfterInit is run right after the server is started AfterInit func(*Engine) //OnInit is runned immediate the server gets started OnInit func(*Engine) OnClose func(*Engine) // contains filtered or unexported fields }
Engine provides a base luncher for a service
func (*Engine) EngineAddr ¶
EngineAddr returns the address of the app
type StaticConfig ¶
StaticConfig provides the configuration details for the static files location and arguments
type TLSConfig ¶
TLSConfig provides a base config for tls configuration
func (*TLSConfig) UnmarshalYAML ¶
UnmarshalYAML unmarshalls the incoming data for use
Click to show internal directories.
Click to hide internal directories.