mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-18 07:13:50 +01:00
27 lines
416 B
Go
27 lines
416 B
Go
package watcher
|
|
|
|
import "fmt"
|
|
|
|
type (
|
|
Event struct {
|
|
ActorName string
|
|
Action Action
|
|
}
|
|
Action string
|
|
)
|
|
|
|
const (
|
|
ActionModified Action = "MODIFIED"
|
|
ActionCreated Action = "CREATED"
|
|
ActionStarted Action = "STARTED"
|
|
ActionDeleted Action = "DELETED"
|
|
)
|
|
|
|
func (e Event) String() string {
|
|
return fmt.Sprintf("%s %s", e.ActorName, e.Action)
|
|
}
|
|
|
|
func (a Action) IsDelete() bool {
|
|
return a == ActionDeleted
|
|
}
|