git-bug/bug/operation.go

24 lines
321 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 (
UNKNOWN OperationType = iota
2018-07-12 22:31:41 +03:00
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
}
func (op OpBase) OpType() OperationType {
return op.OperationType
}