Documentation ¶
Index ¶
- func CAPSLOCK_DAY_TRANSFORM_COMMENT(comment *PostComment)
- func CAPSLOCK_DAY_TRANSFORM_POST(post *BlogPost)
- func DBConnect()
- func DBDisconnect()
- func Htmlstrip(s string) string
- func Telstrip(s string) string
- type BlogDB
- type BlogPost
- type MongoDB
- func (self *MongoDB) Close()
- func (md *MongoDB) GetComments(post_id int64) (comments []PostComment, err error)
- func (md *MongoDB) GetLastNPosts(num_to_get int32) (posts []BlogPost, err error)
- func (md *MongoDB) GetPost(post_id int64) (post BlogPost, err error)
- func (md *MongoDB) GetPostsForDate(date time.Time) (posts []BlogPost, err error)
- func (md *MongoDB) GetPostsForLastNDays(num_of_days int64) (posts []BlogPost, err error)
- func (md *MongoDB) GetPostsForMonth(date time.Time) (posts []BlogPost, err error)
- func (md *MongoDB) GetPostsForTimespan(start_timestamp, end_timestamp, order int64) (posts []BlogPost, err error)
- func (md *MongoDB) StoreComment(comment *PostComment) (id int64, err error)
- func (md *MongoDB) StorePost(post *BlogPost) (id int64, err error)
- type PostComment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CAPSLOCK_DAY_TRANSFORM_COMMENT ¶
func CAPSLOCK_DAY_TRANSFORM_COMMENT(comment *PostComment)
func CAPSLOCK_DAY_TRANSFORM_POST ¶
func CAPSLOCK_DAY_TRANSFORM_POST(post *BlogPost)
we must honor the capslock day
func DBDisconnect ¶
func DBDisconnect()
Types ¶
type BlogDB ¶
type BlogDB interface { Connect() Disconnect() StorePost(post *BlogPost) (int64, error) GetPost(post_id int64) (BlogPost, error) GetPostsForTimespan(start_timestamp, end_timestamp, order int64) (posts []BlogPost, err error) GetLastNPosts(num_to_get int32) (posts []BlogPost, err error) StoreComment(comment *PostComment) (int64, error) GetComments(post_id int64) (comments []PostComment, err error) }
type BlogPost ¶
type BlogPost struct { Content string //Timestamp int64 Timestamp time.Time Id int64 Comments []PostComment }
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
func (*MongoDB) GetComments ¶
func (md *MongoDB) GetComments(post_id int64) (comments []PostComment, err error)
get comments belonging to a post
func (*MongoDB) GetLastNPosts ¶
func (*MongoDB) GetPostsForDate ¶
returns posts for a certain date
func (*MongoDB) GetPostsForLastNDays ¶
func (*MongoDB) GetPostsForMonth ¶
returns posts for a certain month
func (*MongoDB) GetPostsForTimespan ¶
func (*MongoDB) StoreComment ¶
func (md *MongoDB) StoreComment(comment *PostComment) (id int64, err error)
Click to show internal directories.
Click to hide internal directories.