Documentation
¶
Index ¶
- type About
- type Blog
- type BlogDB
- type Comment
- type Config
- type Home
- type Like
- type MyBlogDB
- func (d *MyBlogDB) ActivateBlog(id int64) bool
- func (d *MyBlogDB) ActivateComment(id int64) bool
- func (d *MyBlogDB) AddAbout(ab *About) (bool, int64)
- func (d *MyBlogDB) AddBlog(b *Blog) (bool, int64)
- func (d *MyBlogDB) AddComment(c *Comment) (bool, int64)
- func (d *MyBlogDB) AddConfig(c *Config) (bool, int64)
- func (d *MyBlogDB) AddHome(ab *Home) (bool, int64)
- func (d *MyBlogDB) AddLike(l *Like) bool
- func (d *MyBlogDB) AddPrivacyPolicy(ab *PrivacyPolicy) (bool, int64)
- func (d *MyBlogDB) AddRole(name string) (bool, int64)
- func (d *MyBlogDB) AddRule(r *Rule) (bool, int64)
- func (d *MyBlogDB) AddTos(t *Tos) (bool, int64)
- func (d *MyBlogDB) AddUser(u *User) (bool, int64)
- func (d *MyBlogDB) AddUserAuth(c *UserAuth) (bool, int64)
- func (d *MyBlogDB) DeactivateBlog(id int64) bool
- func (d *MyBlogDB) DeactivateComment(id int64) bool
- func (d *MyBlogDB) DeleteBlog(id int64) bool
- func (d *MyBlogDB) DeleteRole(id int64) bool
- func (d *MyBlogDB) DisableUser(uid int64) bool
- func (d *MyBlogDB) DisableUserForCause(uid int64) bool
- func (d *MyBlogDB) EnableUser(uid int64) bool
- func (d *MyBlogDB) GetAbout() *[]About
- func (d *MyBlogDB) GetActiveBlogList(start int64, end int64) *[]Blog
- func (d *MyBlogDB) GetBannedUserList() *[]User
- func (d *MyBlogDB) GetBlog(id int64) *Blog
- func (d *MyBlogDB) GetBlogList(start int64, end int64) *[]Blog
- func (d *MyBlogDB) GetBlogsByName(name string, start int64, end int64) *[]Blog
- func (d *MyBlogDB) GetCommentList(bid, start, end int64) *[]Comment
- func (d *MyBlogDB) GetConfig() *[]Config
- func (d *MyBlogDB) GetHome() *[]Home
- func (d *MyBlogDB) GetPrivacyPolicy() *[]PrivacyPolicy
- func (d *MyBlogDB) GetRole(name string) *Role
- func (d *MyBlogDB) GetRoleList() *[]Role
- func (d *MyBlogDB) GetRule() *[]Rule
- func (d *MyBlogDB) GetTos() *[]Tos
- func (d *MyBlogDB) GetUnactivatedUserList() *[]User
- func (d *MyBlogDB) GetUser(email string) *User
- func (d *MyBlogDB) GetUserAuthList(uid, start, end int64) *[]UserAuth
- func (d *MyBlogDB) GetUserByID(id int64) *User
- func (d *MyBlogDB) GetUserList() *[]User
- func (d *MyBlogDB) New() BlogDB
- func (d *MyBlogDB) ReinstateBannedUser(uid int64) bool
- func (d *MyBlogDB) RemoveLike(uid, bid int64) bool
- func (d *MyBlogDB) UpdateAbout(ab *About) bool
- func (d *MyBlogDB) UpdateBlog(b *Blog) bool
- func (d *MyBlogDB) UpdateComment(c *Comment) bool
- func (d *MyBlogDB) UpdateConfig(c *Config) bool
- func (d *MyBlogDB) UpdateHome(ab *Home) bool
- func (d *MyBlogDB) UpdatePrivacyPolicy(ab *PrivacyPolicy) bool
- func (d *MyBlogDB) UpdateRule(r *Rule) bool
- func (d *MyBlogDB) UpdateTos(t *Tos) bool
- func (d *MyBlogDB) UpdateUser(u *User) bool
- func (d *MyBlogDB) ViewLikes(bid int64) *[]Like
- type PrivacyPolicy
- type Role
- type Rule
- type Tos
- type User
- type UserAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blog ¶
type Blog struct { ID int64 `json:"id"` Name string `json:"name"` Content string `json:"content"` UserID int64 `json:"userId"` Active bool `json:"active"` Entered time.Time `json:"entered"` Updated time.Time `json:"updated"` }
Blog Blog
type BlogDB ¶
type BlogDB interface { //users AddUser(u *User) (bool, int64) UpdateUser(u *User) bool GetUser(email string) *User GetUserByID(id int64) *User GetUserList() *[]User GetUnactivatedUserList() *[]User GetBannedUserList() *[]User EnableUser(uid int64) bool DisableUser(uid int64) bool DisableUserForCause(uid int64) bool ReinstateBannedUser(uid int64) bool //Role AddRole(name string) (bool, int64) GetRole(name string) *Role GetRoleList() *[]Role DeleteRole(id int64) bool //Blog AddBlog(b *Blog) (bool, int64) UpdateBlog(u *Blog) bool GetBlog(id int64) *Blog GetBlogsByName(name string, start int64, end int64) *[]Blog GetBlogList(start int64, end int64) *[]Blog GetActiveBlogList(start int64, end int64) *[]Blog ActivateBlog(id int64) bool DeactivateBlog(id int64) bool DeleteBlog(id int64) bool //likes AddLike(l *Like) bool RemoveLike(uid, bid int64) bool ViewLikes(bid int64) *[]Like //comments AddComment(b *Comment) (bool, int64) UpdateComment(u *Comment) bool GetCommentList(bid, start, end int64) *[]Comment ActivateComment(id int64) bool DeactivateComment(id int64) bool //user auth AddUserAuth(b *UserAuth) (bool, int64) GetUserAuthList(uid, start, end int64) *[]UserAuth //config AddConfig(b *Config) (bool, int64) UpdateConfig(u *Config) bool GetConfig() *[]Config //rules AddRule(r *Rule) (bool, int64) UpdateRule(r *Rule) bool GetRule() *[]Rule //Tos AddTos(t *Tos) (bool, int64) UpdateTos(t *Tos) bool GetTos() *[]Tos //About AddAbout(ab *About) (bool, int64) UpdateAbout(ab *About) bool GetAbout() *[]About //Home AddHome(ab *Home) (bool, int64) UpdateHome(ab *Home) bool GetHome() *[]Home //PrivacyPolicy AddPrivacyPolicy(ab *PrivacyPolicy) (bool, int64) UpdatePrivacyPolicy(ab *PrivacyPolicy) bool GetPrivacyPolicy() *[]PrivacyPolicy }
BlogDB BlogDB
type Comment ¶
type Comment struct { ID int64 `json:"id"` BlogID int64 `json:"blogId"` UserID int64 `json:"userId"` Text string `json:"text"` Active bool `json:"active"` }
Comment Comment
type Config ¶
type Config struct { ID int64 `json:"id"` AllowAutoPost bool `json:"allowAutoPost"` AllowAutoComment bool `json:"allowAutoComment"` }
Config Config
type MyBlogDB ¶
MyBlogDB MyBlogDB
func (*MyBlogDB) ActivateBlog ¶
ActivateBlog ActivateBlog
func (*MyBlogDB) ActivateComment ¶
ActivateComment ActivateComment
func (*MyBlogDB) AddComment ¶
AddComment AddComment
func (*MyBlogDB) AddPrivacyPolicy ¶ added in v1.0.0
func (d *MyBlogDB) AddPrivacyPolicy(ab *PrivacyPolicy) (bool, int64)
AddPrivacyPolicy AddPrivacyPolicy
func (*MyBlogDB) AddUserAuth ¶
AddUserAuth AddUserAuth
func (*MyBlogDB) DeactivateBlog ¶
DeactivateBlog DeactivateBlog
func (*MyBlogDB) DeactivateComment ¶
DeactivateComment DeactivateComment
func (*MyBlogDB) DisableUser ¶
DisableUser DisableUser
func (*MyBlogDB) DisableUserForCause ¶
DisableUserForCause DisableUserForCause
func (*MyBlogDB) GetActiveBlogList ¶
GetActiveBlogList GetActiveBlogList
func (*MyBlogDB) GetBannedUserList ¶
GetBannedUserList GetBannedUserList
func (*MyBlogDB) GetBlogList ¶
GetBlogList GetBlogList
func (*MyBlogDB) GetBlogsByName ¶
GetBlogsByName GetBlogsByName
func (*MyBlogDB) GetCommentList ¶
GetCommentList GetCommentList
func (*MyBlogDB) GetPrivacyPolicy ¶ added in v1.0.0
func (d *MyBlogDB) GetPrivacyPolicy() *[]PrivacyPolicy
GetPrivacyPolicy GetPrivacyPolicy
func (*MyBlogDB) GetUnactivatedUserList ¶
GetUnactivatedUserList GetUnactivatedUserList
func (*MyBlogDB) GetUserAuthList ¶
GetUserAuthList GetUserAuthList
func (*MyBlogDB) GetUserByID ¶
GetUserByID GetUserById
func (*MyBlogDB) ReinstateBannedUser ¶
ReinstateBannedUser ReinstateBannedUser
func (*MyBlogDB) RemoveLike ¶
RemoveLike RemoveLike
func (*MyBlogDB) UpdateAbout ¶ added in v1.0.0
UpdateAbout UpdateAbout
func (*MyBlogDB) UpdateComment ¶
UpdateComment UpdateComment
func (*MyBlogDB) UpdateConfig ¶
UpdateConfig UpdateConfig
func (*MyBlogDB) UpdateHome ¶ added in v1.0.0
UpdateHome UpdateHome
func (*MyBlogDB) UpdatePrivacyPolicy ¶ added in v1.0.0
func (d *MyBlogDB) UpdatePrivacyPolicy(ab *PrivacyPolicy) bool
UpdatePrivacyPolicy UpdatePrivacyPolicy
func (*MyBlogDB) UpdateRule ¶ added in v1.0.0
UpdateRule UpdateRule
type PrivacyPolicy ¶ added in v1.0.0
PrivacyPolicy Privacy
type User ¶
type User struct { ID int64 `json:"id"` Email string `json:"email"` Password string `json:"password"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Image []byte `json:"image"` RoleID int64 `json:"roleId"` Active bool `json:"active"` DisabledForCause bool `json:"disabledForCause"` }
User User