func (n *RemoveNewsroomWatchersTrigger) Run(collector *EventCollector,
	event *model.Event) error {
	if !n.ShouldRun(collector, event) {
		return errors.New("RemoveNewsroomWatchersTriggershould not run")
	}
	newsroomAddr := event.EventPayload()["ListingAddress"].(common.Address)
	err := collector.RemoveWatchers(
		watcher.NewNewsroomContractWatchers(newsroomAddr),
	)
	if err != nil {
		return errors.WithMessage(err, "error removing watchers")
	}
	log.Infof("Removing watchers for newsroom at address: %v", newsroomAddr.Hex())
	return nil
}
Run returns the triggered code
package eventcollector  
import (
	log "github.com/golang/glog"
	"github.com/pkg/errors"
	"github.com/ethereum/go-ethereum/common"
	"github.com/joincivil/civil-events-crawler/pkg/generated/watcher"
	"github.com/joincivil/civil-events-crawler/pkg/model"
)
type AddNewsroomWatchersTrigger struct{}
func (n *AddNewsroomWatchersTrigger) Description() string {
	return "Start watching for newsroom events on TCR whitelisting events"
}
func (n *AddNewsroomWatchersTrigger) ShouldRun(collector *EventCollector,
	event *model.Event) bool {
	return event.EventType() == "Application"
}
func (n *AddNewsroomWatchersTrigger) Run(collector *EventCollector,
	event *model.Event) error {
	if !n.ShouldRun(collector, event) {
		return errors.New("AddNewsroomWatchersTrigger should not run")
	}
	newsroomAddr := event.EventPayload()["ListingAddress"].(common.Address)
	err := collector.AddWatchers(
		watcher.NewNewsroomContractWatchers(newsroomAddr),
	)
	if err != nil {
		return errors.WithMessage(err, "error adding watchers")
	}
	log.Infof("Adding watchers for newsroom at address: %v", newsroomAddr.Hex())
	return nil
}
type RemoveNewsroomWatchersTrigger struct{}
func (n *RemoveNewsroomWatchersTrigger) Description() string {
	return "Remove watching of newsroom events"
}
func (n *RemoveNewsroomWatchersTrigger) ShouldRun(collector *EventCollector,
	event *model.Event) bool {
	return event.EventType() == "ListingRemoved"
}