2016-06-23 04:56:44 +00:00
|
|
|
[
|
|
|
|
{
|
|
|
|
"name": "Bool",
|
|
|
|
"type": "bool",
|
|
|
|
"value": false,
|
2019-08-03 16:45:43 +00:00
|
|
|
"dest": true,
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "false",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "strconv.ParseBool(f.Value.String())",
|
|
|
|
"valueString": "return \"\""
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "BoolT",
|
|
|
|
"type": "bool",
|
|
|
|
"value": false,
|
2019-08-03 16:45:43 +00:00
|
|
|
"dest": true,
|
2016-06-23 04:56:44 +00:00
|
|
|
"doctail": " that is true by default",
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "false",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "strconv.ParseBool(f.Value.String())",
|
|
|
|
"valueString": "return \"\""
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Duration",
|
|
|
|
"type": "time.Duration",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
|
|
|
"dest": true,
|
2016-06-23 04:56:44 +00:00
|
|
|
"doctail": " (see https://golang.org/pkg/time/#ParseDuration)",
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "0",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "time.ParseDuration(f.Value.String())",
|
|
|
|
"valueString": "return f.Value.String()"
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Float64",
|
|
|
|
"type": "float64",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
|
|
|
"dest": true,
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "0",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "strconv.ParseFloat(f.Value.String(), 64)",
|
|
|
|
"valueString": "return fmt.Sprintf(\"%f\", f.Value)"
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Generic",
|
|
|
|
"type": "Generic",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
2016-06-23 04:56:44 +00:00
|
|
|
"dest": false,
|
|
|
|
"context_default": "nil",
|
2019-08-03 10:41:50 +00:00
|
|
|
"context_type": "interface{}",
|
|
|
|
"valueString": "if f.Value != nil {\n\t\treturn f.Value.String()\n\t}\n\treturn \"\""
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Int64",
|
|
|
|
"type": "int64",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
|
|
|
"dest": true,
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "0",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "strconv.ParseInt(f.Value.String(), 0, 64)",
|
|
|
|
"valueString": "return fmt.Sprintf(\"%d\", f.Value)"
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Int",
|
|
|
|
"type": "int",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
|
|
|
"dest": true,
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "0",
|
|
|
|
"parser": "strconv.ParseInt(f.Value.String(), 0, 64)",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser_cast": "int(parsed)",
|
|
|
|
"valueString": "return fmt.Sprintf(\"%d\", f.Value)"
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "IntSlice",
|
|
|
|
"type": "*IntSlice",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
2016-06-23 04:56:44 +00:00
|
|
|
"dest": false,
|
|
|
|
"context_default": "nil",
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_type": "[]int",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "(f.Value.(*IntSlice)).Value(), error(nil)",
|
|
|
|
"valueString": "if f.Value != nil {\n\t\treturn f.Value.String()\n\t}\n\treturn \"\""
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Int64Slice",
|
|
|
|
"type": "*Int64Slice",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
2016-06-23 04:56:44 +00:00
|
|
|
"dest": false,
|
|
|
|
"context_default": "nil",
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_type": "[]int64",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "(f.Value.(*Int64Slice)).Value(), error(nil)",
|
|
|
|
"valueString": "if f.Value != nil {\n\t\treturn f.Value.String()\n\t}\n\treturn \"\""
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "String",
|
|
|
|
"type": "string",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
|
|
|
"dest": true,
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "\"\"",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "f.Value.String(), error(nil)",
|
|
|
|
"valueString": "return f.Value"
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "StringSlice",
|
|
|
|
"type": "*StringSlice",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
2016-06-23 04:56:44 +00:00
|
|
|
"dest": false,
|
|
|
|
"context_default": "nil",
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_type": "[]string",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "(f.Value.(*StringSlice)).Value(), error(nil)",
|
|
|
|
"valueString": "if f.Value != nil {\n\t\treturn f.Value.String()\n\t}\n\treturn \"\""
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Uint64",
|
|
|
|
"type": "uint64",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
|
|
|
"dest": true,
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "0",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser": "strconv.ParseUint(f.Value.String(), 0, 64)",
|
|
|
|
"valueString": "return fmt.Sprintf(\"%d\", f.Value)"
|
2016-06-23 04:56:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Uint",
|
|
|
|
"type": "uint",
|
2019-08-03 16:45:43 +00:00
|
|
|
"value": true,
|
|
|
|
"dest": true,
|
2016-07-10 16:50:57 +00:00
|
|
|
"context_default": "0",
|
|
|
|
"parser": "strconv.ParseUint(f.Value.String(), 0, 64)",
|
2019-08-03 10:41:50 +00:00
|
|
|
"parser_cast": "uint(parsed)",
|
|
|
|
"valueString": "return fmt.Sprintf(\"%d\", f.Value)"
|
2016-06-23 04:56:44 +00:00
|
|
|
}
|
|
|
|
]
|