operation.go
1package bug
2
3type OperationType int
4
5const (
6 UNKNOWN OperationType = iota
7 CREATE
8 SET_TITLE
9 ADD_COMMENT
10)
11
12type Operation interface {
13 OpType() OperationType
14 Apply(snapshot Snapshot) Snapshot
15}
16
17type OpBase struct {
18 OperationType OperationType
19}
20
21func (op OpBase) OpType() OperationType {
22 return op.OperationType
23}