Documentation
¶
Index ¶
- Variables
- func Check(session *utils.Session) (valid bool, err error)
- func CreateUUID() (uuid string)
- func DeleteSession(session *utils.Session) (err error)
- func Encrypt(plaintext string) string
- func GetSession(w http.ResponseWriter, r *http.Request) (sess utils.Session, err error)
- type Post
- type Thread
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var Db *sql.DB
Functions ¶
func CreateUUID ¶
func CreateUUID() (uuid string)
CreateUUID create a random UUID with from RFC 4122 adapted from http://github.com/un7hatch/gouuid
func DeleteSession ¶
func GetSession ¶
GetSession function : <br /> Checks if the user is logged in has a session, if not err is not nil
Types ¶
type Post ¶
func (*Post) CreatedAtDate ¶
type Thread ¶
func ThreadByUUID ¶
ThreadByUUID Get a thread by the UUID
func (*Thread) CreatedAtDate ¶
CreatedAtDate is method that format the CreatedAt date to display nicely on the screen
func (*Thread) NumReplies ¶
type User ¶
type User struct { Id int Uuid string Name string Email string Password string CreatedAt time.Time }
func GetUserBySession ¶
GetUserBySession method is get a user from session
func UserByEmail ¶
Get a single user given the email
func (*User) CreatePost ¶
func (*User) CreateSession ¶
CreateSession create a new session for an existing user
Click to show internal directories.
Click to hide internal directories.