Documentation ¶
Index ¶
- Constants
- func Run() error
- type Article
- type Articles
- func (a *Articles) Create() (*Articles, error)
- func (a *Articles) Delete() error
- func (a *Articles) DeleteArticles() error
- func (a *Articles) Edit() error
- func (a *Articles) EditArticle(article string) *Articles
- func (a *Articles) EditAttachments(attachments []string) *Articles
- func (a *Articles) EditNSFW(nsfw bool) *Articles
- func (a *Articles) EditSummary(summary string) *Articles
- func (a *Articles) EditTags(tags []string) *Articles
- func (a *Articles) EditTitle(title string) *Articles
- func (a *Articles) EditVisibility(visibility int64) *Articles
- func (a *Articles) Get() (*Articles, error)
- func (a *Articles) GetArticles() ([]*Articles, error)
- type Attachments
- type Editor
Constants ¶
View Source
const (
ArticleTable = "articles"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Article ¶
type Article interface { // Create is a method for creating an article. Create() (*Articles, error) // Get is a method for getting an article. Get() (*Articles, error) // GetArticles is a method for getting all articles by actor. GetArticles() ([]*Articles, error) Edit() error // Delete is a method for deleting an article. Delete() error // DeleteArticles is a method for deleting all articles by actor. DeleteArticles() error }
type Articles ¶
type Articles struct { gorm.Model ActorId uint `gorm:"primaryKey;type:bigint;actor_id"` Title string `gorm:"type:text;title"` Summary string `gorm:"type:text;summary"` // Article The content of the article or status, // it needs to store the text in html format, // but please be aware of XSS attacks. Article string `gorm:"type:text;article"` // Tags When the content is an article (status is false), // the tag of the article should be selected. Tags pq.StringArray `gorm:"type:text[];tags"` // Statuses sets whether the content is an article or a status. // Long text in HVXAHV means article, which will have to have title, // summary, and tags. Short articles are represented as statuses, // and statuses will not allow title summaries and tags to be added. Statuses bool `gorm:"type:boolean;statuses"` //// NSFW Sets whether the content of a post or status is NSFW. NSFW bool `gorm:"type:boolean;nsfw"` Attachments pq.StringArray `gorm:"type:text[];attachments"` // TO This field stores a slice of the recipient's address, // which can be multiple addresses or a single address. // If the slice is empty, it is sent to all followers. TO pq.StringArray `gorm:"type:text[];to"` // CC This field stores the sliced inbox address of the person being copied. CC pq.StringArray `gorm:"type:text[];cc"` BTO pq.StringArray `gorm:"type:text[];bto"` // Audience means the audience sent to the channel, // when submitting a post, if it needs to be synced to the channel, // the synced channel id will be sent to this field. Audience pq.Int64Array `gorm:"type:integer[];audience"` // Visibility setting for the article or status content, this field is // set to int type. // 0 is visible to everyone. // 1 is only visible to friends who follow each other. // 2 is only visible to yourself. Visibility int64 `gorm:"type:bigint;visibility"` }
func NewArticlesActorId ¶
NewArticlesActorId is a constructor for ArticlesActorId.
func NewArticlesDelete ¶
func NewArticlesId ¶
NewArticlesId is a constructor for ArticlesId.
func (*Articles) DeleteArticles ¶
func (*Articles) EditArticle ¶
func (*Articles) EditAttachments ¶
func (*Articles) EditSummary ¶
func (*Articles) EditVisibility ¶
func (*Articles) GetArticles ¶
type Attachments ¶
type Editor ¶
type Editor interface { // EditTitle is a method for editing the title of an article. EditTitle(title string) *Articles // EditSummary is a method for editing the summary of an article. EditSummary(summary string) *Articles // EditArticle is a method for editing the article of an article. EditArticle(article string) *Articles // EditTags is a method for editing the tags of an article. EditTags(tags []string) *Articles // EditAttachmentType is a method for editing the attachment article. EditAttachmentType(attachmentType string) *Articles // EditAttachments is a method for editing the attachments of an article. EditAttachments(attachments []string) *Articles // EditNSFW is a method for editing the nsfw of an article. EditNSFW(nsfw bool) *Articles // EditVisibility is a method for editing the visibility of an article. EditVisibility(visibility uint) *Articles }
Click to show internal directories.
Click to hide internal directories.