Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateHashKey() (string, error)
- func ParseTemplates(templates map[string]*template.Template, templatePaths map[string]string)
- type CookieJar
- func (cj *CookieJar) Authenticate(dbc *db.Database) (db.Account, db.AccountSession, bool)
- func (cj CookieJar) ClearCookie(name string)
- func (cj CookieJar) ClearSessionKey()
- func (cj CookieJar) GetSessionKey() string
- func (cj CookieJar) ParseFlashes() map[string]string
- func (cj *CookieJar) SaveSession()
- func (cj CookieJar) SetEmailConfirmed()
- func (cj CookieJar) SetEmailTaken()
- func (cj CookieJar) SetIsInvalidLogin()
- func (cj CookieJar) SetSessionKey(key string)
- func (cj CookieJar) SetSignupFormVals(username string, email string)
- func (cj CookieJar) SetUsernameTaken()
- type ServerConfig
Constants ¶
View Source
const (
SESSION_NAME = "default-session"
)
Variables ¶
View Source
var FLASH_KEYS = []string{
"invalid_login",
"username_taken",
"email_taken",
"signup_username",
"signup_email",
"show_login",
"show_signup",
"email_confirmed",
}
Functions ¶
func GenerateHashKey ¶
Types ¶
type CookieJar ¶
type CookieJar struct {
// contains filtered or unexported fields
}
func NewCookieJar ¶
func NewCookieJar(w http.ResponseWriter, r *http.Request, config *ServerConfig) *CookieJar
func (*CookieJar) Authenticate ¶
func (CookieJar) ClearCookie ¶
func (CookieJar) ClearSessionKey ¶
func (cj CookieJar) ClearSessionKey()
func (CookieJar) GetSessionKey ¶
func (CookieJar) ParseFlashes ¶
func (*CookieJar) SaveSession ¶
func (cj *CookieJar) SaveSession()
This should be called before writing the response, as it needs to set the cookies in the header.
func (CookieJar) SetEmailConfirmed ¶
func (cj CookieJar) SetEmailConfirmed()
func (CookieJar) SetEmailTaken ¶
func (cj CookieJar) SetEmailTaken()
func (CookieJar) SetIsInvalidLogin ¶
func (cj CookieJar) SetIsInvalidLogin()
func (CookieJar) SetSessionKey ¶
func (CookieJar) SetSignupFormVals ¶
func (CookieJar) SetUsernameTaken ¶
func (cj CookieJar) SetUsernameTaken()
type ServerConfig ¶
type ServerConfig struct { Host string WwwPort string ServerPort string ClientAssets string PersistEnabled bool WorldBaseDir string DbPass string MailPass string CookieDomain string CookieSecure bool CookieKeyPairs [][]byte }
func LoadServerConfig ¶
func LoadServerConfig(path string) *ServerConfig
Click to show internal directories.
Click to hide internal directories.