func()

in proxy/ingress/servicecomb/listener.go [30:59]


func (r *ingressRuleEventListener) Event(e *event.Event) {
	if e == nil {
		openlog.Warn("Event pointer is nil")
		return
	}
	openlog.Info("dark launch event", openlog.WithTags(openlog.Tags{
		"key":   e.Key,
		"event": e.EventType,
		"rule":  e.Value,
	}))
	raw, ok := e.Value.(string)
	if !ok {
		openlog.Error("invalid ingress rule", openlog.WithTags(openlog.Tags{
			"value": raw,
		}))
	}
	switch e.EventType {
	case common.Update:
		saveRules(raw)
	case common.Create:
		saveRules(raw)
	case common.Delete:
		rulesData = nil
		openlog.Info("ingress rule is removed", openlog.WithTags(
			openlog.Tags{
				"key": e.Key,
			}))
	}

}