1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-09-16 09:06:20 +02:00

Remove state from config, add to authboss type.

This commit is contained in:
Aaron
2015-03-31 12:36:31 -07:00
parent f12f10fa43
commit d6c0eb8684
2 changed files with 4 additions and 4 deletions

View File

@@ -20,12 +20,15 @@ import (
// Authboss contains a configuration and other details for running.
type Authboss struct {
Config
Callbacks *Callbacks
}
// New makes a new instance of authboss with a default
// configuration.
func New() *Authboss {
ab := &Authboss{}
ab := &Authboss{
Callbacks: NewCallbacks(),
}
ab.Defaults()
return ab
}

View File

@@ -107,8 +107,6 @@ type Config struct {
// LogWriter is written to when errors occur, as well as on startup to show which modules are loaded
// and which routes they registered. By default writes to io.Discard.
LogWriter io.Writer
// Callbacks is an internal mechanism that can be used by implementers and will be set automatically.
Callbacks *Callbacks
// Mailer is the mailer being used to send e-mails out. Authboss defines two loggers for use
// LogMailer and SMTPMailer, the default is a LogMailer to io.Discard.
Mailer Mailer
@@ -163,6 +161,5 @@ func (c *Config) Defaults() {
c.LockDuration = 5 * time.Hour
c.LogWriter = NewDefaultLogger()
c.Callbacks = NewCallbacks()
c.Mailer = LogMailer(ioutil.Discard)
}