operation.go

 1package bug
 2
 3type OperationType int
 4
 5const (
 6	_ OperationType = iota
 7	CreateOp
 8	SetTitleOp
 9	AddCommentOp
10	SetStatusOp
11)
12
13type Operation interface {
14	OpType() OperationType
15	Apply(snapshot Snapshot) Snapshot
16}
17
18type OpBase struct {
19	OperationType OperationType
20}
21
22func (op OpBase) OpType() OperationType {
23	return op.OperationType
24}