Documentation
¶
Index ¶
Constants ¶
View Source
const MaxContentLength = 280 // twitter
MaxContentLength is the maximum length of content for a news item.
View Source
const OptOutTag = "#private"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NewsAuthor ¶
type NewsAuthor struct {
Username string `json:"username"`
}
NewsAuthor represents the author of a news item.
type NewsContent ¶
type NewsContent string
NewsContent represents the content of a news item.
func (*NewsContent) Sanitize ¶
func (c *NewsContent) Sanitize()
Sanitize sanitizes the content. It does the necessary whitespace stripping.
func (NewsContent) String ¶
func (c NewsContent) String() string
String returns the string representation of the NewsContent.
func (*NewsContent) Validate ¶
func (c *NewsContent) Validate() error
type NewsItem ¶
type NewsItem struct { ID int32 `json:"id"` CreatedAt time.Time `json:"created_at"` EditedAt *time.Time `json:"edited_at,omitempty"` Author *NewsAuthor `json:"author"` Content NewsContent `json:"content"` ThumbnailURL string `json:"thumbnail_url,omitempty"` ThumbnailURLSmall string `json:"thumbnail_url_small,omitempty"` TracTicketID int32 `json:"trac_ticket_id,omitempty"` }
NewsItem represents a single news item in the news feed.
type PostFromMatrixArgs ¶
func (PostFromMatrixArgs) Kind ¶
func (PostFromMatrixArgs) Kind() string
type PostFromMatrixWorker ¶
type PostFromMatrixWorker struct { river.WorkerDefaults[PostFromMatrixArgs] }
func (*PostFromMatrixWorker) Work ¶
func (w *PostFromMatrixWorker) Work(ctx context.Context, job *river.Job[PostFromMatrixArgs]) error
type PostToMatrixArgs ¶
type PostToMatrixArgs struct { ItemID int32 // ViaMatrix, if true, indicates that the post is being made via Matrix. // Then, the message won't be bridged to the primary news feed room. ViaMatrix bool }
PostToMatrixArgs is the arguments for the PostNewsFeed job. It is also the argument for the message templates.
func (PostToMatrixArgs) Kind ¶
func (PostToMatrixArgs) Kind() string
type PostToMatrixWorker ¶
type PostToMatrixWorker struct { river.WorkerDefaults[PostToMatrixArgs] }
func (*PostToMatrixWorker) Work ¶
func (w *PostToMatrixWorker) Work(ctx context.Context, job *river.Job[PostToMatrixArgs]) error
Click to show internal directories.
Click to hide internal directories.