Documentation ¶
Index ¶
- Constants
- type BannerEntity
- type CategoryEntity
- type CategoryEntityNestedSet
- type CategoryEntityNestedSetNode
- type CategoryEntityTree
- type CategoryEntityTreeBranch
- type CategoryXrefEntity
- type ChannelEntity
- type CommentEntity
- type FileEntity
- type PollEntity
- type PostEntity
- func (e *PostEntity) ObjectId() *models.ObjectId
- func (*PostEntity) ObjectType() models.ObjectType
- func (e *PostEntity) RemovePicture()
- func (e *PostEntity) RemoveVideo()
- func (e *PostEntity) SetAuthor(postAuthor models.Subject)
- func (e *PostEntity) SetPicture(postPicture *FileEntity)
- func (e *PostEntity) SetVideo(postVideo *FileEntity)
- func (*PostEntity) TableName() string
- type TagEntity
- type TagXrefEntity
- type UserEntity
Constants ¶
View Source
const ( CategoryTableName = "categories" CategoryXrefTableName = "category_xref" )
View Source
const ( PostTableName = "posts" PostEntityObjectType models.ObjectType = "post" )
View Source
const ( TagTableName = "tags" TagXrefTableName = "tag_xref" )
View Source
const ( UserTableName = "users" UserEntitySubjectType models.SubjectType = "user" )
View Source
const (
BannerTableName = "banners"
)
View Source
const (
ChannelTableName = "channels"
)
View Source
const (
CommentTableName = "tags"
)
View Source
const (
FileTableName = "files"
)
View Source
const (
PollTableName = "polls"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BannerEntity ¶
type BannerEntity struct { Id *models.BannerId `gorm:"primary_key;type:char(36);column:id"` Title string Key string Created *time.Time Updated *time.Time }
func NewBannerEntity ¶
func NewBannerEntity() *BannerEntity
func (*BannerEntity) TableName ¶
func (*BannerEntity) TableName() string
type CategoryEntity ¶
type CategoryEntity struct { Id *models.CategoryId `gorm:"primary_key;type:char(36);column:id"` Name string ParentCategoryId *models.CategoryId `gorm:"type:char(36)"` Left int Right int Created *time.Time Updated *time.Time }
func (*CategoryEntity) RemoveParentCategory ¶
func (e *CategoryEntity) RemoveParentCategory()
RemoveParentCategory
func (*CategoryEntity) SetParentCategory ¶
func (e *CategoryEntity) SetParentCategory(categoryEntity *CategoryEntity)
SetParentCategory
type CategoryEntityNestedSet ¶
type CategoryEntityNestedSet struct {
Nodes []*CategoryEntityNestedSetNode
}
type CategoryEntityNestedSetNode ¶
type CategoryEntityNestedSetNode struct { CategoryEntity *CategoryEntity Left int Right int }
func (*CategoryEntityNestedSetNode) EdgesDifferent ¶
func (n *CategoryEntityNestedSetNode) EdgesDifferent() bool
EdgesDifferent
func (*CategoryEntityNestedSetNode) SetEntityEdges ¶
func (n *CategoryEntityNestedSetNode) SetEntityEdges()
SetEntityEdges
type CategoryEntityTree ¶
type CategoryEntityTree struct {
Roots []*CategoryEntityTreeBranch
}
type CategoryEntityTreeBranch ¶
type CategoryEntityTreeBranch struct { CategoryEntity *CategoryEntity Children []*CategoryEntityTreeBranch }
type CategoryXrefEntity ¶
type CategoryXrefEntity struct { CategoryId *models.CategoryId `gorm:"primary_key;type:char(36)"` ObjectType models.ObjectType `gorm:"primary_key"` ObjectId *models.ObjectId `gorm:"primary_key;type:char(36)"` Created *time.Time }
func NewCategoryXrefEntity ¶
func NewCategoryXrefEntity(categoryEntity *CategoryEntity, categoryObject models.Object) *CategoryXrefEntity
NewCategoryXrefEntity
func (*CategoryXrefEntity) SetCategory ¶
func (e *CategoryXrefEntity) SetCategory(categoryEntity *CategoryEntity)
SetCategory
func (*CategoryXrefEntity) SetObject ¶
func (e *CategoryXrefEntity) SetObject(categoryObject models.Object)
SetObject
type ChannelEntity ¶
type ChannelEntity struct { Id *models.ChannelId `gorm:"primary_key;type:char(36);column:id"` Name string Created *time.Time Updated *time.Time }
func NewChannelEntity ¶
func NewChannelEntity() *ChannelEntity
func (*ChannelEntity) TableName ¶
func (*ChannelEntity) TableName() string
type CommentEntity ¶
type CommentEntity struct { Id *models.CommentId `gorm:"primary_key;type:char(36);column:id"` Content string Created *time.Time Updated *time.Time }
func NewCommentEntity ¶
func NewCommentEntity() *CommentEntity
func (*CommentEntity) TableName ¶
func (*CommentEntity) TableName() string
type FileEntity ¶
type FileEntity struct { Id *models.FileId `gorm:"primary_key;type:char(36);column:id"` Name string Path string Size int64 Type string Created *time.Time Updated *time.Time }
func NewFileEntity ¶
func NewFileEntity() *FileEntity
func (*FileEntity) TableName ¶
func (*FileEntity) TableName() string
type PollEntity ¶
type PollEntity struct { Id *models.PollId `gorm:"primary_key;type:char(36);column:id"` Title string Created *time.Time Updated *time.Time }
func NewPollEntity ¶
func NewPollEntity() *PollEntity
func (*PollEntity) TableName ¶
func (*PollEntity) TableName() string
type PostEntity ¶
type PostEntity struct { Id *models.PostId `gorm:"primary_key;type:char(36);column:id"` AuthorId *models.SubjectId AuthorType models.SubjectType Title string Description string `gorm:"type:text"` Content string Status enums.PostStatus Privacy enums.PostPrivacy PictureId *models.FileId `gorm:"type:char(36)"` VideoId *models.FileId `gorm:"type:char(36)"` Views int Published *time.Time Created *time.Time Updated *time.Time }
func NewPostEntity ¶
func NewPostEntity() *PostEntity
func (*PostEntity) RemovePicture ¶
func (e *PostEntity) RemovePicture()
func (*PostEntity) RemoveVideo ¶
func (e *PostEntity) RemoveVideo()
func (*PostEntity) SetAuthor ¶
func (e *PostEntity) SetAuthor(postAuthor models.Subject)
func (*PostEntity) SetPicture ¶
func (e *PostEntity) SetPicture(postPicture *FileEntity)
func (*PostEntity) SetVideo ¶
func (e *PostEntity) SetVideo(postVideo *FileEntity)
func (*PostEntity) TableName ¶
func (*PostEntity) TableName() string
type TagEntity ¶
type TagEntity struct { Id *models.TagId `gorm:"primary_key;type:char(36);column:id"` Name string Created *time.Time Updated *time.Time }
func NewTagEntity ¶
func NewTagEntity() *TagEntity
type TagXrefEntity ¶
type TagXrefEntity struct { TagId *models.TagId `gorm:"primary_key;type:char(36)"` ObjectType models.ObjectType `gorm:"primary_key"` ObjectId *models.ObjectId `gorm:"primary_key;type:char(36)"` Created *time.Time }
func NewTagXrefEntity ¶
func NewTagXrefEntity(tagEntity *TagEntity, tagObject models.Object) *TagXrefEntity
NewTagXrefEntity
func (*TagXrefEntity) SetObject ¶
func (e *TagXrefEntity) SetObject(tagObject models.Object)
SetObject
type UserEntity ¶
type UserEntity struct { Id *models.UserId `gorm:"primary_key;type:char(36);column:id"` FirstName string LastName string Email string `gorm:"type:varchar(100);unique_index"` Password string PictureId *models.FileId `gorm:"type:char(36)"` Verified bool Created *time.Time Updated *time.Time }
func NewUserEntity ¶
func NewUserEntity() *UserEntity
func (*UserEntity) RemovePicture ¶
func (e *UserEntity) RemovePicture()
func (*UserEntity) SetPicture ¶
func (e *UserEntity) SetPicture(postPicture *FileEntity)
func (*UserEntity) SubjectId ¶
func (c *UserEntity) SubjectId() *models.SubjectId
func (*UserEntity) SubjectType ¶
func (*UserEntity) SubjectType() models.SubjectType
func (*UserEntity) TableName ¶
func (*UserEntity) TableName() string
Click to show internal directories.
Click to hide internal directories.