discussion

package
v0.0.0-...-943fa91 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Persisted bool

	ID        string
	UserID    string
	Name      string
	AvatarURL string
}

func (*Author) Clone

func (a *Author) Clone() *Author

type Comment

type Comment struct {
	ID        string
	SubjectID string
	AuthorID  string
	Author    *Author
	Markdown  string
	HTML      string
	CreatedAt time.Time
	Replies   []*Comment
}

func (*Comment) Clone

func (c *Comment) Clone() *Comment

type CommentRepo

type CommentRepo interface {
	SaveAuthor(ctx context.Context, author *Author) error
	GetAuthorByID(ctx context.Context, id string) (*Author, error)
	GetAuthorByUserID(ctx context.Context, userID string) (*Author, error)
	GetCommentsAndRepliesRecursively(ctx context.Context, subjectID string) ([]*Comment, error)
}

type ListCommentsUseCase

type ListCommentsUseCase struct {
	// contains filtered or unexported fields
}

func NewListCommentsUseCase

func NewListCommentsUseCase(commentRepo CommentRepo) *ListCommentsUseCase

func (*ListCommentsUseCase) Run

func (u *ListCommentsUseCase) Run(ctx context.Context, subjectID string) ([]*Comment, error)

type SaveAuthorInput

type SaveAuthorInput struct {
	UserID    string
	Name      string
	AvatarURL string
}

type SaveAuthorUseCase

type SaveAuthorUseCase struct {
	// contains filtered or unexported fields
}

func NewSaveAuthorUseCase

func NewSaveAuthorUseCase(commentRepo CommentRepo, txManager shared.TransactionManager, idGen shared.IDGenerator) *SaveAuthorUseCase

func (*SaveAuthorUseCase) Run

func (u *SaveAuthorUseCase) Run(ctx context.Context, input SaveAuthorInput) (author *Author, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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