receiver/kafka/kafka.go
func (p *Protocol) UnmarshalText(text []byte) error {
	protocolName := string(text)

	switch strings.ToLower(protocolName) {
	case "plain":
		*p = ProtocolPlain
	case "protobuf":
		*p = ProtocolProtobuf
	case "pickle":
		*p = ProtocolPickle
	default:
		return fmt.Errorf("Unsupported protocol type %v, supported: %v", protocolName, supportedProtocols)
	}
	return nil
}
func (p *Protocol) UnmarshalText(text []byte) error {
	protocolName := string(text)

	switch strings.ToLower(protocolName) {
	case "plain":
		*p = ProtocolPlain
	case "protobuf":
		*p = ProtocolProtobuf
	case "pickle":
		*p = ProtocolPickle
	default:
		return fmt.Errorf("Unsupported protocol type %v, supported: %v", protocolName, supportedProtocols)
	}
	return nil
}
func ( p * Protocol ) UnmarshalText ( text [ ] byte ) error { protocolName := string ( text ) switch strings . ToLower ( protocolName ) { case " " : * p = ProtocolPlain case " " : * p = ProtocolProtobuf case " " : * p = ProtocolPickle default : return fmt . Errorf ( " " , protocolName , supportedProtocols ) } return nil }
// UnmarshalText converts text from config file to a enum.
UnmarshalText converts text from config file to a enum .