thread

package
v0.0.0-...-aeea160 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoWorkspaceID       = rerror.NewE(i18n.T("workspace id is required"))
	ErrCommentAlreadyExist = rerror.NewE(i18n.T("comment already exist in this thread"))
	ErrCommentDoesNotExist = rerror.NewE(i18n.T("comment does not exist in this thread"))
)
View Source
var CommentIDFrom = id.CommentIDFrom
View Source
var CommentIDFromRef = id.CommentIDFromRef
View Source
var ErrInvalidID = id.ErrInvalidID
View Source
var IDFrom = id.ThreadIDFrom
View Source
var IDFromRef = id.ThreadIDFromRef
View Source
var MustCommentID = id.MustCommentID
View Source
var MustID = id.MustThreadID
View Source
var MustUserID = id.MustUserID
View Source
var MustWorkspaceID = id.MustWorkspaceID
View Source
var NewCommentID = id.NewCommentID
View Source
var NewID = id.NewThreadID
View Source
var WorkspaceIDFrom = id.WorkspaceIDFrom
View Source
var WorkspaceIDFromRef = id.WorkspaceIDFromRef

Functions

This section is empty.

Types

type Builder

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

func New

func New() *Builder

func (*Builder) Build

func (b *Builder) Build() (*Thread, error)

func (*Builder) Comments

func (b *Builder) Comments(c []*Comment) *Builder

func (*Builder) ID

func (b *Builder) ID(id ID) *Builder

func (*Builder) MustBuild

func (b *Builder) MustBuild() *Thread

func (*Builder) NewID

func (b *Builder) NewID() *Builder

func (*Builder) Workspace

func (b *Builder) Workspace(wid accountdomain.WorkspaceID) *Builder

type Comment

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

func NewComment

func NewComment(id CommentID, author operator.Operator, content string) *Comment

func (*Comment) Author

func (c *Comment) Author() operator.Operator

func (*Comment) Clone

func (c *Comment) Clone() *Comment

func (*Comment) Content

func (c *Comment) Content() string

func (*Comment) CreatedAt

func (c *Comment) CreatedAt() time.Time

func (*Comment) ID

func (c *Comment) ID() CommentID

func (*Comment) SetContent

func (c *Comment) SetContent(content string)

type CommentID

type CommentID = id.CommentID

type ID

type ID = id.ThreadID

type List

type List []*Thread

func (List) Clone

func (l List) Clone() List

func (List) SortByID

func (l List) SortByID() List

type Thread

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

func (*Thread) AddComment

func (th *Thread) AddComment(c *Comment) error

func (*Thread) Clone

func (th *Thread) Clone() *Thread

func (*Thread) Comment

func (th *Thread) Comment(cid id.CommentID) *Comment

func (*Thread) Comments

func (th *Thread) Comments() []*Comment

func (*Thread) DeleteComment

func (th *Thread) DeleteComment(cid id.CommentID) error

func (*Thread) HasComment

func (th *Thread) HasComment(cid CommentID) bool

func (*Thread) ID

func (th *Thread) ID() ID

func (*Thread) SetComments

func (th *Thread) SetComments(comments ...*Comment)

func (*Thread) UpdateComment

func (th *Thread) UpdateComment(cid id.CommentID, content string) error

func (*Thread) Workspace

func (th *Thread) Workspace() accountdomain.WorkspaceID

type UserID

type UserID = accountdomain.UserID

type WorkspaceID

type WorkspaceID = id.WorkspaceID

Jump to

Keyboard shortcuts

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