Documentation ¶
Overview ¶
Package database provides functionalities to interact and set/get information to/from the database. Includes login and post functionalities
Index ¶
- type Database
- func (d *Database) Check(path string) bool
- func (d *Database) Close()
- func (d *Database) CommentCreate(comment core.Comment) (int64, error)
- func (d *Database) CreateProfile(displayName string) (int64, error)
- func (d *Database) DelVoteComment(username string, commentId int64) error
- func (d *Database) DelVotePost(username string, postId int64) error
- func (d *Database) DeleteProfile(profileid int64) error
- func (d *Database) GetCommentVote(username string, commentId int64) (core.UserVoteType, error)
- func (d *Database) GetCommentVotes(commentId int64) (int64, error)
- func (d *Database) GetComments(postId int64) ([]core.Comment, error)
- func (d *Database) GetLoginId(username string) (int64, error)
- func (d *Database) GetLoginUserFromId(id int64) (string, error)
- func (d *Database) GetNewestPosts() ([]core.Post, error)
- func (d *Database) GetPostAndComments(indexStr string) (core.PostComments, error)
- func (d *Database) GetProfile(username string) (core.Profile, error)
- func (d *Database) GetProfileId(username string) (int64, error)
- func (d *Database) GetVote(username string, postId int64) (core.UserVoteType, error)
- func (d *Database) GetVotes(postId int64) (int64, error)
- func (d *Database) Login(username string) (core.Login, error)
- func (d *Database) New(path string) error
- func (d *Database) Setup() error
- func (d *Database) Signup(login core.Login) error
- func (d *Database) SubmitPost(post core.Post) (int64, error)
- func (d *Database) UpdateProfile(profileid int64, displayName string, info string, link string) error
- func (d *Database) VoteComment(username string, commentId int64) error
- func (d *Database) VotePost(username string, postId int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Holds the database session
var DBase Database
Global database session
func (*Database) CommentCreate ¶
func (*Database) CreateProfile ¶
func (*Database) DelVoteComment ¶
func (*Database) DeleteProfile ¶
func (*Database) GetCommentVote ¶
func (*Database) GetCommentVotes ¶
func (*Database) GetLoginUserFromId ¶
func (*Database) GetNewestPosts ¶
Gets the newests posts from the database
func (*Database) GetPostAndComments ¶
func (d *Database) GetPostAndComments(indexStr string) (core.PostComments, error)
func (*Database) SubmitPost ¶
Submit a new post into the database
func (*Database) UpdateProfile ¶
func (*Database) VoteComment ¶
Click to show internal directories.
Click to hide internal directories.