Documentation ¶
Index ¶
- Constants
- Variables
- func CheckParam(values url.Values, key string) bool
- func CheckSecret(hash, email, date string) bool
- func ExecTemplate(tmpl *template.Template, w http.ResponseWriter, pc map[string]interface{})
- func GenPassword() string
- func GenSlug(title string) string
- func GenerateSecret(email string) (hash string, date string, err error)
- func GetBaseURL(req *http.Request) string
- func GetIpAddress(req *http.Request) string
- func GetSessionId(res http.ResponseWriter, req *http.Request) (sessionid string, err error)
- func LogError(err error)
- func LogErrorSkipLevels(err error, levels int)
- func Logout(res http.ResponseWriter, req *http.Request)
- func NewSessionID() string
- func RandSeq(n int) string
- func SendRegEmail(email, baseURL string) error
- func SendResetEmail(email, date, hash, baseURL string) error
- func SetSessionCookie(res http.ResponseWriter, sessionid string)
- func ValidEmail(email string) bool
- type Community
- type Page
- type PagePostCount
- type Post
- type UserInfo
Constants ¶
View Source
const (
MinDescriptionLength = 3
)
Variables ¶
View Source
var ( SiteName = os.Getenv("SITENAME") SiteLongName = os.Getenv("SITELONGNAME") )
View Source
var ( EmailFailed = errors.New("Sending email failed.") EmailInUse = errors.New("You have already registered with this email address.") UsernameInUse = errors.New("This username is in use. Please select a different one.") InvalidUsernameOrPassword = errors.New("Invalid username or password.") DatabaseError = errors.New("Unknown database error.") InvalidSessionID = errors.New("Invalid sessionid.") InvalidEmail = errors.New("The provided email address is not valid.") InvalidIpAddress = errors.New("There is something wrong with your IP address.") InvalidTitle = errors.New("Invalid page title.") PageAlreadyExists = errors.New("A page with this category and title already exists.") PageNotFound = errors.New("Page not found.") InvalidLink = errors.New("Invalid link. It may have expired or possibly you already used it.") )
Errors
Functions ¶
func CheckSecret ¶
func ExecTemplate ¶
func ExecTemplate(tmpl *template.Template, w http.ResponseWriter, pc map[string]interface{})
func GenPassword ¶
func GenPassword() string
func GetBaseURL ¶
func GetIpAddress ¶
func GetSessionId ¶
func LogErrorSkipLevels ¶
func NewSessionID ¶
func NewSessionID() string
func SendRegEmail ¶
func SendResetEmail ¶
func SetSessionCookie ¶
func SetSessionCookie(res http.ResponseWriter, sessionid string)
func ValidEmail ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.