git-bug/bug/operation.go

24 lines
332 B
Go
Raw Normal View History

2018-07-13 17:13:40 +03:00
package bug
2018-07-12 22:31:41 +03:00
type OperationType int
const (
UNKNOW OperationType = iota
CREATE
SET_TITLE
ADD_COMMENT
)
type Operation interface {
OpType() OperationType
2018-07-13 17:13:40 +03:00
Apply(snapshot Snapshot) Snapshot
2018-07-12 22:31:41 +03:00
}
type OpBase struct {
OperationType OperationType `json:"op"`
}
func (op OpBase) OpType() OperationType {
return op.OperationType
}