store arbitrary json blobs in postgres over http

config.go 369B

12345678910111213141516171819202122232425262728
  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. }