agent/api/container/transport.go
func (tp *TransportProtocol) UnmarshalJSON(b []byte) error {
	if strings.ToLower(string(b)) == "null" {
		*tp = TransportProtocolTCP
		seelog.Warn("Unmarshalled nil TransportProtocol as TCP")
		return nil
	}
	switch string(b) {
	case `"tcp"`:
		*tp = TransportProtocolTCP
	case `"udp"`:
		*tp = TransportProtocolUDP
	default:
		*tp = TransportProtocolTCP
		return errors.New("TransportProtocol must be \"tcp\" or \"udp\"; Got " + string(b))
	}
	return nil
}
func (tp *TransportProtocol) UnmarshalJSON(b []byte) error {
	if strings.ToLower(string(b)) == "null" {
		*tp = TransportProtocolTCP
		seelog.Warn("Unmarshalled nil TransportProtocol as TCP")
		return nil
	}
	switch string(b) {
	case `"tcp"`:
		*tp = TransportProtocolTCP
	case `"udp"`:
		*tp = TransportProtocolUDP
	default:
		*tp = TransportProtocolTCP
		return errors.New("TransportProtocol must be \"tcp\" or \"udp\"; Got " + string(b))
	}
	return nil
}
func ( tp * TransportProtocol ) UnmarshalJSON ( b [ ] byte ) error { if strings . ToLower ( string ( b ) ) == " " { * tp = TransportProtocolTCP seelog . Warn ( " " ) return nil } switch string ( b ) { case `"tcp"` : * tp = TransportProtocolTCP case `"udp"` : * tp = TransportProtocolUDP default : * tp = TransportProtocolTCP return errors . New ( " \" \" \" \" " + string ( b ) ) } return nil }
// UnmarshalJSON for TransportProtocol determines whether to use TCP or UDP,
// setting TCP as the zero-value but treating other unrecognized values as
// errors
UnmarshalJSON for TransportProtocol determines whether to use TCP or UDP setting TCP as the zero - value but treating other unrecognized values as errors