+// CompatibilityError is the error type usually returned by CheckCompatibility
+// method of Channel. It describes all of the incompatible messages.
+type CompatibilityError struct {
+ // IncompatibleMessages is the list of all messages
+ // that failed compatibility check.
+ IncompatibleMessages []string
+}
+
+func (c *CompatibilityError) Error() string {
+ return fmt.Sprintf("%d incompatible messages: %v", len(c.IncompatibleMessages), c.IncompatibleMessages)
+}
+
+var (
+ registeredMessageTypes = make(map[reflect.Type]string)
+ registeredMessages = make(map[string]Message)
+)