1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

New directory layout - DOES NOT COMPILE

This commit is contained in:
James Hillyerd
2012-10-20 16:40:25 -07:00
parent 2b3491fc87
commit 3dd0206b48
35 changed files with 16 additions and 18 deletions

31
web/app.go Normal file
View File

@@ -0,0 +1,31 @@
package controllers
import (
"github.com/jhillyerd/inbucket/app/smtpd"
"github.com/robfig/revel"
)
type Application struct {
*rev.Controller
}
func (c Application) Index() rev.Result {
return c.Render()
}
type SmtpdPlugin struct {
rev.EmptyPlugin
server *smtpd.Server
}
func (p SmtpdPlugin) OnAppStart() {
domain := rev.Config.StringDefault("smtpd.domain", "localhost")
port := rev.Config.IntDefault("smtpd.port", 2500)
rev.INFO.Printf("SMTP Daemon plugin init {domain: %v, port: %v}", domain, port)
p.server = smtpd.New(domain, port)
go p.server.Start()
}
func init() {
rev.RegisterPlugin(SmtpdPlugin{})
}