thread

package
v0.0.0-...-8495beb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package thread provides APIs for working with threads which are sequences of posts. Threads can be created with one post, listed, searched and updated.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build() fx.Option

Types

type Service

type Service interface {
	// Create a new thread in the specified category.
	Create(
		ctx context.Context,
		title string,
		body string,
		authorID account.AccountID,
		categoryID category.CategoryID,
		tags []string,
	) (*thread.Thread, error)

	// ListAll returns all threads.
	ListAll(
		ctx context.Context,
		before time.Time,
		max int,
	) ([]*thread.Thread, error)

	// Get one thread and the posts within it.
	Get(
		ctx context.Context,
		threadID post.PostID,
	) (*thread.Thread, error)
}

func New

func New(
	l *zap.Logger,
	rbac *restrict.AccessManager,

	account_repo account.Repository,
	thread_repo thread.Repository,
) Service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL