Documentation ¶
Index ¶
- func Encrypt(plainText string) (cryptext string)
- func SessionDeleteAll() (err error)
- func UserDeleteAll() (err error)
- type Post
- type Session
- type Thread
- type User
- func (user *User) Create() (err error)
- func (user *User) CreatePost(conv Thread, body string) (post Post, err error)
- func (user *User) CreateSession() (session Session, err error)
- func (user *User) CreateThread(topic string) (conv Thread, err error)
- func (user *User) Delete() (err error)
- func (user *User) Session() (session Session, err error)
- func (user *User) Update() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SessionDeleteAll ¶
func SessionDeleteAll() (err error)
SessionDeleteAll delete all sessions from database
Types ¶
type Post ¶
type Post struct { UUID string `bson:"uuid,omitempty"` Body string `bson:"body,omitempty"` ThreadID string `bson:"threadid"` UserID string `bson:"userid"` CreatedAt time.Time `bson:"created_at_time"` }
Post which store post information
func (*Post) CreatedAtDate ¶
CreatedAtDate use the CreatedAtDate function
type Session ¶
type Session struct { UUID string `bson:"uuid,omitempty"` Email string `bson:"email,omitempty"` UserID string `bson:"userid"` CreatedAt time.Time `bson:"created_at_time"` }
Session which store Session information
func (*Session) DeleteByUUID ¶
DeleteByUUID delete session from database
type Thread ¶
type Thread struct { UUID string `bson:"uuid,omitempty"` Topic string `bson:"topic,omitempty"` UserID string `bson:"userid"` CreatedAt time.Time `bson:"created_at_time"` }
Thread which store thread information
func ThraedByUUID ¶
ThraedByUUID get a thread by the uuid
func (*Thread) CreatedAtDate ¶
CreatedAtDate format the CreatedAt date to display nicely on the screen
type User ¶
type User struct { UUID string `bson:"uuid,omitempty"` Name string `bson:"name,omitempty"` Email string `bson:"email,omitempty"` Password string `bson:"password,omitempty"` CreatedAt time.Time `bson:"created_at_time"` }
User which store User information
func UserByEmail ¶
UserByEmail get a single user given the email
func UserByUUID ¶
UserByUUID get a single user given the UUID
func (*User) CreatePost ¶
CreatePost create a new post to a thread
func (*User) CreateSession ¶
CreateSession create a new session for an existing user
func (*User) CreateThread ¶
CreateThread create a new thread
Click to show internal directories.
Click to hide internal directories.