store arbitrary json blobs in postgres over http
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.go 369B

123456789101112131415161718192021222324252627
  1. package main
  2. import (
  3. "errors"
  4. )
  5. type Configs struct {
  6. Dbhost string
  7. Dbname string
  8. Dbport int
  9. Port int
  10. }
  11. func NewConfig() *Configs {
  12. return &Configs{
  13. Dbname: "itslog",
  14. Dbport: 5432,
  15. Port: 80,
  16. }
  17. }
  18. func (c *Configs) validate() error {
  19. if c.Dbhost == "" {
  20. return errors.New("must specify dbhost (export ITSLOG_DBHOST=blah.local)")
  21. }
  22. return nil
  23. }