Documentation ¶
Index ¶
Constants ¶
View Source
const Name = "Thread"
Variables ¶
View Source
var ( ErrNoTitle = errors.New("missing title") ErrNoBody = errors.New("missing body") )
Functions ¶
Types ¶
type Repository ¶
type Repository interface { // Create a new thread. A thread is just a "post" in the underlying data // model. But a thread is marked as "first" and has a title, catgegory and // tags, and no parent post. Create( ctx context.Context, title string, body string, authorID account.AccountID, categoryID category.CategoryID, tags []string, opts ...option, ) (*Thread, error) List( ctx context.Context, before time.Time, max int, ) ([]*Thread, error) Get(ctx context.Context, threadID post.PostID) (*Thread, error) }
func New ¶
func New(db *model.Client) Repository
type Thread ¶
type Thread struct { ID post.PostID CreatedAt time.Time UpdatedAt time.Time DeletedAt optional.Optional[time.Time] Title string Slug string Short string Pinned bool Author AuthorRef Tags []string Category category.Category Posts []*post.Post Reacts []*react.React }
func (*Thread) GetResourceName ¶
Click to show internal directories.
Click to hide internal directories.