aboutsummaryrefslogblamecommitdiffstats
path: root/bug/operation.go
blob: 591c71769862e5013feaf8a7ac553d1406d46485 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
           











                                   
                                         
 







                                               
package bug

type OperationType int

const (
	UNKNOW OperationType = iota
	CREATE
	SET_TITLE
	ADD_COMMENT
)

type Operation interface {
	OpType() OperationType
	Apply(snapshot Snapshot) Snapshot
}

type OpBase struct {
	OperationType OperationType `json:"op"`
}

func (op OpBase) OpType() OperationType {
	return op.OperationType
}