UnmarshalText unmarshals text to a DurationEncoder. "string" is unmarshaled to StringDurationEncoder, and anything else is unmarshaled to NanosDurationEncoder.
(text []byte)
| 257 | // to StringDurationEncoder, and anything else is unmarshaled to |
| 258 | // NanosDurationEncoder. |
| 259 | func (e *DurationEncoder) UnmarshalText(text []byte) error { |
| 260 | switch string(text) { |
| 261 | case "string": |
| 262 | *e = StringDurationEncoder |
| 263 | case "nanos": |
| 264 | *e = NanosDurationEncoder |
| 265 | case "ms": |
| 266 | *e = MillisDurationEncoder |
| 267 | default: |
| 268 | *e = SecondsDurationEncoder |
| 269 | } |
| 270 | return nil |
| 271 | } |
| 272 | |
| 273 | // A CallerEncoder serializes an EntryCaller to a primitive type. |
| 274 | // |
no outgoing calls