...

Package thread

import "vminko.org/dscuss/thread"
Overview
Index

Overview ▾

type ModeratingHandler

type ModeratingHandler interface {
    Handle(n *Node) (*entity.Message, error)
}

type ModeratingVisitor

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

func NewModeratingVisitor

func NewModeratingVisitor(handler ModeratingHandler) *ModeratingVisitor

func (*ModeratingVisitor) Visit

func (mv *ModeratingVisitor) Visit(n *Node) (*Node, error)

type Node

type Node struct {
    Msg      *entity.Message
    Children []*Node
    Parent   *Node
}

func New

func New(m *entity.Message) *Node

func (*Node) AddChild

func (n *Node) AddChild(child *Node)

func (*Node) AddReply

func (n *Node) AddReply(m *entity.Message) *Node

func (*Node) Depth

func (n *Node) Depth() int

func (*Node) IsRoot

func (n *Node) IsRoot() bool

func (*Node) Moderate

func (n *Node) Moderate(visitor *ModeratingVisitor) (*Node, error)

func (*Node) View

func (n *Node) View(visitor *ViewingVisitor)

type ViewingHandler

type ViewingHandler interface {
    Handle(n *Node) bool
}

type ViewingVisitor

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

func NewViewingVisitor

func NewViewingVisitor(handler ViewingHandler) *ViewingVisitor

func (*ViewingVisitor) Visit

func (vv *ViewingVisitor) Visit(n *Node) bool