Documentation
¶
Index ¶
- Constants
- Variables
- func ReverseProxyHandler(config Config, path, dest string) (http.Handler, error)
- type Config
- type Info
- type JSONError
- type KeyConfig
- type LoginPacket
- type MetaConfig
- type SecurityConfig
- type SignupPacket
- type Stats
- type System
- func (s *System) ApiHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) ContactHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) DashboardHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) ErrHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) HitCounter(h http.Handler) http.Handler
- func (s *System) HomeHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) InitDB(doMongo bool) error
- func (s *System) LoginHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) LogoutHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) ReloadConfig() error
- func (s *System) ReloadTemplates() error
- func (s *System) SetCSPHeader(w http.ResponseWriter)
- func (s *System) SetGreylist(g *greylist.List)
- func (s *System) SignupHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) StaticHandler(w http.ResponseWriter, r *http.Request)
- func (s *System) StatusHandler(w http.ResponseWriter, r *http.Request)
- type User
Constants ¶
View Source
const MaxAttempts = 3
Variables ¶
View Source
var ErrBadCredentials = errors.New("bad credentials")
View Source
var ErrExists = errors.New("record already exists")
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
Types ¶
type Config ¶
type Config struct {
Meta MetaConfig `json:"Meta,omitempty"`
Keys KeyConfig `json:"Keys,omitempty"`
Sec SecurityConfig `json:"Security,omitempty"`
ReverseProxy map[string]string `json:"ReverseProxy"`
ConfigFilePath string `json:"-"` // unused in config.json, path to config for reload, empty if stdin
DoMongo bool `json:"use-mongo"`
}
type KeyConfig ¶
type KeyConfig struct {
GoogleClientID string `json:"GoogleClientID"`
GoogleSecretKey string `json:"GoogleSecretKey"`
GithubClientID string `json:"GithubClientID"`
GithubSecretKey string `json:"GithubSecretKey"`
TwitterClientID string `json:"TwitterClientID"`
TwitterSecretKey string `json:"TwitterSecretKey"`
LinkedInClientID string `json:"LinkedInClientID"`
LinkedInSecretKey string `json:"LinkedInSecretKey"`
PayPalClientID string `json:"PayPalClientID"`
PayPalSecretKey string `json:"PayPalSecretKey"`
SendgridUser string `json:"SendgridUser"`
SendgridPassword string `json:"SendgridPassword"`
MailgunUser string `json:"MailgunUser"`
MailgunPassword string `json:"MailgunPassword"`
TwilioSID string `json:"TwilioSID"`
TwilioAuthToken string `json:"TwilioAuthToken"`
}
type LoginPacket ¶
type MetaConfig ¶
type MetaConfig struct {
ListenAddr string `json:"listen"`
ListenAddrTLS string `json:"listentls"`
SiteName string `json:"sitename"`
SiteURL string `json:"siteurl"`
DevelopmentMode bool `json:"devmode"`
CopyrightName string `json:"copyright-name"`
TemplateData map[string]interface{} `json:"templatedata"`
}
type SecurityConfig ¶
type SecurityConfig struct {
HashKey string `json:"hash-key"`
BlockKey string `json:"block-key"`
CSRFKey string `json:"csrf-key"`
CookieName string `json:"cookie-name"`
Whitelist string `json:"whitelist"`
Blacklist string `json:"blacklist"`
ServePublic bool `json:"servepublic"` // Serve All Unhandled URL in ./public
BoltDB string `json:"database"`
OpenSignups bool `json:"open-signups"`
}
type SignupPacket ¶
type System ¶
func (*System) ApiHandler ¶
func (s *System) ApiHandler(w http.ResponseWriter, r *http.Request)
func (*System) ContactHandler ¶
func (s *System) ContactHandler(w http.ResponseWriter, r *http.Request)
func (*System) DashboardHandler ¶
func (s *System) DashboardHandler(w http.ResponseWriter, r *http.Request)
func (*System) ErrHandler ¶
func (s *System) ErrHandler(w http.ResponseWriter, r *http.Request)
func (*System) HitCounter ¶
HitCounter http middleware that logs and counts
func (*System) HomeHandler ¶
func (s *System) HomeHandler(w http.ResponseWriter, r *http.Request)
func (*System) LoginHandler ¶
func (s *System) LoginHandler(w http.ResponseWriter, r *http.Request)
func (*System) LogoutHandler ¶
func (s *System) LogoutHandler(w http.ResponseWriter, r *http.Request)
func (*System) ReloadConfig ¶ added in v0.0.3
func (*System) ReloadTemplates ¶ added in v0.0.3
func (*System) SetCSPHeader ¶
func (s *System) SetCSPHeader(w http.ResponseWriter)
func (*System) SetGreylist ¶
func (*System) SignupHandler ¶
func (s *System) SignupHandler(w http.ResponseWriter, r *http.Request)
func (*System) StaticHandler ¶
func (s *System) StaticHandler(w http.ResponseWriter, r *http.Request)
func (*System) StatusHandler ¶
func (s *System) StatusHandler(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.