func (s *SignalSchema) normalize() error {
	s.signalSchema.Name = strings.ToLower(s.signalSchema.Name)
	var err error
	if len(s.signalSchema.Regex) > 0 {
		s.signalSchema.Regex = "(?i)" + s.signalSchema.Regex
		s.regex, err = regexp.Compile(s.signalSchema.Regex)
	}
	return err
}
normalizes s by downcasing its name, making its regex case-insensitive,
and compiling the latter. Returns an error if the regex fails compilation.
package plugin
import (
	"encoding/json"
	"regexp"
	"strings"
)
type SignalSchema struct {
	signalSchema
	regex *regexp.Regexp
}
func (s *SignalSchema) Name() string {
	return s.signalSchema.Name
}
func (s *SignalSchema) SetName(name string) *SignalSchema {
	s.signalSchema.Name = name
	return s
}
func (s *SignalSchema) Description() string {
	return s.signalSchema.Description
}
func (s *SignalSchema) SetDescription(description string) *SignalSchema {
	s.signalSchema.Description = description
	return s
}
func (s *SignalSchema) Regex() *regexp.Regexp {
	return s.regex
}
func (s *SignalSchema) SetRegex(regex *regexp.Regexp) *SignalSchema {
	s.regex = regex
	s.signalSchema.Regex = regex.String()
	return s
}
func (s *SignalSchema) IsGroup() bool {
	return s.Regex() != nil
}
func (s SignalSchema) MarshalJSON() ([]byte, error) {
	return json.Marshal(s.signalSchema)
}
func (s *SignalSchema) UnmarshalJSON(bytes []byte) error {
	err := json.Unmarshal(bytes, &s.signalSchema)
	if err != nil {
		return err
	}
	return s.normalize()
}