A temporary email service written in Go.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

35 righe
639 B

  1. package main
  2. import (
  3. "flag"
  4. "log"
  5. "github.com/thebaer/burner/auth"
  6. "github.com/thebaer/burner/database"
  7. "github.com/thebaer/burner/mail"
  8. )
  9. var host = flag.String("h", "example.com", "Domain this service lives on.")
  10. func main() {
  11. // Parse configuration flags and validate
  12. flag.Parse()
  13. if *host == "example.com" {
  14. log.Printf("WARNING: Default hostname (example.com) unchanged. Use -h flag to set correct host.")
  15. }
  16. // Connect to database
  17. db, err := database.Open()
  18. if err != nil {
  19. panic(err)
  20. }
  21. defer db.Close()
  22. // TODO: make port numbers configurable
  23. go func() {
  24. auth.Serve(8080)
  25. }()
  26. mail.Serve(*host, 2525)
  27. }