1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-01-24 05:17:10 +02:00
authboss/config.go
2015-01-15 14:01:01 -08:00

36 lines
1002 B
Go

package authboss
import (
"io"
"io/ioutil"
)
// Config holds all the configuration for both authboss and it's modules.
type Config struct {
MountPath string `json:"mountPath" xml:"mountPath"`
ViewsPath string `json:"viewsPath" xml:"viewsPath"`
AuthLogoutRoute string `json:"authLogoutRoute" xml:"authLogoutRoute"`
AuthLoginSuccessRoute string `json:"authLoginSuccessRoute" xml:"authLoginSuccessRoute"`
Storer Storer `json:"-" xml:"-"`
CookieStoreMaker CookieStoreMaker `json:"-" xml:"-"`
SessionStoreMaker SessionStoreMaker `json:"-" xml:"-"`
LogWriter io.Writer `json:"-" xml:"-"`
Callbacks *Callbacks `json:"-" xml:"-"`
}
// NewConfig creates a new config full of default values ready to override.
func NewConfig() *Config {
return &Config{
MountPath: "/",
ViewsPath: "/",
AuthLogoutRoute: "/",
AuthLoginSuccessRoute: "http://www.google.com",
LogWriter: ioutil.Discard,
Callbacks: NewCallbacks(),
}
}