| 1 |
package decoder |
| 2 |
|
| 3 |
import "context" |
| 4 |
|
| 5 |
type OptionFlags uint8 |
| 6 |
|
| 7 |
const ( |
| 8 |
FirstWinOption OptionFlags = 1 << iota |
| 9 |
ContextOption |
| 10 |
PathOption |
| 11 |
// UseNumberOption decodes a number into interface{} as json.Number instead of float64. |
| 12 |
UseNumberOption |
| 13 |
// DisallowUnknownFieldsOption makes an object key which matches no field of the struct an error. |
| 14 |
DisallowUnknownFieldsOption |
| 15 |
// NoCopyStringOption makes the decoded strings refer to the input instead of a copy of their bytes. |
| 16 |
NoCopyStringOption |
| 17 |
) |
| 18 |
|
| 19 |
type Option struct { |
| 20 |
Flags OptionFlags |
| 21 |
Context context.Context |
| 22 |
Path *Path |
| 23 |
} |