1
0
Fork 0
itslog/config.go

28 linhas
369 B
Go

package main
import (
"errors"
)
type Configs struct {
Dbhost string
Dbname string
Dbport int
Port int
}
func NewConfig() *Configs {
return &Configs{
Dbname: "itslog",
Dbport: 5432,
Port: 80,
}
}
func (c *Configs) validate() error {
if c.Dbhost == "" {
return errors.New("must specify dbhost (export ITSLOG_DBHOST=blah.local)")
}
return nil
}