FormatCodeForOID returns the preferred format code for type oid. If the type is not registered it returns the text format code.
(oid uint32)
| 343 | // FormatCodeForOID returns the preferred format code for type oid. If the type is not registered it returns the text |
| 344 | // format code. |
| 345 | func (m *Map) FormatCodeForOID(oid uint32) int16 { |
| 346 | if fc, ok := m.oidToFormatCode[oid]; ok { |
| 347 | return fc |
| 348 | } |
| 349 | |
| 350 | if fc, ok := defaultMap.oidToFormatCode[oid]; ok { |
| 351 | return fc |
| 352 | } |
| 353 | |
| 354 | return TextFormatCode |
| 355 | } |
| 356 | |
| 357 | // EncodePlan is a precompiled plan to encode a particular type into a particular OID and format. |
| 358 | type EncodePlan interface { |
no outgoing calls