From 6716581ab438d0d3a028a31f2a9b387b037f79d7 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Wed, 30 Dec 2020 13:05:03 +0200 Subject: [PATCH] entc/gen: handle default funcs in runtime tempalte (#1102) --- entc/gen/internal/bindata.go | 12 +- entc/gen/template/builder/create.tmpl | 2 +- entc/gen/template/meta.tmpl | 2 +- entc/gen/template/runtime.tmpl | 2 +- entc/integration/ent/entql.go | 6 + entc/integration/ent/migrate/schema.go | 7 +- entc/integration/ent/mutation.go | 76 +++++++++- entc/integration/ent/runtime.go | 4 + entc/integration/ent/schema/user.go | 3 + entc/integration/ent/user.go | 12 +- entc/integration/ent/user/user.go | 5 + entc/integration/ent/user/where.go | 132 ++++++++++++++++++ entc/integration/ent/user_create.go | 26 ++++ entc/integration/ent/user_update.go | 66 +++++++++ entc/integration/gremlin/ent/mutation.go | 76 +++++++++- entc/integration/gremlin/ent/runtime.go | 4 + entc/integration/gremlin/ent/user.go | 8 ++ entc/integration/gremlin/ent/user/user.go | 4 + entc/integration/gremlin/ent/user/where.go | 106 ++++++++++++++ entc/integration/gremlin/ent/user_create.go | 21 +++ entc/integration/gremlin/ent/user_update.go | 52 +++++++ entc/integration/migrate/entv2/runtime.go | 4 + entc/integration/migrate/entv2/schema/user.go | 3 +- entc/integration/migrate/entv2/user/user.go | 2 + entc/integration/migrate/entv2/user_create.go | 4 + schema/field/field.go | 14 +- schema/field/field_test.go | 3 +- 27 files changed, 633 insertions(+), 23 deletions(-) diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index a6567bf13..1f6a58408 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -150,7 +150,7 @@ func templateBaseTmpl() (*asset, error) { return a, nil } -var _templateBuilderCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x57\xd1\x6e\xdb\xb8\x12\x7d\x96\xbe\x62\x2a\x38\x17\x52\x90\xc8\x69\xdf\x6e\x0a\x5f\xa0\x4d\xd2\xdb\x00\xbb\xdd\xc5\x26\x29\x0a\xb4\x45\xc1\x48\x23\x9b\xb0\x4c\xa9\x24\xe5\x26\x30\xf4\xef\x8b\x19\x52\xb2\xe4\x78\x9b\xa4\xfb\x64\x5a\xe4\x0c\x39\x67\xce\x1c\x72\x36\x9b\xe9\x61\x78\x56\xd5\xf7\x5a\xce\x17\x16\x5e\x9d\xbc\xfc\xef\x71\xad\xd1\xa0\xb2\xf0\x4e\x64\x78\x5b\x55\x4b\xb8\x54\x59\x0a\x6f\xca\x12\x78\x91\x01\x9a\xd7\x6b\xcc\xd3\xf0\x7a\x21\x0d\x98\xaa\xd1\x19\x42\x56\xe5\x08\xd2\x40\x29\x33\x54\x06\x73\x68\x54\x8e\x1a\xec\x02\xe1\x4d\x2d\xb2\x05\xc2\xab\xf4\xa4\x9b\x85\xa2\x6a\x54\x1e\x4a\xc5\xf3\xbf\x5d\x9e\x5d\x7c\xb8\xba\x80\x42\x96\x08\xfe\x9b\xae\x2a\x0b\xb9\xd4\x98\xd9\x4a\xdf\x43\x55\x80\x1d\x6c\x66\x35\x62\x1a\x1e\x4e\xdb\x36\x0c\x37\x1b\xc8\xb1\x90\x0a\x21\xca\x34\x0a\x8b\x11\xb4\x2d\x7d\x9d\xd4\xcb\x39\x9c\xce\xe0\x56\x18\x84\x49\x7a\x56\xa9\x42\xce\xd3\x3f\x45\xb6\x14\x73\x04\x6f\x6a\x71\x55\x97\xc2\x22\x44\x0b\x14\x39\xea\x08\x26\x0f\xa7\xe4\xaa\xae\xb4\xed\xa6\xdc\x3f\x88\xc3\x60\xb3\x39\x06\x2d\xd4\x1c\x61\x52\x0b\xbb\xa0\xcd\x26\xe9\x95\xbc\x2d\xa5\x9a\x5f\xf2\x2a\x43\x16\x41\x10\xf1\x71\x68\x49\xdb\x46\xce\x0e\x55\x4e\x73\x09\x6f\x35\xb9\x6d\x64\x49\x70\xb1\x87\x33\x0e\xe3\x83\x58\x61\x17\x89\xc6\x0c\xe5\xda\xcd\xf7\xe3\xde\xc8\x2f\x5a\x35\x56\x58\x59\x29\x5a\x54\x6b\xa9\xec\xc0\x2e\x4a\xbb\x59\x46\x27\x9c\x4e\x61\xb8\x6d\xdb\x52\xea\x08\xf7\xee\x4b\x51\x69\x60\x38\xa5\x9a\x83\xe0\xc5\xa9\x3f\x11\xa0\xb2\xd2\xde\xa7\xa1\xbd\xaf\x71\xd7\x8d\xb1\xba\xc9\x2c\x6c\xc2\x20\x63\xbc\xc3\xa0\x3f\xd6\xe1\x66\x03\x30\x49\x7f\xf7\xff\xbb\xf8\x82\x45\x55\x2d\x0d\x7c\xfe\xfa\xbe\xaa\x96\xa1\x83\xfe\x87\xb4\x0b\xc0\x3b\x4b\x20\x4d\x20\x7a\xeb\xfc\x47\xa3\x90\x83\x51\x8a\x0c\x5a\x4b\x2b\x52\x8f\x86\x87\x97\x02\xbd\x12\x6b\x74\xb1\xa0\x8b\x71\x14\x8c\xe7\x5b\x2e\xac\x20\xa2\xa4\x61\xd1\xa8\x0c\xe2\x11\xea\x6d\xcb\x87\x1f\xec\x9e\xb0\xd7\x38\xb3\x77\x90\x55\xca\xe2\x9d\x25\x7e\xd1\x6f\x02\xf1\xe1\x70\x83\x23\x40\xad\x2b\x9d\x10\x24\x6b\xa1\x89\x36\x01\x6a\xed\xbe\x86\x41\xa0\xa8\x6e\x46\x16\x61\x90\x38\x8a\xc8\x02\x26\xe9\x7b\x61\xce\xb1\x10\x4d\x69\x1d\x95\x76\x0e\x96\xe6\x6e\xd2\xc4\xc9\x88\x57\x81\x2c\xa0\x44\xb5\x1b\x47\xca\x60\x27\x30\x9b\xc1\x09\x9d\x88\x96\xd1\x69\x66\xb0\xbb\x30\x5b\x60\xb6\x8c\x93\xd7\x3c\xfd\x62\x06\x4a\x96\x6c\x10\x68\xb4\x8d\x56\xf4\x9f\x43\x0b\x83\xa0\xf5\x61\x1c\xfd\x83\x2b\x0e\xee\xca\x56\xda\xd5\x5d\x87\x5c\x12\x06\x2d\x60\x69\x90\xfd\x12\x36\xab\xc6\x02\xd3\xa3\x22\x37\x3c\xc2\x77\x8d\xca\x62\xca\xc9\x3e\xb0\x8f\x60\x05\x1d\x9f\x12\x88\x3f\x8a\xb2\xc1\x21\xe0\x41\xcf\xbe\x23\xa8\x96\x54\x18\xab\xd4\xa7\x67\x87\x86\x09\x2d\x96\x05\xbc\xa8\x96\xce\x70\x14\x67\xb1\xb2\xe9\x05\x79\x2d\xe2\xa8\x51\x78\x57\x63\x66\x31\x87\x9e\xda\x5c\x09\x07\xd7\xd1\x11\xac\xd8\x51\xeb\xbd\x3d\x13\xda\x3d\xd8\x3a\x57\xa3\xf2\x6e\x5b\x98\xf5\x5b\xd3\xec\xaf\x61\xbf\xc5\x26\xcd\x2b\x85\x30\x03\xab\x1b\x1c\x66\xb8\x73\x4b\x29\x26\x03\xd2\x04\x49\x20\xfe\x84\x58\xc7\xf0\xf2\x35\x48\xf8\xdf\x0c\x4e\x5e\x83\x3c\x3e\xee\xb3\xb0\xe7\x6c\x6c\xf2\x59\x7e\x8d\x57\x8d\x4d\x3c\x8f\x64\x01\xdf\x5c\x2c\xa7\x1c\xa4\xcb\x13\x9f\xf9\x08\x76\x60\x78\x2a\x39\xdb\xf0\x61\x48\x5b\x69\xf8\x04\x99\x28\x4b\xe3\x64\x42\xa8\x1c\x6a\xa1\x64\x66\xa8\xfa\xf8\x93\x33\x35\x20\x94\x23\xd6\xb3\x14\xe2\xd3\x7e\x89\x18\xd5\x3b\x2b\x43\x1f\xf3\x2e\x48\x83\x8c\x79\x42\x0d\xe2\xe5\xa3\xc6\xa8\x75\x32\x8c\x72\xed\x54\xf4\x18\x26\x85\xc4\x32\x37\xee\x56\x79\xe7\xc6\x6d\xbb\xd9\x38\x65\xb9\x3c\x4f\x6f\x0c\xea\x73\xbe\x3c\x73\x37\xd1\x59\xcc\x40\xd4\x35\xab\xaf\xff\x40\xcb\xdd\x12\x2f\x30\x9d\x97\x1d\x7d\x9a\x4e\xa1\x53\x24\x30\x68\x9d\xe0\xfa\x2f\xb0\xa6\xfa\x34\xee\x32\xdf\x5e\x35\xb7\x58\x54\x1a\xc1\x88\x35\xa6\x61\xf0\x44\x70\xb7\xb2\xc7\x40\x0c\x6e\xe2\x82\xc3\x2d\xba\x68\x5d\xf9\xb0\x98\x56\x1a\x26\x45\x3a\x52\xd3\x8e\x70\x4e\x1c\x76\xf8\xc5\xc5\x53\xf4\x4a\xf1\x7f\x24\x23\xaa\xdb\xad\x48\x04\xeb\xce\x6e\xf0\xb0\xf0\x76\x7e\x23\x9f\x65\x87\xd7\xe8\x08\x24\x6d\xf4\xf7\xd2\x5c\xcb\x15\xba\xd1\xcd\x0d\xe3\x1c\x27\x5b\xa4\x79\x9f\xdd\xa3\x5d\xa1\x75\xbb\x5c\xf1\x85\xcb\xc9\x25\xbb\x35\x57\x76\xd0\x87\xdd\xfb\x18\xfe\xd9\xbd\x21\x59\x90\x40\x37\xc4\xf2\xb2\x74\x7f\x0d\xd7\x42\x63\x50\x1f\xe7\x9e\x21\x6b\x51\xca\x9c\xc4\xd9\x40\xa5\x86\x29\x7c\x72\x49\x78\xe5\x73\x85\x44\x10\xfe\x34\x6f\x3e\x6d\x74\x8e\x58\x55\x96\xa2\xfd\xa3\x26\x00\x44\x99\x40\xac\x18\x31\x46\x97\xb9\x4c\xa3\xc4\xe3\xf5\xef\x92\xea\xcb\xe8\x3f\x1f\x5d\xbc\xb2\x52\xac\xfd\x1b\xda\xe1\x14\x22\xe7\xc0\xa7\x35\xe2\xc2\x3d\x75\x11\x99\xf4\x03\xfe\x88\xa3\xee\xed\xd9\xb6\xa7\xb0\x92\xc6\xd0\x13\x4a\xe3\xf7\x46\x6a\xcc\x81\x03\x84\x2f\x63\x2f\x5f\xa2\x28\x69\x3b\xb5\x7f\x90\x36\x7e\x0d\x39\xe6\x7c\xdc\xa6\x80\xe9\x72\xa1\x9a\xd5\x36\xe6\xf5\x73\x63\xee\x43\x66\xb5\xb8\x15\x46\x66\x2e\x0b\xe9\x5b\x1a\x5f\xd3\xb5\x16\xad\xa3\x41\xad\x0c\x54\xea\x21\xe3\xfb\xd3\x91\x7b\xce\x3d\x7b\xdc\xab\xd4\xbf\x06\xf3\xf0\x22\x1e\xc2\xdc\x53\x13\x0a\x21\x4b\x82\x99\x86\xfb\xa1\x3e\x85\x83\x1f\xce\x9f\xc3\x3c\xd8\x8b\xfc\xee\xd8\xb3\x14\x9d\x98\x5e\xe4\x73\x1c\xb3\x94\x09\x8a\x3d\x41\xc7\xca\x33\xc1\xf4\x46\xc9\xef\x0d\x3e\x55\x75\x70\xa7\xae\x2f\xcf\x47\x14\xe5\xc3\xd1\xcb\x69\xeb\xae\xbb\x93\x1f\xf7\x64\xe2\x64\xf0\x00\x1c\xd3\xed\x49\x59\xc1\x5f\x26\x3f\xe6\x73\xf4\x09\xc1\x47\xb9\x3f\x1c\x6f\xef\xf5\x67\x76\x08\x13\xbb\xaa\xcb\xbe\x23\x2a\x20\xca\xa5\x28\x31\xb3\xd3\x03\x33\xed\xda\xc5\xe1\x03\x89\x8d\xee\xfa\xbe\xc2\x99\xef\x36\x15\x4e\xd6\xca\xe5\xd0\xef\x81\x71\x6d\xdb\xdb\xa6\x5c\x46\x10\xd7\xc2\x64\xa2\xf4\x97\x7c\xf2\xa0\x8f\x1b\xb7\x71\xe5\x72\xdc\x94\xf1\xff\x47\x3a\x32\x5e\x55\x15\x7b\x3a\x33\x89\x66\xd4\x9b\x39\x6f\x0f\x1b\x33\xef\x98\x5a\x2f\xd7\x9a\x0d\xa0\xe3\x20\xa7\x87\x70\xe9\xae\x6a\xe3\xf1\xc9\x35\x1f\xd9\x34\xb5\x6b\x6e\xd9\xb9\x3b\x14\x35\x78\x53\x1f\xe6\xa3\x98\x7f\xbb\x65\x94\x46\xc0\xbb\x0b\x72\x21\xcc\xf5\x18\x7c\x9f\x93\x9f\x24\xbc\x5c\x42\xf4\x97\x87\x33\x1a\xdd\x40\xae\x5f\xda\x9b\xce\x60\xf4\x94\x79\x30\xfa\x3b\x00\x00\xff\xff\xf3\xd3\x3c\xd4\x1a\x11\x00\x00") +var _templateBuilderCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x57\x51\x6f\xdb\x36\x10\x7e\x96\x7e\xc5\x55\x70\x06\x29\x48\xe4\xb4\x6f\x4b\xe1\x01\x6d\x92\xae\x01\xb6\x6e\x58\xd2\xa2\x40\x5b\x14\x8c\x74\xb2\x09\xcb\x94\x4a\x52\x6e\x02\x43\xff\x7d\xb8\x23\x25\x4b\x8e\xd7\x24\xdd\x93\x69\x91\x77\xe4\x7d\xf7\xdd\x47\xde\x66\x33\x3d\x0c\xcf\xaa\xfa\x4e\xcb\xf9\xc2\xc2\x8b\x93\xe7\xbf\x1e\xd7\x1a\x0d\x2a\x0b\x6f\x44\x86\x37\x55\xb5\x84\x4b\x95\xa5\xf0\xaa\x2c\x81\x17\x19\xa0\x79\xbd\xc6\x3c\x0d\xaf\x17\xd2\x80\xa9\x1a\x9d\x21\x64\x55\x8e\x20\x0d\x94\x32\x43\x65\x30\x87\x46\xe5\xa8\xc1\x2e\x10\x5e\xd5\x22\x5b\x20\xbc\x48\x4f\xba\x59\x28\xaa\x46\xe5\xa1\x54\x3c\xff\xc7\xe5\xd9\xc5\xbb\xab\x0b\x28\x64\x89\xe0\xbf\xe9\xaa\xb2\x90\x4b\x8d\x99\xad\xf4\x1d\x54\x05\xd8\xc1\x66\x56\x23\xa6\xe1\xe1\xb4\x6d\xc3\x70\xb3\x81\x1c\x0b\xa9\x10\xa2\x4c\xa3\xb0\x18\x41\xdb\xd2\xd7\x49\xbd\x9c\xc3\xe9\x0c\x6e\x84\x41\x98\xa4\x67\x95\x2a\xe4\x3c\xfd\x5b\x64\x4b\x31\x47\xf0\xa6\x16\x57\x75\x29\x2c\x42\xb4\x40\x91\xa3\x8e\x60\x72\x7f\x4a\xae\xea\x4a\xdb\x6e\xca\xfd\x83\x38\x0c\x36\x9b\x63\xd0\x42\xcd\x11\x26\xb5\xb0\x0b\xda\x6c\x92\x5e\xc9\x9b\x52\xaa\xf9\x25\xaf\x32\x64\x11\x04\x11\x1f\x87\x96\xb4\x6d\xe4\xec\x50\xe5\x34\x97\xf0\x56\x93\x9b\x46\x96\x04\x17\x7b\x38\xe3\x30\xde\x89\x15\x76\x91\x68\xcc\x50\xae\xdd\x7c\x3f\xee\x8d\xfc\xa2\x55\x63\x85\x95\x95\xa2\x45\xb5\x96\xca\x0e\xec\xa2\xb4\x9b\x65\x74\xc2\xe9\x14\x86\xdb\xb6\x2d\xa5\x8e\x70\xef\xbe\x14\x95\x06\x86\x53\xaa\x39\x08\x5e\x9c\xfa\x13\x01\x2a\x2b\xed\x5d\x1a\xda\xbb\x1a\x77\xdd\x18\xab\x9b\xcc\xc2\x26\x0c\x32\xc6\x3b\x0c\xfa\x63\x1d\x6e\x36\x00\x93\xf4\x4f\xff\xbf\x8b\x2f\x58\x54\xd5\xd2\xc0\xa7\x2f\x6f\xab\x6a\x19\x3a\xe8\xbf\x4b\xbb\x00\xbc\xb5\x04\xd2\x04\xa2\xd7\xce\x7f\x34\x0a\x39\x18\xa5\xc8\xa0\xb5\xb4\x22\xf5\x68\x78\x78\x29\xd0\x2b\xb1\x46\x17\x0b\xba\x18\x47\xc1\x78\xbe\xe5\xc2\x0a\x22\x4a\x1a\x16\x8d\xca\x20\x1e\xa1\xde\xb6\x7c\xf8\xc1\xee\x09\x7b\x8d\x33\x7b\x0b\x59\xa5\x2c\xde\x5a\xe2\x17\xfd\x26\x10\x1f\x0e\x37\x38\x02\xd4\xba\xd2\x09\x41\xb2\x16\x9a\x68\x13\xa0\xd6\xee\x6b\x18\x04\x8a\xea\x66\x64\x11\x06\x89\xa3\x88\x2c\x60\x92\xbe\x15\xe6\x1c\x0b\xd1\x94\xd6\x51\x69\xe7\x60\x69\xee\x26\x4d\x9c\x8c\x78\x15\xc8\x02\x4a\x54\xbb\x71\xa4\x0c\x76\x02\xb3\x19\x9c\xd0\x89\x68\x19\x9d\x66\x06\xbb\x0b\xb3\x05\x66\xcb\x38\x79\xc9\xd3\xcf\x66\xa0\x64\xc9\x06\x81\x46\xdb\x68\x45\xff\x39\xb4\x30\x08\x5a\x1f\xc6\xd1\x7f\xb8\xe2\xe0\xae\x6c\xa5\x5d\xdd\x75\xc8\x25\x61\xd0\x02\x96\x06\xd9\x2f\x61\xb3\x6a\x2c\x30\x3d\x2a\x72\xc3\x23\x7c\xd3\xa8\x2c\xa6\x9c\xec\x03\xfb\x08\x56\xd0\xf1\x29\x81\xf8\x83\x28\x1b\x1c\x02\x1e\xf4\xec\x3b\x82\x6a\x49\x85\xb1\x4a\x7d\x7a\x76\x68\x98\xd0\x62\x59\xc0\xb3\x6a\xe9\x0c\x47\x71\x16\x2b\x9b\x5e\x90\xd7\x22\x8e\x1a\x85\xb7\x35\x66\x16\x73\xe8\xa9\xcd\x95\x70\x70\x1d\x1d\xc1\x8a\x1d\xb5\xde\xdb\x13\xa1\xdd\x83\xad\x73\x35\x2a\xef\xb6\x85\x59\xbf\x35\xcd\xfe\x1c\xf6\x5b\x6c\xd2\xbc\x52\x08\x33\xb0\xba\xc1\x61\x86\x3b\xb7\x94\x62\x32\x20\x4d\x90\x04\xe2\x0f\x88\x75\x0c\xcf\x5f\x82\x84\xdf\x66\x70\xf2\x12\xe4\xf1\x71\x9f\x85\x3d\x67\x63\x93\x4f\xf2\x4b\xbc\x6a\x6c\xe2\x79\x24\x0b\xf8\xea\x62\x39\xe5\x20\x5d\x9e\xf8\xcc\x47\xb0\x03\xc3\x63\xc9\xd9\x86\xf7\x43\xda\x4a\xc3\x47\xc8\x44\x59\x1a\x27\x13\x42\xe5\x50\x0b\x25\x33\x43\xd5\xc7\x9f\x9c\xa9\x01\xa1\x1c\xb1\x9e\xa4\x10\x1f\xf7\x4b\xc4\xa8\xde\x59\x19\xfa\x98\x77\x41\x1a\x64\xcc\x13\x6a\x10\x2f\x1f\x35\x46\xad\x93\x61\x94\x6b\xa7\xa2\xc7\x30\x29\x24\x96\xb9\x71\xb7\xca\x1b\x37\x6e\xdb\xcd\xc6\x29\xcb\xe5\x79\xfa\xde\xa0\x3e\xe7\xcb\x33\x77\x13\x9d\xc5\x0c\x44\x5d\xb3\xfa\xfa\x0f\xb4\xdc\x2d\xf1\x02\xd3\x79\xd9\xd1\xa7\xe9\x14\x3a\x45\x02\x83\xd6\x09\xae\xff\x02\x6b\xaa\x4f\xe3\x2e\xf3\xed\x55\x73\x83\x45\xa5\x11\x8c\x58\x63\x1a\x06\x8f\x04\x77\x2b\x7b\x0c\xc4\xe0\x26\x2e\x38\xdc\xa2\x8b\xd6\x95\x0f\x8b\x69\xa5\x61\x52\xa4\x23\x35\xed\x08\xe7\xc4\x61\x87\x5f\x5c\x3c\x45\xaf\x14\xbf\x23\x19\x51\xdd\x6e\x45\x22\x58\x77\x76\x83\x87\x85\xb7\xf3\x1b\xf9\x2c\x7b\xbc\xfa\xcf\xa4\x6b\xec\x6e\x0b\x29\x3b\xdc\x3d\xc3\x15\x5a\xe7\xee\x8a\x6f\x56\xce\x22\xd9\xad\xb9\x84\x83\x3e\xbe\xde\xc7\xf0\xcf\xee\x55\xc8\xca\x03\xba\x21\x3a\x97\xa5\xfb\x6b\x98\xf4\x8d\x41\x7d\x9c\x7b\x2a\xac\x45\x29\x73\x52\x61\x03\x95\x1a\xe6\xea\xd1\xdc\xf7\x12\xe7\x2a\x86\xb0\xfa\x61\x82\x7c\x7e\xe8\x1c\xb1\xaa\x2c\x45\xfb\x57\x4d\x00\x88\x32\x81\x58\x91\x8d\x2b\x16\x26\x2d\x8d\x12\x8f\xd7\xff\xcb\x9e\xaf\x97\x5f\x3e\xb8\x78\x65\xa5\x58\xe4\x37\xb4\xc3\x29\x44\xce\x81\xcf\x5f\xc4\x15\x7a\xea\x22\x32\xe9\x3b\xfc\x1e\x47\xdd\x23\xb3\x6d\x4f\x61\x25\x8d\xa1\xb7\x92\xc6\x6f\x8d\xd4\x98\x03\x07\x08\x9f\xc7\x5e\x3e\x47\x51\xd2\x76\xb2\x7e\x2f\x6d\xfc\xec\x71\x2c\xfd\xb0\x4d\xc1\xa4\x48\x2f\xcd\x85\x6a\x56\xdb\x98\xd7\x4f\x8d\xb9\x0f\x99\x65\xe1\x46\x18\x99\xb9\x2c\xa4\xaf\x69\x7c\x4d\xf7\x57\xb4\x8e\x06\x45\x31\x90\xa3\xfb\xd4\xee\x4f\x47\xee\x39\xf7\xec\x71\xaf\x24\xff\x1c\xcc\xc3\x1b\x77\x08\x73\x4f\x4d\x28\x84\x2c\x09\x66\x1a\xee\x87\xfa\x14\x0e\xbe\x3b\x7f\x0e\xf3\x60\x2f\xf2\xbb\x63\xcf\x52\x74\xaa\x79\x91\xcf\x71\xcc\x52\x26\x28\xf6\x04\x1d\x4b\xcc\x04\xd3\xf7\x4a\x7e\x6b\xf0\xb1\xf2\x82\x3b\x75\x7d\x79\x3e\xa2\x28\x1f\x8e\x9e\x48\x5b\x77\xdd\xe5\xfb\xb0\x27\x13\x27\x83\x97\xde\x98\x6e\x8f\xca\x0a\xfe\x34\xf9\x31\x9f\xa3\x4f\x08\x3e\xc8\xfd\xe1\x78\x7b\x81\x3f\xb1\x15\x98\xd8\x55\x5d\xf6\xad\x4f\x01\x51\x2e\x45\x89\x99\x9d\x1e\x98\x69\xd7\x17\x0e\x5f\x42\x6c\x74\xdb\x37\x10\xce\x7c\xb7\x7b\x70\xb2\x56\x2e\x87\x7e\x0f\x8c\xeb\xcf\x5e\x37\xe5\x32\x82\xb8\x16\x26\x13\xa5\xbf\xcd\x93\x7b\x0d\xdb\xb8\x5f\x2b\x97\xe3\xee\x8b\xff\x3f\xd0\x7a\xf1\xaa\xaa\xd8\xd3\x82\x49\x34\xa3\x26\xcc\x79\xbb\xdf\x81\x79\xc7\xd4\x63\xb9\x1e\x6c\x00\x1d\x07\x39\x3d\x84\x4b\x77\x27\x1b\x8f\x4f\xae\xf9\xc8\xa6\xa9\x5d\x17\xcb\xce\xdd\xa1\xa8\x93\x9b\xfa\x30\x1f\xc4\xfc\xeb\x0d\xa3\x34\x02\xde\xdd\x84\x0b\x61\xae\xc7\xe0\xfb\x9c\xfc\x20\xe1\xe5\x12\xa2\x7f\x3c\x9c\xd1\xe8\x06\x72\x8d\xd1\xde\x74\x06\xa3\x37\xcb\xbd\xd1\xbf\x01\x00\x00\xff\xff\x2f\x99\x50\x8b\x03\x11\x00\x00") func templateBuilderCreateTmplBytes() ([]byte, error) { return bindataRead( @@ -165,7 +165,7 @@ func templateBuilderCreateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/create.tmpl", size: 4378, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/builder/create.tmpl", size: 4355, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1030,7 +1030,7 @@ func templateInternalTmpl() (*asset, error) { return a, nil } -var _templateMetaTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x5b\x6f\xe3\xba\x11\x7e\xb6\x7f\xc5\x40\xd0\x02\x71\x90\xc8\x7b\xce\x5b\x03\xf8\x61\x9b\xcb\x49\xd0\x83\xe0\x00\x9b\x9c\x97\xa2\x28\x68\x71\x64\x11\xa1\x48\x2f\x49\x25\x9b\x0a\xfe\xef\x05\x87\x14\x25\xf9\xb2\xdb\xdd\xb6\x2f\x86\x44\x72\x6e\x1f\x67\xbe\x19\xb9\xeb\x96\xe7\xf3\x6b\xbd\x7d\x37\x62\x53\x3b\xf8\xf5\xe3\x2f\x7f\xb9\xdc\x1a\xb4\xa8\x1c\xdc\xb1\x12\xd7\x5a\xbf\xc0\x83\x2a\x0b\xf8\x24\x25\xd0\x21\x0b\x7e\xdf\xbc\x22\x2f\xe6\x4f\xb5\xb0\x60\x75\x6b\x4a\x84\x52\x73\x04\x61\x41\x8a\x12\x95\x45\x0e\xad\xe2\x68\xc0\xd5\x08\x9f\xb6\xac\xac\x11\x7e\x2d\x3e\xf6\xbb\x50\xe9\x56\xf1\xb9\x50\xb4\xff\xfb\xc3\xf5\xed\xe3\xe7\x5b\xa8\x84\x44\x88\x6b\x46\x6b\x07\x5c\x18\x2c\x9d\x36\xef\xa0\x2b\x70\x23\x63\xce\x20\x16\xf3\xf3\xe5\x6e\x37\x9f\x77\x1d\x70\xac\x84\x42\xc8\x1a\x74\x2c\x83\xb0\x78\x09\x6f\xc2\xd5\x80\x5f\x1d\x2a\x0e\x39\x64\x7f\xb0\xf2\x85\x6d\x30\x83\xbc\x88\x8f\x70\xb9\xdb\xcd\x67\x5d\x07\x0e\x9b\xad\x64\x0e\x21\xab\x91\x71\x34\x19\x14\x5e\x4b\xd7\x81\x97\x8d\x46\x86\x43\xa2\xd9\x6a\xe3\x32\xc8\x69\xab\xd4\xca\x3a\x38\x9b\xcf\x96\x4b\xf8\x9d\xad\x51\x42\xad\x25\xb7\x14\x85\x75\x46\xa8\x0d\x48\x5a\xe6\xa8\xb4\xf3\xaf\x7e\xa7\xeb\x40\xea\x37\x34\x90\x17\x8f\xac\x41\xd8\xed\xc0\xbd\x6f\x53\xf8\x9c\x39\xb6\x66\x16\x8b\xf9\x2c\xe8\x5c\x41\xd6\x75\x90\x17\xe1\x6d\xb7\xcb\xc8\x1e\x2d\x3d\xdc\x14\xd7\xde\x07\xa6\x9c\x57\x73\x60\x7d\x62\x57\x70\xa8\x04\x4a\x7e\xc4\xd0\x31\x65\xbd\xd9\x87\x9b\xe2\xb3\xd3\x86\x6d\xf0\x6f\xf8\x1e\xcc\x7b\x88\x0d\x53\x1b\x84\xbc\x82\xab\x15\xe4\xc5\x9d\x57\x6c\x3d\x28\x33\xda\xcd\x83\x25\xbf\x57\x8d\xb5\xce\x67\xbd\xef\xe1\xc0\x77\x9d\x1e\xc0\xaa\x12\x5a\xa7\xa2\x98\x4d\xf4\x46\xff\xab\xa3\xde\xf7\x97\xeb\x45\x62\x24\x18\x22\xb9\xe5\x1b\x1c\x07\x82\x7c\x13\x76\xf0\x78\x1c\xb4\xff\x03\x61\x60\x0a\x83\x24\x95\x7f\x11\x0a\x9a\xd6\x31\x27\xb4\xb2\x7d\x1c\xbd\xde\x18\x46\x12\x3b\x12\x40\xee\x9a\xad\xf4\x3e\x6e\x8d\x50\xae\x82\x8c\x0b\x26\xb1\x74\xcb\x0f\x76\xe9\xeb\x62\x59\x46\xc7\xad\xaf\x80\x08\x07\xc4\x02\xf8\x9a\x92\x3b\xa8\xa1\xcc\x5e\x50\xda\x87\x85\xd3\x6a\x5f\x99\x11\x6c\x2d\x71\x5f\x6d\xd7\x81\xa8\xa0\x66\xf6\x69\xaa\xfa\x5b\x16\xa7\x05\xf7\x3d\xcb\x55\xab\x4a\x42\xeb\x7f\x6d\x79\x79\x0e\xf7\xcc\x02\x73\x20\x91\x59\x07\x5a\x61\x4c\xb7\x33\xa5\x1d\xa0\x6a\x9b\x45\x60\x17\x8e\x15\x6b\xa5\x83\x57\x26\x5b\x04\xe2\xa3\x94\x7e\x76\xaf\x28\x82\x5b\x54\x4a\xcf\x16\xcd\x0d\x71\x16\x0f\x1b\xbd\xc4\x0a\xd8\x76\x4b\x7c\x15\x17\xfc\xf1\x70\x24\xba\xe7\x0f\xd7\xcc\xde\x44\xc3\x57\x2b\xa8\x98\xb4\x18\xce\x4c\xca\xb1\x9a\x1a\x66\xa4\xb5\xe8\x05\x29\x92\xbc\x2a\x1e\xec\x2d\x85\x13\xdc\x18\x69\x5e\x81\x33\x2d\x8e\x6d\xef\x63\xf4\x1b\x2a\x34\x1e\xc7\x8d\xd4\x6b\x26\x21\x65\x02\x54\xda\x40\xad\xf5\x8b\xbd\xf0\xc8\x08\xce\x9c\x36\x96\x3c\xd8\x6a\x29\xca\x77\x28\x6b\x2c\x5f\xd0\xd8\x04\x99\xa8\x40\x9b\x89\xfd\xbc\xb8\x67\xf6\xcf\x41\x3a\x2f\x1e\xdb\xe6\xde\x2b\x0d\x8f\x7f\x04\x4d\xe1\x52\x2f\x21\x57\xfd\x2e\xa1\x9e\xce\xf6\xfb\x04\xfd\x54\x6c\x4f\x6e\x05\x8c\xf3\xd1\xfb\x2f\x49\x36\x46\x9d\xf4\xa8\xb1\x72\x4f\x01\x8f\xda\x21\xb8\x9a\x39\x2a\xf3\x01\x87\x35\x4a\xfd\x06\xcc\xf8\xe2\x16\x4e\x30\x29\xfe\x85\x1c\xd6\xef\xa1\xc3\xb5\xca\x89\x06\x83\x86\x6d\xec\x48\x3a\xf0\x59\x3a\x4e\x74\x10\xba\x1f\xfa\xdc\x90\xa2\xa4\xa5\x02\x9e\x6a\x34\x58\x69\x83\x17\x41\x83\x70\x60\x6b\xdd\x4a\x0e\x6b\x84\xd0\xa1\x30\xf1\x63\xc3\x84\x02\xe6\x2f\x46\x4a\xfd\x66\xaf\x48\x84\x7e\x66\xe1\x28\xfc\x33\x12\xfd\xb5\x56\x95\xd8\xa4\x0e\xb9\xdb\x2d\xa3\x9f\x59\x94\x19\x03\xf2\xca\x8c\x6f\x7c\x27\x80\x99\x85\xe7\xbf\x7b\xbd\xa3\x9d\x7f\xa0\x72\x85\x7f\x89\x82\xbd\xb2\x93\xd7\x34\x8b\x2f\x5e\x2e\x3c\x1e\x93\xfc\x7f\x16\xdd\xec\xb0\xd9\x55\xa3\x5e\xd7\x7b\xfe\xdd\x12\xf3\x67\x83\xb3\x7c\xa8\xdf\x41\x22\x92\x3b\x9d\x8a\x8d\xa5\x3f\x37\xe9\x2d\x53\xd6\xd1\x0a\x4a\x83\x21\x51\x7c\xe1\xc5\x4e\xb3\xdf\x2a\x8b\x68\x7c\xa2\x73\xa8\xbc\xe4\xc4\x5d\xab\xca\xe0\xf5\x93\x68\x30\x3c\x3d\x3f\x13\x20\x9e\x70\xcf\x16\x30\x26\x84\xbc\x2a\x9e\xfc\xd8\x32\xe0\x90\x20\x4b\xf7\x59\x15\xcf\x5b\xce\x1c\xde\x24\xbb\xa7\x70\x98\x9c\xfb\x69\x34\x5a\xd2\xf2\x93\x58\x0c\x91\xff\x54\xbc\xd4\x15\xf2\xaa\x18\x11\xd7\x38\x5c\x6a\xf4\x21\xd6\x74\x62\x72\x80\x66\xc0\xab\x15\xa4\xa6\xe7\x7d\x80\xb3\x0f\x76\x01\x68\x8c\x36\x59\xef\xc1\xd8\x8d\x1e\x1e\x15\x63\x14\x16\xd8\x40\xbc\x09\x88\x6c\x82\x44\x16\xa1\x80\x07\xe7\x05\x4a\x26\xe5\xc0\x4d\xeb\x56\x48\xee\xf9\x79\x4d\x14\x03\x96\xbd\xe2\x00\x5a\x6f\x87\x7a\xf4\x09\x34\xc6\x2f\x8b\x83\xf6\x1a\x07\xf6\xb2\xb5\x4e\x37\x61\xf0\xf5\x5e\xfa\xce\x0a\xb1\xb2\xfa\xce\x30\x1d\x31\x7d\x25\x8d\xc6\x4c\x1a\x8a\xbc\x50\xc0\x34\x61\xe2\xd7\x0d\x96\x28\x5e\xd1\xf8\xbd\xf4\x9c\x57\xc5\x5f\x43\x6c\x77\x71\x44\xa4\xc3\xe1\xe2\xef\x99\xfd\x4d\x0f\xb8\xa6\xf5\x69\xe2\x86\x79\x3f\x60\x39\x4d\x55\x48\xee\x8c\x27\xcf\x78\xe6\x4f\x4a\x4f\x1a\xdd\x66\x23\x66\xf1\x8f\xa1\x7f\xd3\xfa\xf2\x1c\x74\x23\x42\x1f\xe9\x7b\x02\xc1\x5d\x19\x0f\x54\x8d\x04\x56\x11\xd0\x99\x0d\xf1\xfb\x6e\x2d\x9a\x9e\xb5\xfb\x1c\xf9\x1c\x86\xd0\x7c\x44\xe7\xa3\x99\x35\x3a\x1a\xee\xc2\x26\xe5\x27\x0a\x67\xb8\x1b\x9f\x08\x74\x70\xac\x25\xcc\xbb\xf3\xf9\xb8\xec\xa7\xb8\xf9\xf5\xe5\x39\x40\x25\x14\x27\xfd\x24\x4a\x5d\xf3\x44\x31\xfb\x30\xc3\x37\xda\x84\x80\xfb\x0a\xf2\xb9\x30\x29\x2f\x51\x01\x7e\xf1\x53\x72\xc0\xfa\x10\x7b\x3a\x99\xe2\x4f\xa1\x89\xa9\xed\x51\x58\x21\xe7\xbf\x75\xe5\xab\xa9\xae\xe4\xcb\x94\x16\x8e\x95\xc5\xe1\x4d\x50\xd0\x34\xfb\xa7\x6f\xca\xff\x24\xf0\x71\x28\x47\x32\xb0\x87\x23\xa4\x1e\xe9\x1b\xfc\x59\x78\x37\x02\xc7\x4c\x6a\x66\xaa\x6a\x01\x21\x93\xce\x16\xfd\x77\x4d\xe7\x55\x19\x74\xad\x51\x71\x69\x5f\x7e\x31\x9f\xcd\x62\x7e\xc7\x78\xe7\x03\x79\x1c\xa3\xc0\xff\x82\xc4\x42\x2a\x45\xf8\x7e\x84\xd0\x28\xf2\x91\xd5\x6f\x83\x40\x0c\x4c\xa1\xdb\x37\xe1\xca\x1a\x0e\x4e\x13\x3f\x30\x4b\xa5\x11\x2f\x4d\x5c\x1c\x5e\x5c\x60\x16\xe5\x77\xe1\x23\xec\x76\x17\xe3\x16\x73\xc8\x45\xfb\xd7\x38\x70\xc6\xe4\xf2\x0f\x07\xf5\x2b\xca\x90\x78\x4d\x4a\x48\xff\x1a\xb3\x7c\xb2\x55\x35\xae\xb8\xf5\xc1\x55\x67\x61\x0a\x1c\xf8\xe2\x0a\x84\xa2\x5b\x18\x61\x4c\x97\x71\xa4\xad\x5e\xc1\x87\x2f\xd9\xc5\x3e\x2a\x31\x11\x4e\xff\x9d\x42\x1f\x73\x8c\x73\xe1\x47\x18\x26\xfb\xff\x55\xba\x2e\x76\x53\xff\x95\x46\x73\x5d\xc3\x5c\x59\x3f\x9d\x92\x5b\x9e\x67\x3d\xa3\x46\xe8\xfb\x2f\xe2\xa8\xa1\x67\xcc\xa3\x1f\x80\xb3\xc9\x27\xd6\xc8\xcf\x49\xdf\xfa\x34\xb8\x4d\xc4\x55\x32\xe5\xc7\x6d\xfd\x8a\xc6\x08\xce\x51\xf9\x81\x5b\x1b\xfa\xe3\x4b\xd3\xf7\xc4\xe0\x5f\xf8\x87\xac\xcf\x63\x22\xd0\xc8\xf0\x45\x6a\x76\xe3\x3f\xb2\x26\x90\x8c\xa7\xd1\x7f\x07\x00\x00\xff\xff\xc4\x55\x75\x3b\xb5\x13\x00\x00") +var _templateMetaTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x5b\x6f\xdb\xb8\x12\x7e\xb6\x7f\xc5\x40\x50\x81\x38\x48\xe4\xb6\x6f\x27\x80\x1f\x7a\x72\x69\x82\x53\x04\x05\x9a\xf6\xe5\x60\xb1\xa0\xc5\x91\x45\x84\x26\x5d\x92\x4a\x9a\x15\xfc\xdf\x17\x1c\x52\x12\xe5\x4b\xbb\xed\xee\xbe\x18\x12\x39\x9c\xcb\xc7\x99\x6f\x46\x6e\xdb\xf9\xe9\xf4\x52\x6f\x5e\x8c\x58\xd5\x0e\xde\xbe\x7e\xf3\x9f\xf3\x8d\x41\x8b\xca\xc1\x0d\x2b\x71\xa9\xf5\x23\xdc\xa9\xb2\x80\x77\x52\x02\x09\x59\xf0\xfb\xe6\x09\x79\x31\x7d\xa8\x85\x05\xab\x1b\x53\x22\x94\x9a\x23\x08\x0b\x52\x94\xa8\x2c\x72\x68\x14\x47\x03\xae\x46\x78\xb7\x61\x65\x8d\xf0\xb6\x78\xdd\xed\x42\xa5\x1b\xc5\xa7\x42\xd1\xfe\x87\xbb\xcb\xeb\xfb\x4f\xd7\x50\x09\x89\x10\xd7\x8c\xd6\x0e\xb8\x30\x58\x3a\x6d\x5e\x40\x57\xe0\x12\x63\xce\x20\x16\xd3\xd3\xf9\x76\x3b\x9d\xb6\x2d\x70\xac\x84\x42\xc8\xd6\xe8\x58\x06\x61\xf1\x1c\x9e\x85\xab\x01\xbf\x39\x54\x1c\x72\xc8\x3e\xb2\xf2\x91\xad\x30\x83\xbc\x88\x8f\x70\xbe\xdd\x4e\x27\x6d\x0b\x0e\xd7\x1b\xc9\x1c\x42\x56\x23\xe3\x68\x32\x28\xbc\x96\xb6\x05\x7f\x36\x1a\x19\x84\xc4\x7a\xa3\x8d\xcb\x20\xa7\xad\x52\x2b\xeb\xe0\x64\x3a\x99\xcf\xe1\x03\x5b\xa2\x84\x5a\x4b\x6e\x29\x0a\xeb\x8c\x50\x2b\x90\xb4\xcc\x51\x69\xe7\x5f\xfd\x4e\xdb\x82\xd4\xcf\x68\x20\x2f\xee\xd9\x1a\x61\xbb\x05\xf7\xb2\xe9\xc3\xe7\xcc\xb1\x25\xb3\x58\x4c\x27\x41\xe7\x02\xb2\xb6\x85\xbc\x08\x6f\xdb\x6d\x46\xf6\x68\xe9\xee\xaa\xb8\xf4\x3e\x30\xe5\xbc\x9a\x3d\xeb\x23\xbb\x82\x43\x25\x50\xf2\x03\x86\x0e\x29\xeb\xcc\xde\x5d\x15\x9f\x9c\x36\x6c\x85\xff\xc3\x97\x60\xde\x43\x6c\x98\x5a\x21\xe4\x15\x5c\x2c\x20\x2f\x6e\xbc\x62\xeb\x41\x99\xd0\x6e\x1e\x2c\xf9\xbd\x2a\xd5\x3a\x9d\x74\xbe\x07\x81\x1f\x3a\x3d\x80\x55\xf5\x68\x1d\x8b\x62\x32\xd2\x1b\xfd\xaf\x0e\x7a\xdf\x5d\xae\x3f\x12\x23\xc1\x10\xc9\x35\x5f\x61\x1a\x08\xf2\x55\xd8\xc1\xc3\x71\xd0\xfe\x4f\x84\x81\x7d\x18\x74\x52\xf9\x17\xa1\x60\xdd\x38\xe6\x84\x56\xb6\x8b\xa3\xd3\x1b\xc3\xe8\x8f\x1d\x08\x20\x77\xeb\x8d\xf4\x3e\x6e\x8c\x50\xae\x82\x8c\x0b\x26\xb1\x74\xf3\x57\x76\xee\xeb\x62\x5e\x46\xc7\xad\xaf\x80\x08\x07\xc4\x02\xf8\xd6\x27\x77\x50\x43\x99\x3d\xa3\xb4\x0f\x0b\xc7\xd5\x3e\x31\x23\xd8\x52\xe2\xae\xda\xb6\x05\x51\x41\xcd\xec\xc3\x58\xf5\xf7\x2c\x8e\x0b\xee\x47\x96\xab\x46\x95\x84\xd6\x3f\x6d\x79\x7e\x0a\xb7\xcc\x02\x73\x20\x91\x59\x07\x5a\x61\x4c\xb7\x13\xa5\x1d\xa0\x6a\xd6\xb3\xc0\x2e\x1c\x2b\xd6\x48\x07\x4f\x4c\x36\x08\xc4\x47\x7d\xfa\xd9\x9d\xa2\x08\x6e\x51\x29\x7d\xb6\x68\xae\x88\xb3\x78\xd8\xe8\x4e\x2c\x80\x6d\x36\xc4\x57\x71\xc1\x8b\x07\x91\xe8\x9e\x17\xae\x99\xbd\x8a\x86\x2f\x16\x50\x31\x69\x31\xc8\x8c\xca\xb1\x1a\x1b\x66\xa4\xb5\xe8\x0e\x52\x24\x79\x55\xdc\xd9\x6b\x0a\x27\xb8\x91\x68\x5e\x80\x33\x0d\xa6\xb6\x77\x31\x7a\x8f\x0a\x8d\xc7\x71\x25\xf5\x92\x49\xe8\x33\x01\x2a\x6d\xa0\xd6\xfa\xd1\x9e\x79\x64\x04\x67\x4e\x1b\x4b\x1e\x6c\xb4\x14\xe5\x0b\x94\x35\x96\x8f\x68\x6c\x0f\x99\xa8\x40\x9b\x91\xfd\xbc\xb8\x65\xf6\xcb\x70\x3a\x2f\xee\x9b\xf5\xad\x57\x1a\x1e\x3f\x06\x4d\xe1\x52\xcf\x21\x57\xdd\x2e\xa1\xde\xcb\x76\xfb\x04\xfd\xf8\xd8\xce\xb9\x05\x30\xce\x93\xf7\x37\xfd\xd9\x18\x75\xaf\x47\xa5\xca\x3d\x05\xdc\x6b\x87\xe0\x6a\xe6\xa8\xcc\x07\x1c\x96\x28\xf5\x33\x30\xe3\x8b\x5b\x38\xc1\xa4\xf8\x03\x39\x2c\x5f\x42\x87\x6b\x94\x13\x6b\x0c\x1a\x36\xb1\x23\xe9\xc0\x67\xbd\x38\xd1\x41\xe8\x7e\xe8\x73\x43\x8a\x92\x96\x0a\x78\xa8\xd1\x60\xa5\x0d\x9e\x05\x0d\xc2\x81\xad\x75\x23\x39\x2c\x11\x42\x87\xc2\x9e\x1f\xd7\x4c\x28\x60\xfe\x62\xa4\xd4\xcf\xf6\x82\x8e\xd0\xcf\x24\x88\xc2\xef\x91\xe8\x2f\xb5\xaa\xc4\xaa\xef\x90\xdb\xed\x3c\xfa\x99\xc5\x33\x29\x20\x4f\xcc\xf8\xc6\x77\x04\x98\x49\x78\xfe\xbf\xd7\x9b\xec\xfc\x86\xca\x15\xfe\x25\x1e\xec\x94\x1d\xbd\xa6\x49\x7c\xf1\xe7\xc2\xe3\xa1\x93\xff\x66\xd1\x4d\xf6\x9b\x5d\x95\xf4\xba\xce\xf3\x1f\x96\x98\x97\x0d\xce\xf2\xa1\x7e\x87\x13\x91\xdc\x49\x2a\x36\x96\x4e\x6e\xd4\x5b\xc6\xac\xa3\x15\x94\x06\x43\xa2\xf8\xc2\x8b\x9d\x66\xb7\x55\x16\xd1\xf8\x48\x67\x84\xa7\xf7\xe0\xa6\x51\x25\x6c\xb7\x9e\x59\x4f\x66\x90\x56\x7e\x5e\x15\x0f\x7e\x3e\x19\x02\xee\xb1\xe9\x2f\xae\x2a\x3e\x6f\x38\x73\x78\xd5\x1b\x38\x16\xf0\x48\xee\x97\xc3\x6e\x48\xcb\xaf\x07\x7d\x67\x1f\x04\x09\xff\x42\xbc\x44\xff\x79\x55\x24\x0c\x95\x86\x4b\x1d\x3d\xc4\xda\x4b\x8c\x04\x68\xd8\xbb\x58\x40\xdf\xdd\xbc\x0f\x70\xf2\xca\xce\x00\x8d\xd1\x26\xeb\x3c\x48\xdd\xe8\xe0\x51\x31\x46\x61\x81\x0d\x0c\xdb\x03\x91\x8d\x90\xc8\x22\x14\x70\xe7\xfc\x81\x92\x49\x39\x90\xd0\xb2\x11\x92\x7b\x22\x5e\x12\x97\x80\x65\x4f\x38\x80\xd6\xd9\xa1\x66\x7c\x04\x8d\xf4\x65\xb6\xd7\x47\xe3\x64\x5e\x36\xd6\xe9\x75\x98\x70\xbd\x97\xbe\x85\x42\x2c\xa1\xae\x05\x8c\x67\x49\x5f\x32\xc9\x3c\x49\xd3\x8f\x3f\x14\x30\xed\x31\xf1\xeb\x06\x4b\x14\x4f\x68\xfc\x5e\xff\x9c\x57\xc5\x7f\x43\x6c\x37\x71\x16\x24\xe1\x70\xf1\xb7\xcc\xbe\xd7\x03\xae\xbb\x55\x10\xc3\x0c\x83\x7d\xc0\x72\x9c\xaa\xd0\xbb\x93\x8e\x98\x51\xe6\x0b\xa5\x27\xcd\x68\x93\x84\x42\xfc\x63\x68\xd4\xb4\x3e\x3f\x05\xbd\x16\xa1\x61\x74\xe4\x4f\x70\x57\xc6\x03\x55\x23\x81\x55\x04\x74\x26\x43\xfc\xbe\x2d\x8b\x75\x47\xcf\x5d\x8e\x7c\x0a\xd3\x66\x9e\xf0\x76\x32\x9c\x46\x47\xc3\x5d\xd8\x5e\xf9\x91\xc2\x19\xee\xc6\x27\x02\x09\xa6\x5a\xc2\x60\x3b\x9d\xa6\x65\x3f\xc6\xcd\xaf\xcf\x4f\x01\x2a\xa1\x38\xe9\xa7\xa3\xd4\x1e\x8f\x14\xb3\x0f\x33\x7c\x8c\x8d\x98\xb6\xab\x20\x9f\x0b\xa3\xf2\x12\x15\xe0\x57\x3f\x0e\x07\xac\xf7\xb1\x27\xc9\x3e\xfe\x3e\x34\x31\xb6\x9d\x84\x15\x72\xfe\x7b\x57\xbe\x18\xeb\xea\x7d\x19\xd3\xc2\xa1\xb2\xd8\xbf\x09\x0a\x9a\x86\xfc\xfe\xe3\xf1\xaf\x04\x9e\x86\x72\x20\x03\x3b\x38\x42\xea\x91\xbe\xc1\x9f\x99\x77\x23\x70\xcc\xa8\x66\xc6\xaa\x66\x10\x32\xe9\x64\xd6\x7d\xc0\xb4\x5e\x95\x41\xd7\x18\x15\x97\x76\xcf\xcf\xa6\x93\x49\xcc\xef\x18\xef\x74\x20\x8f\x43\x14\xf8\x37\x48\x2c\xa4\x52\x84\xef\x67\x08\x8d\x22\x4f\xac\x7e\x1f\x04\x62\x60\x0a\xdd\x3e\x0b\x57\xd6\xb0\x27\x4d\xfc\xc0\x2c\x95\x46\xbc\x34\x71\xb6\x7f\x71\x81\x59\x94\xdf\x85\xd7\xb0\xdd\x9e\xa5\x2d\x66\x9f\x8b\x76\xaf\x71\xe0\x8c\xd1\xe5\xef\x4f\xe4\x17\x94\x21\xf1\x9a\x94\x90\xfe\x35\x66\xf9\x68\xab\x5a\xbb\xe2\xda\x07\x57\x9d\x84\x71\x6f\xe0\x8b\x0b\x10\x8a\x6e\x21\xc1\x98\x2e\xe3\x40\x5b\xbd\x80\x57\x5f\xb3\xb3\x5d\x54\x62\x22\x1c\xff\xdf\x84\xbe\xda\x18\xe7\xc2\xcf\x2a\x4c\x76\x7f\xa0\xb4\x6d\xec\xa6\xfe\x73\x8c\x06\xb8\x35\x73\x65\xfd\x70\xec\xdc\xfc\x34\xeb\x18\x35\x42\xdf\x7d\xfa\x46\x0d\x1d\x63\x1e\xfc\xd2\x9b\x8c\xbe\xa5\x12\x3f\x47\x7d\xeb\xdd\xe0\x36\x11\x57\xc9\x94\x9f\xab\xf5\x13\x1a\x23\x38\x47\xe5\x27\x6b\x6d\xe8\x1f\x2e\x4d\x1f\x0e\x83\x7f\xe1\xaf\xb0\x2e\x8f\x89\x40\x23\xc3\x17\x7d\xb3\x4b\xff\xb1\x1a\x41\x92\x8e\x9d\x7f\x06\x00\x00\xff\xff\xf1\x10\x34\xad\x9e\x13\x00\x00") func templateMetaTmplBytes() ([]byte, error) { return bindataRead( @@ -1045,7 +1045,7 @@ func templateMetaTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/meta.tmpl", size: 5045, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/meta.tmpl", size: 5022, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1150,7 +1150,7 @@ func templatePrivacyPrivacyTmpl() (*asset, error) { return a, nil } -var _templateRuntimeTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x58\x5b\x6f\xdb\x3a\xf2\x7f\xb6\x3e\xc5\xfc\x05\xff\x01\x3b\x70\xe8\xb6\x6f\xdb\x85\x1f\xba\xbd\x6c\x03\x6c\x8b\x62\x7b\x79\x29\x82\x03\x46\x1a\xd9\x3c\x91\x49\x1d\x92\x4a\x13\x18\xfa\xee\x0b\x0e\x49\x89\x92\x2f\x27\x7b\x9e\xf6\x25\x91\xc4\xe1\x5c\x7e\xf3\x9b\xe1\xd0\x87\xc3\xfa\x2a\x7b\xab\x9a\x27\x2d\xb6\x3b\x0b\xaf\x5e\xbc\xfc\xdb\x75\xa3\xd1\xa0\xb4\xf0\x81\x17\x78\xa7\xd4\x3d\xdc\xc8\x82\xc1\x9b\xba\x06\x12\x32\xe0\xd6\xf5\x03\x96\x2c\xfb\xb6\x13\x06\x8c\x6a\x75\x81\x50\xa8\x12\x41\x18\xa8\x45\x81\xd2\x60\x09\xad\x2c\x51\x83\xdd\x21\xbc\x69\x78\xb1\x43\x78\xc5\x5e\xc4\x55\xa8\x54\x2b\xcb\x4c\x48\x5a\xff\xd7\xcd\xdb\xf7\x9f\xbf\xbe\x87\x4a\xd4\x08\xe1\x9b\x56\xca\x42\x29\x34\x16\x56\xe9\x27\x50\x15\xd8\xc4\x98\xd5\x88\x2c\xbb\x5a\x77\x5d\x96\x51\x0c\xdf\xdc\x96\x56\x5a\xb1\x47\xb0\xb8\x6f\x6a\x6e\x11\xb6\x28\x51\x73\x8b\x86\x34\x9a\x62\x87\x7b\x7e\x6d\xac\xb0\xc5\x4e\xc8\x2d\xd4\x6a\x2b\x0a\xe0\xb2\x84\x9d\xaa\x4b\x12\xca\xf6\xaa\x6c\x6b\x84\x07\xd4\x46\x28\xe7\x09\xb7\xf0\x8b\x1b\x68\x5d\x44\x56\xf5\x2a\x49\x23\x37\x06\xad\x61\x59\x76\x63\x61\xc7\x0d\xbc\x82\x4a\xe9\x3d\xb7\x86\xc1\x1b\xc8\x83\x3b\x39\x34\xbc\xb8\xe7\x5b\xf4\xca\xcc\x4e\xb5\x75\x09\x77\x08\xb8\x6f\xec\xd3\xb5\xd8\x37\x4a\x5b\x2c\x43\xdc\xd9\x9e\x0b\xd9\xef\xa8\x94\x0e\x6e\x1b\xf8\x25\xec\x0e\x76\x4a\xdd\x1b\x50\x1a\x1a\x55\x8b\x42\xa0\x81\x45\xa3\x2c\x4a\x2b\x78\x0d\xc5\x53\x51\x8b\x22\x68\x5c\x32\xc2\xc4\x60\xa1\x64\x19\xfc\x72\xe9\x89\x01\xa4\xf9\xc9\x51\xda\xde\xcd\x15\x21\x92\x3a\x07\xc2\x64\x52\x59\x90\x58\xa0\x31\x5c\x3f\xc1\x42\x2a\x50\x8d\x75\x08\x39\x17\x27\x86\xe1\xd8\x70\x84\xef\x1e\xb1\xc9\xee\x78\x71\xff\x8b\xeb\xd2\x5c\x17\x6a\xdf\x70\x2b\xee\x44\x2d\xec\x93\x8f\xb0\xd1\xf8\x20\x54\x6b\x62\x0a\x8c\x4b\x3d\x4a\x3b\x64\x1b\x4a\xac\x84\xc4\x1e\xe0\x35\x79\xdf\x75\xd9\xec\x70\x18\x72\x3f\xc0\x3f\x77\x6b\x87\x03\xa0\x2c\xe1\x8c\x86\xe6\x7e\xdb\x6b\x20\x2f\xf0\xd1\x3a\xf1\x39\xe4\x5f\x3c\x2a\x79\xa2\xd0\x09\x9e\xb1\xc5\xa2\x96\x60\xcc\x3d\xce\x03\xa7\x5e\x6f\x60\xce\x3e\xd1\xf3\x8d\xac\x54\x5c\x16\x95\xcb\x67\x10\x62\x3f\x02\xf1\xe2\xfb\xd7\x76\x4f\x82\x85\x92\xc6\xc2\x82\x0c\x5f\x7b\x1f\xa7\x5b\xc8\xad\x59\x7c\xdb\x40\x7e\x38\x90\x3f\x39\xac\xd7\x10\x3f\x7b\x30\xa9\x58\xb7\x28\x59\xd0\x17\xbd\x3d\x56\x1e\xed\xcf\x66\xee\x69\xa2\xd4\x7d\xba\xac\x70\x99\x82\x71\x31\x07\x79\xfc\x3e\xa0\xba\x43\x5e\xa2\x0e\xa0\xba\xa5\xb9\xa7\xff\xeb\x0d\xbc\x08\xfa\x34\x97\x5b\x84\xb9\xf4\xe0\x7e\x56\x25\x9a\x1e\x76\xd9\xee\x3f\x46\xf9\xb9\x64\x9f\xe3\x6b\xd7\x79\xd4\xfd\xb7\x2f\xae\x90\x9e\xfc\xc7\x61\xcb\x06\x78\x59\x26\xef\x2f\xbd\x40\x9a\xd5\x5d\x2a\xe8\x5f\x06\xf9\x51\xb4\x4e\x5a\xdb\xe6\x7e\xeb\x3c\xa9\x78\x6d\xb0\xf7\x61\xc7\xcd\x07\x81\x35\x31\xed\x6b\xa1\x1a\x82\x61\x90\xdf\x00\xfe\x01\x73\x46\x2b\x2c\x30\x71\x84\xd8\x18\x52\x17\x94\xdf\xd8\x75\xe0\xda\x22\xbc\x34\x36\x96\xe0\x75\xec\x8f\xeb\xf0\x9f\x6d\x15\x50\x4d\x05\x16\x86\x20\xce\xd3\x7b\xad\x71\x2b\x8c\x75\x29\x99\xf7\x3c\xf7\xd1\x64\xb3\xd9\x7a\xed\xeb\xfe\x74\x97\x1d\x75\x1e\x21\xc1\xc5\xc8\xde\x2a\x59\x89\x6d\x1f\x58\xd7\x25\xae\x4d\x89\x13\x51\x5b\x5f\xc1\xab\xa1\xaf\x38\xa6\xd9\x73\x01\xb9\x9e\xf5\x3f\x14\xd4\x85\xe0\x8e\xea\x83\x0e\x35\x88\xae\x05\xfb\xb0\xe3\xb2\xac\x51\x1b\xd7\x49\xed\x53\x83\xb1\x65\x1b\x1f\xf6\x89\xc6\x36\x04\xd7\x75\x59\xe8\xe6\x8b\x2c\x29\xf3\xe8\xee\x57\x6f\x81\x82\xee\x6b\x3c\x1b\xd5\xb2\x7b\x3e\x57\x6f\xb4\xe7\x54\xec\x54\x55\xc9\x87\x3c\x34\x88\xf5\x15\xdc\x78\x77\x5c\xab\xd5\x92\xd7\x93\x60\xbc\xd8\x90\x2e\xef\xfc\xda\x85\x6d\x72\xe7\x41\x74\x29\x42\x36\xcb\xb7\xc2\xee\xda\x3b\x56\xa8\xfd\xba\x0a\xb3\x0b\x9d\x0d\xe7\x97\xd6\x8d\x16\x0f\xbc\x78\xca\xb3\x65\x96\x65\x21\xd9\x42\x0a\x0b\x55\x2b\x0b\x3a\xdf\x34\xf2\xd2\x00\xaf\xeb\x98\x84\x12\x4d\xa1\x45\x63\x95\x0e\x67\x72\x1c\x3b\x5c\x0b\x74\x3a\x16\x25\x56\xbc\xad\x2d\x3c\xf0\xba\x45\xb3\x72\xff\x45\xc9\xdd\x86\x55\x38\xc0\xdd\x09\x1b\x4f\xf0\x25\xbd\x79\x6a\xa1\x01\x61\x9d\x0e\x97\xe0\x1d\x0a\xdd\x4f\x02\x0f\x5c\x0b\x7e\x57\xa3\x61\x99\x73\x8d\x9c\x5c\x2c\xe1\x90\x5d\xca\x8a\x5b\x9b\x87\xbe\x33\xca\x42\x58\x0a\x11\xbd\xde\xc0\x1d\x37\x78\x92\x0c\x03\x53\x24\xfb\xb7\x0f\xf4\x93\x78\x14\xb2\x2f\xa8\xb9\x6f\x37\xfe\xe3\xeb\x0d\xd5\x80\x89\xfb\x99\x4f\xff\x67\xbe\xa7\xe2\xed\x18\x89\x2d\x96\xc7\xc4\xf2\x36\xfa\xa9\x26\x38\x4c\xbd\xf9\x8b\x32\xc2\xd2\x24\xd0\xd3\x62\x7d\x35\x0c\x40\x9e\xf2\x54\x7f\xc1\xae\xc3\x73\xef\x0c\x19\x36\x70\x29\x3a\x1a\x94\xc2\x06\x42\xee\xd9\x67\xfc\xf5\x25\x28\x5b\x0c\x47\x8a\x28\x1f\x83\x17\x9f\xc4\x23\x96\x37\x32\xca\x84\x06\x9d\x84\xfd\xd3\xbd\x3b\xf9\xae\xbb\x5d\xf5\x45\x7c\x11\x88\xe5\xd8\x27\x3a\x34\x7e\xbe\xb8\x85\x0d\x11\x6f\x21\xf1\xd1\xd2\xd0\xf3\xa9\xb5\x8e\x38\xcb\xf4\x05\x0e\xee\x38\xd6\x68\x5b\x2d\x87\xef\xf8\xc1\x6d\xa4\xdd\x85\x7d\x84\x42\x49\x8b\x8f\xd6\x65\xd4\xfd\x5f\xc1\x7e\x10\x15\x4a\x2e\x61\xe1\x5e\x7f\x38\x86\xae\x00\xb5\x76\x36\x48\xef\x4c\x54\xee\x3d\xa6\x72\x04\x1a\x7b\xff\xc0\xeb\xa8\xc2\x99\x59\xc1\x7e\xf9\x77\x12\xff\xbf\x0d\x48\x51\x07\x15\xd1\x39\x29\x6a\x52\x4e\x1f\x69\x88\xe8\x57\x9c\x6f\xde\xef\xa8\xc7\x2d\x13\x2e\xdd\x39\x76\xec\x92\xd3\xdc\x21\x76\x9a\x18\xfe\x00\x3e\x66\xc5\x11\x23\xa2\xda\xa3\x4c\xf7\x47\xf8\x6c\x96\x36\x3d\x41\x52\x3e\xcf\x14\xcb\xe1\xe0\x38\x24\xad\x47\x29\x27\x2e\xd0\xde\xdc\x09\x77\xdd\x18\xc3\x84\x2a\x8e\x28\x3e\xe7\x8b\x65\x34\x32\x1a\xc1\x46\x2f\xae\x55\xba\xdb\x0f\x6a\x04\xae\x31\xb4\x90\x24\xc0\xe1\x72\x33\x8a\x2e\xb0\xaf\x9f\x81\x92\xc9\x23\x44\xd4\x50\x44\xbb\xd1\x54\x44\x87\x66\x13\xa1\x18\xf1\x38\x8e\x46\x56\xb7\x98\xce\x1e\xc9\x60\x44\x86\xdd\x2c\x91\xee\x88\x48\x8e\xd0\x0a\x40\x0d\x28\x9d\x6f\x1a\x03\x52\x47\xd8\xc4\xd4\xac\xa6\xc1\x44\x58\x8f\xe7\xbc\x98\xba\xb9\x88\xc3\x9b\xa0\xf1\xee\x28\x11\xfd\xfe\x14\x8d\x53\x89\x67\x7d\x2c\x43\x7a\x61\x03\x70\x89\x1f\x8d\x6f\x85\x37\xb2\xc4\xc7\xb8\xb1\x61\xf1\xf5\xb6\x77\xa6\x9f\x44\x9e\x6b\xf5\x1c\xcc\x67\x2d\x9c\xe2\xdd\xf4\x39\xdc\x51\x24\xfb\xc8\xcd\xbb\x70\xba\xf9\xb7\x1f\xfd\xd9\x36\xbd\x40\x1c\x95\x15\x0d\xba\x7f\xb5\xae\xfc\xe6\x67\x15\x96\x17\xf5\x95\x35\xfb\x0d\x8e\x44\xfd\x7a\x94\xff\xf3\xfa\x9b\x57\xde\x71\x1f\x4c\x1f\x45\x7f\x89\xb8\x79\xc7\xbe\x1b\xd4\xef\x42\x41\xfa\x8a\x09\x7b\x36\xc0\x9b\x86\x6e\x92\xe1\x03\xc9\x9f\xa8\x19\x8f\x59\x35\x86\x28\xba\xfd\xa1\x77\xe0\x72\xa1\xa4\x91\x8f\x03\xf7\x2b\x7f\x52\x41\x15\x85\x58\x4d\xd3\x34\x77\x13\x8f\x5b\x4a\x93\xf2\x0e\x4d\x91\xc3\xbc\x62\x5f\xad\x6e\x0b\xeb\x2f\x31\xc3\x9e\xf5\x15\xa0\x6c\xf7\x30\x1e\x85\xc2\x00\x5b\x82\x44\xae\xc3\x80\x53\x62\x51\x73\xcd\x7d\x1f\x5f\xb8\x6e\x96\x0c\xb6\xcb\xbe\xa1\x25\x34\x5c\x70\xc2\x93\x45\x22\x2e\xa8\x65\x55\xec\xc6\xbc\x97\xed\x7e\xb9\x74\xcf\xdf\x9b\x92\x5b\xec\xa9\x5a\xb1\x29\x4f\x69\xb4\x77\xf8\x50\x70\x5d\xe7\x66\xf9\xa1\x8f\x26\x43\x1e\xfd\xc0\x41\x19\x8d\x40\x03\x21\xc4\x02\x55\x7d\x8b\xa8\x58\x3c\x8c\xa6\xbd\x62\x96\x1a\x79\x7d\x54\x9f\x63\x72\x8f\xd5\x4c\xda\x43\xb2\xd8\x57\x31\x7b\xd7\x3b\x1a\x08\x3f\xed\x1a\x27\xec\x8f\x38\xf1\xdf\xaa\x1e\x75\xc7\xa3\x5e\x79\x39\x35\x43\x81\x13\xab\xbc\xcc\x84\x58\x2c\x4f\x14\x04\xc4\xc7\xf9\xf2\xdb\xba\x6e\xf8\xd5\x6e\x4c\x33\x50\x12\x0a\x8d\xbc\xff\x79\xca\x49\x5c\xcc\x60\x54\xfa\xcd\x51\x6f\xf0\xa7\x62\xee\x03\xfd\xe9\xeb\xdd\xb5\x41\x17\xcf\x37\x37\xf1\xd3\xd3\xf7\xef\xb1\xa0\x47\x6a\xa2\x96\x9c\x46\xb2\x25\xe4\x51\xdf\xa4\xf8\xa7\xd0\x7d\xe4\xe6\x9f\x8a\xe4\x08\xbc\xc5\x8e\x9b\x2f\x1a\x2b\xf1\x38\x56\x4f\x6a\xf3\xe5\x72\x92\xe6\x1e\x9b\x4d\x88\x38\x58\x5c\x24\x2c\x88\xe0\xb2\xc5\xd4\xe7\xae\x5b\x5e\x24\xd1\x44\xfb\x73\xf4\x3d\x97\x38\x47\x35\xfb\x6c\xaa\x8c\xb6\xfd\x65\xc2\xb4\xa4\xe5\x39\x74\xb9\x00\xc4\xc8\x15\x82\xc3\x47\x16\xe8\xd2\x75\x81\x0b\xa3\x3b\x42\x9f\xa3\xe3\x51\x30\x3d\x19\x4e\x74\x30\xc2\x46\x3a\x1f\x4f\x02\xd3\x6f\x18\xc9\xdb\xc0\x71\xbf\xa1\xf2\x44\x82\xc5\xff\x9b\xa5\xbf\x06\xe4\x53\xde\xa7\x58\xca\x00\x88\x30\xc0\x87\x6b\x6d\x8f\x5a\x3e\x82\x2d\x0f\xb8\xc1\x0d\xfd\xf0\x5c\xf0\xda\xb5\xfe\xbb\x27\x12\xbd\x6b\x45\x5d\xa2\x36\x70\x87\x95\xd2\x08\x86\x3f\xe0\xa8\xa5\xe2\x1f\x93\xa0\x5f\x8e\xc8\x18\x3d\x19\x27\x60\x10\xff\xf9\xe2\xd6\xf3\xd1\x1e\x11\x71\xca\xeb\x41\xd5\x90\x9e\xb8\x2d\x5e\x68\x66\xc3\x1d\x3e\x36\xd1\x63\x9b\x41\xb4\x92\x24\xf3\x93\x31\x76\x4b\x1a\xc7\x59\xf6\x30\xf7\x8a\xd3\x43\xf8\xf7\x55\xb8\xc4\x3f\x86\x0f\xa7\xb2\x3e\xf6\x86\xda\xf7\xef\xd4\xaf\x17\x13\x63\x13\x8b\xcb\x55\x6a\x31\xe9\x3f\xf1\x6a\xd6\x5f\xce\x12\x3d\xff\xf0\x69\x8a\xc7\x3b\x5c\x0e\xc5\xf1\xe0\xb7\x15\x54\x14\x83\x0f\xc1\x81\xd1\xaf\x27\x77\xcb\x4a\x9e\xb6\x70\xf2\x3a\x99\xf8\x16\x6f\x93\xa9\xdb\xc3\xc3\x70\xef\x1c\x47\xd6\x9d\x3a\xc1\xce\x0c\xbc\xa7\x1f\xd3\x5f\xe7\xfe\x13\x00\x00\xff\xff\x66\xf6\x59\xba\x35\x1b\x00\x00") +var _templateRuntimeTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x58\x4b\x8f\xdb\x38\x12\x3e\x5b\xbf\xa2\x56\xf0\x02\x56\xc3\x4d\x27\xb9\x6d\x16\x3e\x64\xf3\xd8\x18\xd8\x04\xc1\x26\x93\x4b\xd0\x18\xd0\x52\xc9\xe2\xb4\x4c\x6a\x48\xaa\x63\xc3\xd0\x7f\x5f\xf0\x25\x51\xf2\x63\x7a\xe7\x34\x97\x6e\x49\x2c\xd6\xe3\xab\xaf\x8a\x45\x9f\x4e\xab\xbb\xe4\xad\x68\x8e\x92\xed\x2a\x0d\xaf\x5e\xbc\xfc\xc7\x7d\x23\x51\x21\xd7\xf0\x81\xe6\xb8\x15\xe2\x11\x36\x3c\x27\xf0\xa6\xae\xc1\x0a\x29\x30\xeb\xf2\x09\x0b\x92\x7c\xab\x98\x02\x25\x5a\x99\x23\xe4\xa2\x40\x60\x0a\x6a\x96\x23\x57\x58\x40\xcb\x0b\x94\xa0\x2b\x84\x37\x0d\xcd\x2b\x84\x57\xe4\x45\x58\x85\x52\xb4\xbc\x48\x18\xb7\xeb\xff\xd9\xbc\x7d\xff\xf9\xeb\x7b\x28\x59\x8d\xe0\xbf\x49\x21\x34\x14\x4c\x62\xae\x85\x3c\x82\x28\x41\x47\xc6\xb4\x44\x24\xc9\xdd\xaa\xeb\x92\xc4\xc6\xf0\xcd\x6c\x69\xb9\x66\x7b\x04\x8d\xfb\xa6\xa6\x1a\x61\x87\x1c\x25\xd5\xa8\xac\x46\x95\x57\xb8\xa7\xf7\x4a\x33\x9d\x57\x8c\xef\xa0\x16\x3b\x96\x03\xe5\x05\x54\xa2\x2e\xac\x50\xb2\x17\x45\x5b\x23\x3c\xa1\x54\x4c\x18\x4f\xa8\x86\x9f\x54\x41\x6b\x22\xd2\xa2\x57\x69\x35\x52\xa5\x50\x2b\x92\x24\x1b\x0d\x15\x55\xf0\x0a\x4a\x21\xf7\x54\x2b\x02\x6f\x20\xf5\xee\xa4\xd0\xd0\xfc\x91\xee\xd0\x29\x53\x95\x68\xeb\x02\xb6\x08\xb8\x6f\xf4\xf1\x9e\xed\x1b\x21\x35\x16\x3e\xee\x64\x4f\x19\xef\x77\x94\x42\x7a\xb7\x15\xfc\x64\xba\x82\x4a\x88\x47\x05\x42\x42\x23\x6a\x96\x33\x54\xb0\x68\x84\x46\xae\x19\xad\x21\x3f\xe6\x35\xcb\xbd\xc6\x8c\x58\x4c\x14\xe6\x82\x17\xde\x2f\x93\x9e\x10\x40\x9c\x9f\x14\xb9\xee\xdd\x5c\x5a\x44\x62\xe7\x80\xa9\x84\x0b\x0d\x1c\x73\x54\x8a\xca\x23\x2c\xb8\x00\xd1\x68\x83\x90\x71\x71\x62\x18\xce\x0d\x07\xf8\x1e\x11\x9b\x64\x4b\xf3\xc7\x9f\x54\x16\xea\x3e\x17\xfb\x86\x6a\xb6\x65\x35\xd3\x47\x17\x61\x23\xf1\x89\x89\x56\x85\x14\x28\x93\x7a\xe4\x7a\xc8\x36\x14\x58\x32\x8e\x3d\xc0\x2b\xeb\x7d\xd7\x25\xb3\xd3\x69\xc8\xfd\x00\xff\xdc\xac\x9d\x4e\x80\xbc\x80\x2b\x1a\x9a\xc7\x5d\xaf\xc1\x7a\x81\x07\x6d\xc4\xe7\x90\x7e\x71\xa8\xa4\x91\x42\x23\x78\xc5\x16\x09\x5a\xbc\x31\xf3\x38\xf7\x9c\x7a\xbd\x86\x39\xf9\x64\x9f\x37\xbc\x14\x61\x99\x95\x26\x9f\x5e\x88\x7c\xf7\xc4\x0b\xef\x5f\xdb\xbd\x15\xcc\x05\x57\x1a\x16\xd6\xf0\xbd\xf3\x71\xba\xc5\xba\x35\x0b\x6f\x6b\x48\x4f\x27\xeb\x4f\x0a\xab\x15\x84\xcf\x0e\x4c\x5b\xac\x3b\xe4\xc4\xeb\x0b\xde\x9e\x2b\x0f\xf6\x67\x33\xf3\x34\x51\x6a\x3e\xdd\x56\x98\xc5\x60\xdc\xcc\x41\x1a\xbe\x0f\xa8\x56\x48\x0b\x94\x1e\x54\xb3\x34\x77\xf4\x7f\xbd\x86\x17\x5e\x9f\xa4\x7c\x87\x30\xe7\x0e\xdc\xcf\xa2\x40\xd5\xc3\xce\xdb\xfd\xc7\x20\x3f\xe7\xe4\x73\x78\xed\x3a\x87\xba\xfb\xf6\xc5\x14\xd2\xd1\x7d\x1c\xb6\xac\x81\x16\x45\xf4\xfe\xd2\x09\xc4\x59\xad\x62\x41\xf7\x32\xc8\x8f\xa2\x35\xd2\x52\x37\x8f\x3b\xe3\x49\x49\x6b\x85\xbd\x0f\x15\x55\x1f\x18\xd6\x96\x69\x5f\x73\xd1\x58\x18\x06\xf9\x35\xe0\xef\x30\x27\x76\x85\x78\x26\x8e\x10\x1b\x43\x6a\x82\x72\x1b\xbb\x0e\x4c\x5b\x84\x97\x4a\x87\x12\xbc\x0f\xfd\x71\xe5\xff\x93\x9d\x00\x5b\x53\x9e\x85\x3e\x88\xeb\xf4\x5e\x49\xdc\x31\xa5\x4d\x4a\xe6\x3d\xcf\x5d\x34\xc9\x6c\xb6\x5a\xb9\xba\xbf\xdc\x65\x47\x9d\x87\x71\x30\x31\x92\xb7\x82\x97\x6c\xd7\x07\xd6\x75\x91\x6b\x53\xe2\x04\xd4\x56\x77\xf0\x6a\xe8\x2b\x86\x69\xfa\x5a\x40\xa6\x67\xfd\x85\x82\xba\x11\xdc\x59\x7d\xd8\x43\x0d\x82\x6b\xde\x3e\x54\x94\x17\x35\x4a\x65\x3a\xa9\x3e\x36\x18\x5a\xb6\x72\x61\x5f\x68\x6c\x43\x70\x5d\x97\xf8\x6e\xbe\x48\xa2\x32\x0f\xee\x7e\x75\x16\x6c\xd0\x7d\x8d\x27\xa3\x5a\x36\xcf\xd7\xea\xcd\xee\xb9\x14\xbb\xad\xaa\xe8\x43\xea\x1b\xc4\xea\x0e\x36\xce\x1d\xd3\x6a\x25\xa7\xf5\x24\x18\x27\x36\xa4\xcb\x39\xbf\x32\x61\xab\xd4\x78\x10\x5c\x0a\x90\xcd\xd2\x1d\xd3\x55\xbb\x25\xb9\xd8\xaf\x4a\x3f\xbb\xd8\xb3\xe1\xfa\xd2\xaa\x91\xec\x89\xe6\xc7\x34\xc9\x92\x24\xf1\xc9\x66\x9c\x69\x28\x5b\x9e\xdb\xf3\x4d\x22\x2d\x14\xd0\xba\x0e\x49\x28\x50\xe5\x92\x35\x5a\x48\x7f\x26\x87\xb1\xc3\xb4\x40\xa3\x63\x51\x60\x49\xdb\x5a\xc3\x13\xad\x5b\x54\x4b\xf3\x9f\x15\xd4\x6c\x58\xfa\x03\xdc\x9c\xb0\xe1\x04\xcf\xec\x9b\xa3\x16\x2a\x60\xda\xe8\x30\x09\xae\x90\xc9\x7e\x12\x78\xa2\x92\xd1\x6d\x8d\x8a\x24\xc6\x35\xeb\xe4\x22\x83\x53\x72\x2b\x2b\x66\x6d\xee\xfb\xce\x28\x0b\x7e\xc9\x47\xf4\x7a\x0d\x5b\xaa\xf0\x22\x19\x06\xa6\x70\xf2\x5f\x17\xe8\x27\x76\x60\xbc\x2f\xa8\xb9\x6b\x37\xee\xe3\xeb\xb5\xad\x01\x15\xf6\x13\x97\xfe\xcf\x74\x6f\x8b\xb7\x23\x56\x6c\x91\x9d\x13\xcb\xd9\xe8\xa7\x1a\xef\xb0\xed\xcd\x5f\x84\x62\xda\x4e\x02\x3d\x2d\x56\x77\xc3\x00\xe4\x28\x6f\xeb\xcf\xdb\x35\x78\xee\x8d\x21\x45\x06\x2e\x05\x47\xbd\x52\x58\x83\xcf\x3d\xf9\x8c\x3f\xbf\x78\x65\x8b\xe1\x48\x61\xc5\xc1\x7b\xf1\x89\x1d\xb0\xd8\xf0\x20\xe3\x1b\x74\x14\xf6\x0f\xf3\x6e\xe4\xbb\xee\x61\xd9\x17\xf1\x4d\x20\xb2\xb1\x4f\xf6\xd0\xf8\xf1\xe2\x01\xd6\x96\x78\x0b\x8e\x07\x6d\x87\x9e\x4f\xad\x36\xc4\xc9\xe2\x17\x38\x99\xe3\x58\xa2\x6e\x25\x1f\xbe\xe3\x07\xb3\xd1\xee\xce\xf5\x01\x72\xc1\x35\x1e\xb4\xc9\xa8\xf9\xbf\x84\xfd\x20\xca\x04\xcf\x60\x61\x5e\xbf\x1b\x86\x2e\x01\xa5\x34\x36\xac\xde\x19\x2b\xcd\x7b\x48\xe5\x08\x34\xf2\xfe\x89\xd6\x41\x85\x31\xb3\x84\x7d\xf6\x4f\x2b\xfe\xb7\x35\x70\x56\x7b\x15\xc1\x39\xce\x6a\xab\xdc\x7e\xb4\x43\x44\xbf\x62\x7c\x73\x7e\x07\x3d\x66\xd9\xe2\xd2\x5d\x63\x47\x15\x9d\xe6\x06\xb1\xcb\xc4\x70\x07\xf0\x39\x2b\xce\x18\x11\xd4\x9e\x65\xba\x3f\xc2\x67\xb3\xb8\xe9\x31\x2b\xe5\xf2\x6c\x63\x39\x9d\x0c\x87\xb8\x76\x28\xa5\x96\x0b\x76\x6f\x6a\x84\xbb\x6e\x8c\x61\x44\x15\x43\x14\x97\xf3\x45\x16\x8c\x8c\x46\xb0\xd1\x8b\x69\x95\xe6\xf6\x83\x12\x81\x4a\xf4\x2d\x24\x0a\x70\xb8\xdc\x8c\xa2\xf3\xec\xeb\x67\xa0\x68\xf2\xf0\x11\x35\x36\xa2\x6a\x34\x15\xd9\x43\xb3\x09\x50\x8c\x78\x1c\x46\x23\x2d\x5b\x8c\x67\x8f\x68\x30\xb2\x86\xcd\x2c\x11\xef\x08\x48\x8e\xd0\xf2\x40\x0d\x28\x5d\x6f\x1a\x03\x52\x67\xd8\x84\xd4\x2c\xa7\xc1\x04\x58\xcf\xe7\xbc\x90\xba\x39\x0b\xc3\x1b\xb3\xe3\xdd\x59\x22\xfa\xfd\x31\x1a\x97\x12\x4f\xfa\x58\x86\xf4\xc2\x1a\xe0\x16\x3f\x1a\xd7\x0a\x37\xbc\xc0\x43\xd8\xd8\x90\xf0\xfa\xd0\x3b\xd3\x4f\x22\xcf\xb5\x7a\x0d\xe6\xab\x16\x2e\xf1\x6e\xfa\xec\xef\x28\x9c\x7c\xa4\xea\x9d\x3f\xdd\xdc\xdb\xf7\xfe\x6c\x9b\x5e\x20\xce\xca\xca\x0e\xba\x7f\xb6\xae\xdc\xe6\x67\x15\x96\x13\x75\x95\x35\xfb\x15\xce\x44\xdd\x7a\x90\xff\xe3\xfa\x9b\x97\xce\x71\x17\x4c\x1f\x45\x7f\x89\xd8\xbc\x23\xbf\x28\x94\xef\x7c\x41\xba\x8a\xf1\x7b\xd6\x40\x9b\xc6\xde\x24\xfd\x07\x2b\x7f\xa1\x66\x1c\x66\xe5\x18\xa2\xe0\xf6\x87\xde\x81\xdb\x85\x12\x47\x3e\x0e\xdc\xad\xfc\x41\x05\x95\x36\xc4\x72\x9a\xa6\xb9\x99\x78\xcc\x52\x9c\x94\x77\xa8\xf2\x14\xe6\x25\xf9\xaa\x65\x9b\x6b\x77\x89\x19\xf6\xac\xee\x00\x79\xbb\x87\xf1\x28\xe4\x07\xd8\x02\x38\x52\xe9\x07\x9c\x02\xf3\x9a\x4a\xea\xfa\xf8\xc2\x74\xb3\x68\xb0\xcd\xfa\x86\x16\xd1\x70\x41\x2d\x9e\x24\x10\x71\x61\x5b\x56\x49\x36\xea\x3d\x6f\xf7\x59\x66\x9e\x7f\x69\x0a\xaa\xb1\xa7\x6a\x49\xa6\x3c\xb5\xa3\xbd\xc1\xc7\x06\xd7\x75\x66\x96\x1f\xfa\x68\x34\xe4\xd9\x1f\x38\x6c\x46\x03\xd0\x60\x11\x22\x9e\xaa\xae\x45\x94\x24\x1c\x46\xd3\x5e\x31\x8b\x8d\xbc\x3e\xab\xcf\x31\xb9\xc7\x6a\x26\xed\x21\x5a\xec\xab\x98\xbc\xeb\x1d\xf5\x84\x9f\x76\x8d\x0b\xf6\x47\x9c\xf8\x7f\x55\x8f\xba\xe3\x59\xaf\xbc\x9d\x9a\xa1\xc0\x2d\xab\x9c\xcc\x84\x58\x24\x8d\x14\x78\xc4\xc7\xf9\x72\xdb\xba\x6e\xf8\xd5\x6e\x4c\x33\x10\x1c\x72\x89\xb4\xff\x79\xca\x48\xdc\xcc\x60\x50\xfa\xcd\x50\x6f\xf0\xa7\x24\xe6\x83\xfd\x33\xd4\x7b\xef\x9b\x99\xb7\x7c\xb1\xc7\xdb\xc3\xee\xd4\x8e\x62\x19\xa4\x41\xcf\xa4\xe8\xa7\x90\x7d\xa4\xea\xdf\xc2\xca\x59\xd0\x16\x15\x55\x5f\x24\x96\xec\x30\x56\x6f\xd5\xa6\x59\x36\x49\x6f\x8f\xc9\xda\x47\xea\x2d\x2e\xa2\xec\x07\xc7\xc9\x62\xea\x73\xd7\x65\x37\xc9\x33\xd1\xfe\x1c\x7d\xcf\x25\xcc\x59\xad\x3e\x9b\x22\xa3\x6d\x7f\x9a\x28\xad\xd5\xf2\x1c\x9a\xdc\x00\x62\xe4\x8a\x85\xc3\x45\xb6\x51\xdf\x98\xd5\xe4\xb9\x30\xba\x1b\xf4\x39\x3a\x1f\x01\xe3\x13\xe1\x42\xe7\xb2\xd8\x70\xe3\xe3\x45\x60\xfa\x0d\x23\x79\xed\xb9\xed\x36\x94\x8e\x48\xb0\xf8\xbb\xca\xdc\xf8\x9f\x4e\xf9\x1e\x63\xc9\x3d\x20\x4c\x01\x1d\xae\xb3\x3d\x6a\xe9\x08\xb6\xd4\xe3\x06\x1b\xfb\x83\x73\x4e\x6b\xd3\xf2\xb7\x47\x2b\xba\x6d\x59\x5d\xa0\x54\xb0\xc5\x52\x48\x04\x45\x9f\x70\xd4\x4a\xf1\xf7\x49\xd0\x2f\x47\x64\x0c\x9e\x8c\x13\x30\x88\xff\x78\xf1\xe0\xf8\xa8\xcf\x88\x38\xe5\xf5\xa0\x6a\x48\x4f\xd8\x16\x2e\x32\xb3\xe1\xee\x1e\x9a\xe7\xb9\x4d\x2f\x5a\x72\x2b\xf3\x83\x10\xf2\x60\x35\x8e\xb3\xec\x60\xee\x15\xc7\x87\xef\x6f\x4b\x7f\x79\x3f\xf8\x0f\x97\xb2\x3e\xf6\xc6\xb6\xed\xdf\x6c\x9f\x5e\x4c\x8c\x4d\x2c\x66\xcb\xd8\x62\xd4\x7f\xc2\x95\xac\xbf\x94\x45\x7a\xfe\xe5\xd2\x14\x8e\x75\xb8\x1d\x8a\xe1\xc1\xaf\x4b\x28\x6d\x0c\x2e\x04\x03\x46\xbf\x1e\xdd\x29\x4b\x7e\xd9\xc2\xc5\x6b\x64\xe4\x5b\xb8\x45\xc6\x6e\x0f\x0f\xc3\x7d\x73\x1c\x59\x77\xe9\xe4\xba\x32\xe8\x5e\x7e\x8c\x7f\x95\xfb\x5f\x00\x00\x00\xff\xff\x62\x41\x1e\xdf\x2d\x1b\x00\x00") func templateRuntimeTmplBytes() ([]byte, error) { return bindataRead( @@ -1165,7 +1165,7 @@ func templateRuntimeTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/runtime.tmpl", size: 6965, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/runtime.tmpl", size: 6957, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/builder/create.tmpl b/entc/gen/template/builder/create.tmpl index 812c2d926..bc5a44c67 100644 --- a/entc/gen/template/builder/create.tmpl +++ b/entc/gen/template/builder/create.tmpl @@ -86,7 +86,7 @@ func ({{ $receiver }} *{{ $builder }}) SaveX(ctx context.Context) *{{ $.Name }} {{- range $f := $fields }} {{- if or $f.Default }} if _, ok := {{ $mutation }}.{{ $f.MutationGet }}(); !ok { - v := {{ $.Package }}.{{ $f.DefaultName }}{{ if or $f.DefaultFunc $f.IsTime $f.IsUUID }}(){{ end }} + v := {{ $.Package }}.{{ $f.DefaultName }}{{ if $f.DefaultFunc }}(){{ end }} {{ $mutation }}.Set{{ $f.StructField }}(v) } {{- end }} diff --git a/entc/gen/template/meta.tmpl b/entc/gen/template/meta.tmpl index dab2ffa05..b938e7c7f 100644 --- a/entc/gen/template/meta.tmpl +++ b/entc/gen/template/meta.tmpl @@ -73,7 +73,7 @@ const ( {{- if and $f.Default (not $f.IsEnum) }} {{- $default := $f.DefaultName }} // {{ $default }} holds the default value on creation for the {{ $f.Name }} field. - {{ $default }} {{ if or $f.DefaultFunc $f.IsTime $f.IsUUID }}func() {{ end }}{{ $f.Type }} + {{ $default }} {{ if $f.DefaultFunc }}func() {{ end }}{{ $f.Type }} {{- end }} {{- if $f.UpdateDefault }} {{- $default := $f.UpdateDefaultName }} diff --git a/entc/gen/template/runtime.tmpl b/entc/gen/template/runtime.tmpl index 86468a8f2..8d9f419d7 100644 --- a/entc/gen/template/runtime.tmpl +++ b/entc/gen/template/runtime.tmpl @@ -151,7 +151,7 @@ func init() { {{- if and $f.Default (not $f.IsEnum) }} {{- $default := print $pkg "." $f.DefaultName }} // {{ $default }} holds the default value on creation for the {{ $f.Name }} field. - {{- $defaultType := print $f.Type.Type }}{{ if or $f.IsTime $f.IsUUID }}{{ $defaultType = print "func() " $f.Type }}{{ end }} + {{- $defaultType := print $f.Type.Type }}{{ if $f.DefaultFunc }}{{ $defaultType = print "func() " $f.Type }}{{ end }} {{- if and $f.HasGoType (not (hasPrefix $defaultType "func")) }} {{ $default }} = {{ $f.Type }}({{ $desc }}.Default.({{ $defaultType }})) {{- else }} diff --git a/entc/integration/ent/entql.go b/entc/integration/ent/entql.go index 583167a64..93e1cb6ab 100644 --- a/entc/integration/ent/entql.go +++ b/entc/integration/ent/entql.go @@ -287,6 +287,7 @@ var schemaGraph = func() *sqlgraph.Schema { user.FieldName: {Type: field.TypeString, Column: user.FieldName}, user.FieldLast: {Type: field.TypeString, Column: user.FieldLast}, user.FieldNickname: {Type: field.TypeString, Column: user.FieldNickname}, + user.FieldAddress: {Type: field.TypeString, Column: user.FieldAddress}, user.FieldPhone: {Type: field.TypeString, Column: user.FieldPhone}, user.FieldPassword: {Type: field.TypeString, Column: user.FieldPassword}, user.FieldRole: {Type: field.TypeEnum, Column: user.FieldRole}, @@ -1786,6 +1787,11 @@ func (f *UserFilter) WhereNickname(p entql.StringP) { f.Where(p.Field(user.FieldNickname)) } +// WhereAddress applies the entql string predicate on the address field. +func (f *UserFilter) WhereAddress(p entql.StringP) { + f.Where(p.Field(user.FieldAddress)) +} + // WherePhone applies the entql string predicate on the phone field. func (f *UserFilter) WherePhone(p entql.StringP) { f.Where(p.Field(user.FieldPhone)) diff --git a/entc/integration/ent/migrate/schema.go b/entc/integration/ent/migrate/schema.go index f72bed319..200d3d733 100644 --- a/entc/integration/ent/migrate/schema.go +++ b/entc/integration/ent/migrate/schema.go @@ -365,6 +365,7 @@ var ( {Name: "name", Type: field.TypeString}, {Name: "last", Type: field.TypeString, Default: "unknown"}, {Name: "nickname", Type: field.TypeString, Unique: true, Nullable: true}, + {Name: "address", Type: field.TypeString, Nullable: true}, {Name: "phone", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "password", Type: field.TypeString, Nullable: true}, {Name: "role", Type: field.TypeEnum, Enums: []string{"user", "admin", "free-user"}, Default: "user"}, @@ -381,21 +382,21 @@ var ( ForeignKeys: []*schema.ForeignKey{ { Symbol: "users_groups_blocked", - Columns: []*schema.Column{UsersColumns[10]}, + Columns: []*schema.Column{UsersColumns[11]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "users_users_spouse", - Columns: []*schema.Column{UsersColumns[11]}, + Columns: []*schema.Column{UsersColumns[12]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "users_users_parent", - Columns: []*schema.Column{UsersColumns[12]}, + Columns: []*schema.Column{UsersColumns[13]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.SetNull, diff --git a/entc/integration/ent/mutation.go b/entc/integration/ent/mutation.go index 108ba9d31..bedbbf3da 100644 --- a/entc/integration/ent/mutation.go +++ b/entc/integration/ent/mutation.go @@ -10620,6 +10620,7 @@ type UserMutation struct { name *string last *string nickname *string + address *string phone *string password *string role *user.Role @@ -10990,6 +10991,56 @@ func (m *UserMutation) ResetNickname() { delete(m.clearedFields, user.FieldNickname) } +// SetAddress sets the address field. +func (m *UserMutation) SetAddress(s string) { + m.address = &s +} + +// Address returns the address value in the mutation. +func (m *UserMutation) Address() (r string, exists bool) { + v := m.address + if v == nil { + return + } + return *v, true +} + +// OldAddress returns the old address value of the User. +// If the User object wasn't provided to the builder, the object is fetched +// from the database. +// An error is returned if the mutation operation is not UpdateOne, or database query fails. +func (m *UserMutation) OldAddress(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, fmt.Errorf("OldAddress is allowed only on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, fmt.Errorf("OldAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAddress: %w", err) + } + return oldValue.Address, nil +} + +// ClearAddress clears the value of address. +func (m *UserMutation) ClearAddress() { + m.address = nil + m.clearedFields[user.FieldAddress] = struct{}{} +} + +// AddressCleared returns if the field address was cleared in this mutation. +func (m *UserMutation) AddressCleared() bool { + _, ok := m.clearedFields[user.FieldAddress] + return ok +} + +// ResetAddress reset all changes of the "address" field. +func (m *UserMutation) ResetAddress() { + m.address = nil + delete(m.clearedFields, user.FieldAddress) +} + // SetPhone sets the phone field. func (m *UserMutation) SetPhone(s string) { m.phone = &s @@ -11718,7 +11769,7 @@ func (m *UserMutation) Type() string { // this mutation. Note that, in order to get all numeric // fields that were in/decremented, call AddedFields(). func (m *UserMutation) Fields() []string { - fields := make([]string, 0, 9) + fields := make([]string, 0, 10) if m.optional_int != nil { fields = append(fields, user.FieldOptionalInt) } @@ -11734,6 +11785,9 @@ func (m *UserMutation) Fields() []string { if m.nickname != nil { fields = append(fields, user.FieldNickname) } + if m.address != nil { + fields = append(fields, user.FieldAddress) + } if m.phone != nil { fields = append(fields, user.FieldPhone) } @@ -11764,6 +11818,8 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) { return m.Last() case user.FieldNickname: return m.Nickname() + case user.FieldAddress: + return m.Address() case user.FieldPhone: return m.Phone() case user.FieldPassword: @@ -11791,6 +11847,8 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er return m.OldLast(ctx) case user.FieldNickname: return m.OldNickname(ctx) + case user.FieldAddress: + return m.OldAddress(ctx) case user.FieldPhone: return m.OldPhone(ctx) case user.FieldPassword: @@ -11843,6 +11901,13 @@ func (m *UserMutation) SetField(name string, value ent.Value) error { } m.SetNickname(v) return nil + case user.FieldAddress: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAddress(v) + return nil case user.FieldPhone: v, ok := value.(string) if !ok { @@ -11934,6 +11999,9 @@ func (m *UserMutation) ClearedFields() []string { if m.FieldCleared(user.FieldNickname) { fields = append(fields, user.FieldNickname) } + if m.FieldCleared(user.FieldAddress) { + fields = append(fields, user.FieldAddress) + } if m.FieldCleared(user.FieldPhone) { fields = append(fields, user.FieldPhone) } @@ -11963,6 +12031,9 @@ func (m *UserMutation) ClearField(name string) error { case user.FieldNickname: m.ClearNickname() return nil + case user.FieldAddress: + m.ClearAddress() + return nil case user.FieldPhone: m.ClearPhone() return nil @@ -11996,6 +12067,9 @@ func (m *UserMutation) ResetField(name string) error { case user.FieldNickname: m.ResetNickname() return nil + case user.FieldAddress: + m.ResetAddress() + return nil case user.FieldPhone: m.ResetPhone() return nil diff --git a/entc/integration/ent/runtime.go b/entc/integration/ent/runtime.go index e01ab2804..0e609be36 100644 --- a/entc/integration/ent/runtime.go +++ b/entc/integration/ent/runtime.go @@ -149,4 +149,8 @@ func init() { userDescLast := userFields[2].Descriptor() // user.DefaultLast holds the default value on creation for the last field. user.DefaultLast = userDescLast.Default.(string) + // userDescAddress is the schema descriptor for address field. + userDescAddress := userFields[4].Descriptor() + // user.DefaultAddress holds the default value on creation for the address field. + user.DefaultAddress = userDescAddress.Default.(func() string) } diff --git a/entc/integration/ent/schema/user.go b/entc/integration/ent/schema/user.go index 11fcac4d4..95e2567a3 100644 --- a/entc/integration/ent/schema/user.go +++ b/entc/integration/ent/schema/user.go @@ -34,6 +34,9 @@ func (User) Fields() []ent.Field { field.String("nickname"). Optional(). Unique(), + field.String("address"). + Optional(). + DefaultFunc(func() string { return "static" }), field.String("phone"). Optional(). Unique(), diff --git a/entc/integration/ent/user.go b/entc/integration/ent/user.go index fdedb9192..1d26d341b 100644 --- a/entc/integration/ent/user.go +++ b/entc/integration/ent/user.go @@ -31,6 +31,8 @@ type User struct { Last string `json:"last,omitempty" graphql:"last_name"` // Nickname holds the value of the "nickname" field. Nickname string `json:"nickname,omitempty"` + // Address holds the value of the "address" field. + Address string `json:"address,omitempty"` // Phone holds the value of the "phone" field. Phone string `json:"phone,omitempty"` // Password holds the value of the "password" field. @@ -202,7 +204,7 @@ func (*User) scanValues(columns []string) ([]interface{}, error) { switch columns[i] { case user.FieldID, user.FieldOptionalInt, user.FieldAge: values[i] = &sql.NullInt64{} - case user.FieldName, user.FieldLast, user.FieldNickname, user.FieldPhone, user.FieldPassword, user.FieldRole, user.FieldSSOCert: + case user.FieldName, user.FieldLast, user.FieldNickname, user.FieldAddress, user.FieldPhone, user.FieldPassword, user.FieldRole, user.FieldSSOCert: values[i] = &sql.NullString{} case user.ForeignKeys[0]: // group_blocked values[i] = &sql.NullInt64{} @@ -261,6 +263,12 @@ func (u *User) assignValues(columns []string, values []interface{}) error { } else if value.Valid { u.Nickname = value.String } + case user.FieldAddress: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field address", values[i]) + } else if value.Valid { + u.Address = value.String + } case user.FieldPhone: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field phone", values[i]) @@ -399,6 +407,8 @@ func (u *User) String() string { builder.WriteString(u.Last) builder.WriteString(", nickname=") builder.WriteString(u.Nickname) + builder.WriteString(", address=") + builder.WriteString(u.Address) builder.WriteString(", phone=") builder.WriteString(u.Phone) builder.WriteString(", password=") diff --git a/entc/integration/ent/user/user.go b/entc/integration/ent/user/user.go index 05014bd26..9ddb0472e 100644 --- a/entc/integration/ent/user/user.go +++ b/entc/integration/ent/user/user.go @@ -25,6 +25,8 @@ const ( FieldLast = "last" // FieldNickname holds the string denoting the nickname field in the database. FieldNickname = "nickname" + // FieldAddress holds the string denoting the address field in the database. + FieldAddress = "address" // FieldPhone holds the string denoting the phone field in the database. FieldPhone = "phone" // FieldPassword holds the string denoting the password field in the database. @@ -120,6 +122,7 @@ var Columns = []string{ FieldName, FieldLast, FieldNickname, + FieldAddress, FieldPhone, FieldPassword, FieldRole, @@ -168,6 +171,8 @@ var ( OptionalIntValidator func(int) error // DefaultLast holds the default value on creation for the last field. DefaultLast string + // DefaultAddress holds the default value on creation for the address field. + DefaultAddress func() string ) // Role defines the type for the role enum field. diff --git a/entc/integration/ent/user/where.go b/entc/integration/ent/user/where.go index 70c25ec56..8d4d08b50 100644 --- a/entc/integration/ent/user/where.go +++ b/entc/integration/ent/user/where.go @@ -130,6 +130,13 @@ func Nickname(v string) predicate.User { }) } +// Address applies equality check predicate on the "address" field. It's identical to AddressEQ. +func Address(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldAddress), v)) + }) +} + // Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ. func Phone(v string) predicate.User { return predicate.User(func(s *sql.Selector) { @@ -664,6 +671,131 @@ func NicknameContainsFold(v string) predicate.User { }) } +// AddressEQ applies the EQ predicate on the "address" field. +func AddressEQ(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldAddress), v)) + }) +} + +// AddressNEQ applies the NEQ predicate on the "address" field. +func AddressNEQ(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.NEQ(s.C(FieldAddress), v)) + }) +} + +// AddressIn applies the In predicate on the "address" field. +func AddressIn(vs ...string) predicate.User { + v := make([]interface{}, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.User(func(s *sql.Selector) { + // if not arguments were provided, append the FALSE constants, + // since we can't apply "IN ()". This will make this predicate falsy. + if len(v) == 0 { + s.Where(sql.False()) + return + } + s.Where(sql.In(s.C(FieldAddress), v...)) + }) +} + +// AddressNotIn applies the NotIn predicate on the "address" field. +func AddressNotIn(vs ...string) predicate.User { + v := make([]interface{}, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.User(func(s *sql.Selector) { + // if not arguments were provided, append the FALSE constants, + // since we can't apply "IN ()". This will make this predicate falsy. + if len(v) == 0 { + s.Where(sql.False()) + return + } + s.Where(sql.NotIn(s.C(FieldAddress), v...)) + }) +} + +// AddressGT applies the GT predicate on the "address" field. +func AddressGT(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.GT(s.C(FieldAddress), v)) + }) +} + +// AddressGTE applies the GTE predicate on the "address" field. +func AddressGTE(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.GTE(s.C(FieldAddress), v)) + }) +} + +// AddressLT applies the LT predicate on the "address" field. +func AddressLT(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.LT(s.C(FieldAddress), v)) + }) +} + +// AddressLTE applies the LTE predicate on the "address" field. +func AddressLTE(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.LTE(s.C(FieldAddress), v)) + }) +} + +// AddressContains applies the Contains predicate on the "address" field. +func AddressContains(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.Contains(s.C(FieldAddress), v)) + }) +} + +// AddressHasPrefix applies the HasPrefix predicate on the "address" field. +func AddressHasPrefix(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.HasPrefix(s.C(FieldAddress), v)) + }) +} + +// AddressHasSuffix applies the HasSuffix predicate on the "address" field. +func AddressHasSuffix(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.HasSuffix(s.C(FieldAddress), v)) + }) +} + +// AddressIsNil applies the IsNil predicate on the "address" field. +func AddressIsNil() predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.IsNull(s.C(FieldAddress))) + }) +} + +// AddressNotNil applies the NotNil predicate on the "address" field. +func AddressNotNil() predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.NotNull(s.C(FieldAddress))) + }) +} + +// AddressEqualFold applies the EqualFold predicate on the "address" field. +func AddressEqualFold(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EqualFold(s.C(FieldAddress), v)) + }) +} + +// AddressContainsFold applies the ContainsFold predicate on the "address" field. +func AddressContainsFold(v string) predicate.User { + return predicate.User(func(s *sql.Selector) { + s.Where(sql.ContainsFold(s.C(FieldAddress), v)) + }) +} + // PhoneEQ applies the EQ predicate on the "phone" field. func PhoneEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { diff --git a/entc/integration/ent/user_create.go b/entc/integration/ent/user_create.go index 4eae4ed32..b0d682e41 100644 --- a/entc/integration/ent/user_create.go +++ b/entc/integration/ent/user_create.go @@ -81,6 +81,20 @@ func (uc *UserCreate) SetNillableNickname(s *string) *UserCreate { return uc } +// SetAddress sets the address field. +func (uc *UserCreate) SetAddress(s string) *UserCreate { + uc.mutation.SetAddress(s) + return uc +} + +// SetNillableAddress sets the address field if the given value is not nil. +func (uc *UserCreate) SetNillableAddress(s *string) *UserCreate { + if s != nil { + uc.SetAddress(*s) + } + return uc +} + // SetPhone sets the phone field. func (uc *UserCreate) SetPhone(s string) *UserCreate { uc.mutation.SetPhone(s) @@ -374,6 +388,10 @@ func (uc *UserCreate) defaults() { v := user.DefaultLast uc.mutation.SetLast(v) } + if _, ok := uc.mutation.Address(); !ok { + v := user.DefaultAddress() + uc.mutation.SetAddress(v) + } if _, ok := uc.mutation.Role(); !ok { v := user.DefaultRole uc.mutation.SetRole(v) @@ -471,6 +489,14 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) { }) _node.Nickname = value } + if value, ok := uc.mutation.Address(); ok { + _spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Value: value, + Column: user.FieldAddress, + }) + _node.Address = value + } if value, ok := uc.mutation.Phone(); ok { _spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{ Type: field.TypeString, diff --git a/entc/integration/ent/user_update.go b/entc/integration/ent/user_update.go index 59bd24048..23a3bd6a8 100644 --- a/entc/integration/ent/user_update.go +++ b/entc/integration/ent/user_update.go @@ -114,6 +114,26 @@ func (uu *UserUpdate) ClearNickname() *UserUpdate { return uu } +// SetAddress sets the address field. +func (uu *UserUpdate) SetAddress(s string) *UserUpdate { + uu.mutation.SetAddress(s) + return uu +} + +// SetNillableAddress sets the address field if the given value is not nil. +func (uu *UserUpdate) SetNillableAddress(s *string) *UserUpdate { + if s != nil { + uu.SetAddress(*s) + } + return uu +} + +// ClearAddress clears the value of address. +func (uu *UserUpdate) ClearAddress() *UserUpdate { + uu.mutation.ClearAddress() + return uu +} + // SetPhone sets the phone field. func (uu *UserUpdate) SetPhone(s string) *UserUpdate { uu.mutation.SetPhone(s) @@ -696,6 +716,19 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { Column: user.FieldNickname, }) } + if value, ok := uu.mutation.Address(); ok { + _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Value: value, + Column: user.FieldAddress, + }) + } + if uu.mutation.AddressCleared() { + _spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: user.FieldAddress, + }) + } if value, ok := uu.mutation.Phone(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeString, @@ -1358,6 +1391,26 @@ func (uuo *UserUpdateOne) ClearNickname() *UserUpdateOne { return uuo } +// SetAddress sets the address field. +func (uuo *UserUpdateOne) SetAddress(s string) *UserUpdateOne { + uuo.mutation.SetAddress(s) + return uuo +} + +// SetNillableAddress sets the address field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableAddress(s *string) *UserUpdateOne { + if s != nil { + uuo.SetAddress(*s) + } + return uuo +} + +// ClearAddress clears the value of address. +func (uuo *UserUpdateOne) ClearAddress() *UserUpdateOne { + uuo.mutation.ClearAddress() + return uuo +} + // SetPhone sets the phone field. func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne { uuo.mutation.SetPhone(s) @@ -1938,6 +1991,19 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) Column: user.FieldNickname, }) } + if value, ok := uuo.mutation.Address(); ok { + _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Value: value, + Column: user.FieldAddress, + }) + } + if uuo.mutation.AddressCleared() { + _spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: user.FieldAddress, + }) + } if value, ok := uuo.mutation.Phone(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeString, diff --git a/entc/integration/gremlin/ent/mutation.go b/entc/integration/gremlin/ent/mutation.go index 91b8794e2..8c0ba9909 100644 --- a/entc/integration/gremlin/ent/mutation.go +++ b/entc/integration/gremlin/ent/mutation.go @@ -10620,6 +10620,7 @@ type UserMutation struct { name *string last *string nickname *string + address *string phone *string password *string role *user.Role @@ -10990,6 +10991,56 @@ func (m *UserMutation) ResetNickname() { delete(m.clearedFields, user.FieldNickname) } +// SetAddress sets the address field. +func (m *UserMutation) SetAddress(s string) { + m.address = &s +} + +// Address returns the address value in the mutation. +func (m *UserMutation) Address() (r string, exists bool) { + v := m.address + if v == nil { + return + } + return *v, true +} + +// OldAddress returns the old address value of the User. +// If the User object wasn't provided to the builder, the object is fetched +// from the database. +// An error is returned if the mutation operation is not UpdateOne, or database query fails. +func (m *UserMutation) OldAddress(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, fmt.Errorf("OldAddress is allowed only on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, fmt.Errorf("OldAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAddress: %w", err) + } + return oldValue.Address, nil +} + +// ClearAddress clears the value of address. +func (m *UserMutation) ClearAddress() { + m.address = nil + m.clearedFields[user.FieldAddress] = struct{}{} +} + +// AddressCleared returns if the field address was cleared in this mutation. +func (m *UserMutation) AddressCleared() bool { + _, ok := m.clearedFields[user.FieldAddress] + return ok +} + +// ResetAddress reset all changes of the "address" field. +func (m *UserMutation) ResetAddress() { + m.address = nil + delete(m.clearedFields, user.FieldAddress) +} + // SetPhone sets the phone field. func (m *UserMutation) SetPhone(s string) { m.phone = &s @@ -11718,7 +11769,7 @@ func (m *UserMutation) Type() string { // this mutation. Note that, in order to get all numeric // fields that were in/decremented, call AddedFields(). func (m *UserMutation) Fields() []string { - fields := make([]string, 0, 9) + fields := make([]string, 0, 10) if m.optional_int != nil { fields = append(fields, user.FieldOptionalInt) } @@ -11734,6 +11785,9 @@ func (m *UserMutation) Fields() []string { if m.nickname != nil { fields = append(fields, user.FieldNickname) } + if m.address != nil { + fields = append(fields, user.FieldAddress) + } if m.phone != nil { fields = append(fields, user.FieldPhone) } @@ -11764,6 +11818,8 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) { return m.Last() case user.FieldNickname: return m.Nickname() + case user.FieldAddress: + return m.Address() case user.FieldPhone: return m.Phone() case user.FieldPassword: @@ -11791,6 +11847,8 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er return m.OldLast(ctx) case user.FieldNickname: return m.OldNickname(ctx) + case user.FieldAddress: + return m.OldAddress(ctx) case user.FieldPhone: return m.OldPhone(ctx) case user.FieldPassword: @@ -11843,6 +11901,13 @@ func (m *UserMutation) SetField(name string, value ent.Value) error { } m.SetNickname(v) return nil + case user.FieldAddress: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAddress(v) + return nil case user.FieldPhone: v, ok := value.(string) if !ok { @@ -11934,6 +11999,9 @@ func (m *UserMutation) ClearedFields() []string { if m.FieldCleared(user.FieldNickname) { fields = append(fields, user.FieldNickname) } + if m.FieldCleared(user.FieldAddress) { + fields = append(fields, user.FieldAddress) + } if m.FieldCleared(user.FieldPhone) { fields = append(fields, user.FieldPhone) } @@ -11963,6 +12031,9 @@ func (m *UserMutation) ClearField(name string) error { case user.FieldNickname: m.ClearNickname() return nil + case user.FieldAddress: + m.ClearAddress() + return nil case user.FieldPhone: m.ClearPhone() return nil @@ -11996,6 +12067,9 @@ func (m *UserMutation) ResetField(name string) error { case user.FieldNickname: m.ResetNickname() return nil + case user.FieldAddress: + m.ResetAddress() + return nil case user.FieldPhone: m.ResetPhone() return nil diff --git a/entc/integration/gremlin/ent/runtime.go b/entc/integration/gremlin/ent/runtime.go index 56ddcb5bc..3c7103f8f 100644 --- a/entc/integration/gremlin/ent/runtime.go +++ b/entc/integration/gremlin/ent/runtime.go @@ -149,4 +149,8 @@ func init() { userDescLast := userFields[2].Descriptor() // user.DefaultLast holds the default value on creation for the last field. user.DefaultLast = userDescLast.Default.(string) + // userDescAddress is the schema descriptor for address field. + userDescAddress := userFields[4].Descriptor() + // user.DefaultAddress holds the default value on creation for the address field. + user.DefaultAddress = userDescAddress.Default.(func() string) } diff --git a/entc/integration/gremlin/ent/user.go b/entc/integration/gremlin/ent/user.go index 75bd2049d..48d12506f 100644 --- a/entc/integration/gremlin/ent/user.go +++ b/entc/integration/gremlin/ent/user.go @@ -31,6 +31,8 @@ type User struct { Last string `json:"last,omitempty" graphql:"last_name"` // Nickname holds the value of the "nickname" field. Nickname string `json:"nickname,omitempty"` + // Address holds the value of the "address" field. + Address string `json:"address,omitempty"` // Phone holds the value of the "phone" field. Phone string `json:"phone,omitempty"` // Password holds the value of the "password" field. @@ -205,6 +207,7 @@ func (u *User) FromResponse(res *gremlin.Response) error { Name string `json:"name,omitempty"` Last string `json:"last,omitempty"` Nickname string `json:"nickname,omitempty"` + Address string `json:"address,omitempty"` Phone string `json:"phone,omitempty"` Password string `json:"password,omitempty"` Role user.Role `json:"role,omitempty"` @@ -219,6 +222,7 @@ func (u *User) FromResponse(res *gremlin.Response) error { u.Name = scanu.Name u.Last = scanu.Last u.Nickname = scanu.Nickname + u.Address = scanu.Address u.Phone = scanu.Phone u.Password = scanu.Password u.Role = scanu.Role @@ -314,6 +318,8 @@ func (u *User) String() string { builder.WriteString(u.Last) builder.WriteString(", nickname=") builder.WriteString(u.Nickname) + builder.WriteString(", address=") + builder.WriteString(u.Address) builder.WriteString(", phone=") builder.WriteString(u.Phone) builder.WriteString(", password=") @@ -341,6 +347,7 @@ func (u *Users) FromResponse(res *gremlin.Response) error { Name string `json:"name,omitempty"` Last string `json:"last,omitempty"` Nickname string `json:"nickname,omitempty"` + Address string `json:"address,omitempty"` Phone string `json:"phone,omitempty"` Password string `json:"password,omitempty"` Role user.Role `json:"role,omitempty"` @@ -357,6 +364,7 @@ func (u *Users) FromResponse(res *gremlin.Response) error { Name: v.Name, Last: v.Last, Nickname: v.Nickname, + Address: v.Address, Phone: v.Phone, Password: v.Password, Role: v.Role, diff --git a/entc/integration/gremlin/ent/user/user.go b/entc/integration/gremlin/ent/user/user.go index 0817bb703..ec996c912 100644 --- a/entc/integration/gremlin/ent/user/user.go +++ b/entc/integration/gremlin/ent/user/user.go @@ -25,6 +25,8 @@ const ( FieldLast = "last" // FieldNickname holds the string denoting the nickname field in the database. FieldNickname = "nickname" + // FieldAddress holds the string denoting the address field in the database. + FieldAddress = "address" // FieldPhone holds the string denoting the phone field in the database. FieldPhone = "phone" // FieldPassword holds the string denoting the password field in the database. @@ -86,6 +88,8 @@ var ( OptionalIntValidator func(int) error // DefaultLast holds the default value on creation for the last field. DefaultLast string + // DefaultAddress holds the default value on creation for the address field. + DefaultAddress func() string ) // Role defines the type for the role enum field. diff --git a/entc/integration/gremlin/ent/user/where.go b/entc/integration/gremlin/ent/user/where.go index 89d4e8eab..b19fea72b 100644 --- a/entc/integration/gremlin/ent/user/where.go +++ b/entc/integration/gremlin/ent/user/where.go @@ -119,6 +119,13 @@ func Nickname(v string) predicate.User { }) } +// Address applies equality check predicate on the "address" field. It's identical to AddressEQ. +func Address(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.EQ(v)) + }) +} + // Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ. func Phone(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { @@ -551,6 +558,105 @@ func NicknameNotNil() predicate.User { }) } +// AddressEQ applies the EQ predicate on the "address" field. +func AddressEQ(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.EQ(v)) + }) +} + +// AddressNEQ applies the NEQ predicate on the "address" field. +func AddressNEQ(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.NEQ(v)) + }) +} + +// AddressIn applies the In predicate on the "address" field. +func AddressIn(vs ...string) predicate.User { + v := make([]interface{}, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.Within(v...)) + }) +} + +// AddressNotIn applies the NotIn predicate on the "address" field. +func AddressNotIn(vs ...string) predicate.User { + v := make([]interface{}, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.Without(v...)) + }) +} + +// AddressGT applies the GT predicate on the "address" field. +func AddressGT(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.GT(v)) + }) +} + +// AddressGTE applies the GTE predicate on the "address" field. +func AddressGTE(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.GTE(v)) + }) +} + +// AddressLT applies the LT predicate on the "address" field. +func AddressLT(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.LT(v)) + }) +} + +// AddressLTE applies the LTE predicate on the "address" field. +func AddressLTE(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.LTE(v)) + }) +} + +// AddressContains applies the Contains predicate on the "address" field. +func AddressContains(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.Containing(v)) + }) +} + +// AddressHasPrefix applies the HasPrefix predicate on the "address" field. +func AddressHasPrefix(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.StartingWith(v)) + }) +} + +// AddressHasSuffix applies the HasSuffix predicate on the "address" field. +func AddressHasSuffix(v string) predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.Has(Label, FieldAddress, p.EndingWith(v)) + }) +} + +// AddressIsNil applies the IsNil predicate on the "address" field. +func AddressIsNil() predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldAddress) + }) +} + +// AddressNotNil applies the NotNil predicate on the "address" field. +func AddressNotNil() predicate.User { + return predicate.User(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldAddress) + }) +} + // PhoneEQ applies the EQ predicate on the "phone" field. func PhoneEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { diff --git a/entc/integration/gremlin/ent/user_create.go b/entc/integration/gremlin/ent/user_create.go index 6d8095004..3c1b1f9ea 100644 --- a/entc/integration/gremlin/ent/user_create.go +++ b/entc/integration/gremlin/ent/user_create.go @@ -80,6 +80,20 @@ func (uc *UserCreate) SetNillableNickname(s *string) *UserCreate { return uc } +// SetAddress sets the address field. +func (uc *UserCreate) SetAddress(s string) *UserCreate { + uc.mutation.SetAddress(s) + return uc +} + +// SetNillableAddress sets the address field if the given value is not nil. +func (uc *UserCreate) SetNillableAddress(s *string) *UserCreate { + if s != nil { + uc.SetAddress(*s) + } + return uc +} + // SetPhone sets the phone field. func (uc *UserCreate) SetPhone(s string) *UserCreate { uc.mutation.SetPhone(s) @@ -373,6 +387,10 @@ func (uc *UserCreate) defaults() { v := user.DefaultLast uc.mutation.SetLast(v) } + if _, ok := uc.mutation.Address(); !ok { + v := user.DefaultAddress() + uc.mutation.SetAddress(v) + } if _, ok := uc.mutation.Role(); !ok { v := user.DefaultRole uc.mutation.SetRole(v) @@ -448,6 +466,9 @@ func (uc *UserCreate) gremlin() *dsl.Traversal { }) v.Property(dsl.Single, user.FieldNickname, value) } + if value, ok := uc.mutation.Address(); ok { + v.Property(dsl.Single, user.FieldAddress, value) + } if value, ok := uc.mutation.Phone(); ok { constraints = append(constraints, &constraint{ pred: g.V().Has(user.Label, user.FieldPhone, value).Count(), diff --git a/entc/integration/gremlin/ent/user_update.go b/entc/integration/gremlin/ent/user_update.go index d5b2bd3cc..51ad5937f 100644 --- a/entc/integration/gremlin/ent/user_update.go +++ b/entc/integration/gremlin/ent/user_update.go @@ -112,6 +112,26 @@ func (uu *UserUpdate) ClearNickname() *UserUpdate { return uu } +// SetAddress sets the address field. +func (uu *UserUpdate) SetAddress(s string) *UserUpdate { + uu.mutation.SetAddress(s) + return uu +} + +// SetNillableAddress sets the address field if the given value is not nil. +func (uu *UserUpdate) SetNillableAddress(s *string) *UserUpdate { + if s != nil { + uu.SetAddress(*s) + } + return uu +} + +// ClearAddress clears the value of address. +func (uu *UserUpdate) ClearAddress() *UserUpdate { + uu.mutation.ClearAddress() + return uu +} + // SetPhone sets the phone field. func (uu *UserUpdate) SetPhone(s string) *UserUpdate { uu.mutation.SetPhone(s) @@ -668,6 +688,9 @@ func (uu *UserUpdate) gremlin() *dsl.Traversal { }) v.Property(dsl.Single, user.FieldNickname, value) } + if value, ok := uu.mutation.Address(); ok { + v.Property(dsl.Single, user.FieldAddress, value) + } if value, ok := uu.mutation.Phone(); ok { constraints = append(constraints, &constraint{ pred: g.V().Has(user.Label, user.FieldPhone, value).Count(), @@ -691,6 +714,9 @@ func (uu *UserUpdate) gremlin() *dsl.Traversal { if uu.mutation.NicknameCleared() { properties = append(properties, user.FieldNickname) } + if uu.mutation.AddressCleared() { + properties = append(properties, user.FieldAddress) + } if uu.mutation.PhoneCleared() { properties = append(properties, user.FieldPhone) } @@ -910,6 +936,26 @@ func (uuo *UserUpdateOne) ClearNickname() *UserUpdateOne { return uuo } +// SetAddress sets the address field. +func (uuo *UserUpdateOne) SetAddress(s string) *UserUpdateOne { + uuo.mutation.SetAddress(s) + return uuo +} + +// SetNillableAddress sets the address field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableAddress(s *string) *UserUpdateOne { + if s != nil { + uuo.SetAddress(*s) + } + return uuo +} + +// ClearAddress clears the value of address. +func (uuo *UserUpdateOne) ClearAddress() *UserUpdateOne { + uuo.mutation.ClearAddress() + return uuo +} + // SetPhone sets the phone field. func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne { uuo.mutation.SetPhone(s) @@ -1471,6 +1517,9 @@ func (uuo *UserUpdateOne) gremlin(id string) *dsl.Traversal { }) v.Property(dsl.Single, user.FieldNickname, value) } + if value, ok := uuo.mutation.Address(); ok { + v.Property(dsl.Single, user.FieldAddress, value) + } if value, ok := uuo.mutation.Phone(); ok { constraints = append(constraints, &constraint{ pred: g.V().Has(user.Label, user.FieldPhone, value).Count(), @@ -1494,6 +1543,9 @@ func (uuo *UserUpdateOne) gremlin(id string) *dsl.Traversal { if uuo.mutation.NicknameCleared() { properties = append(properties, user.FieldNickname) } + if uuo.mutation.AddressCleared() { + properties = append(properties, user.FieldAddress) + } if uuo.mutation.PhoneCleared() { properties = append(properties, user.FieldPhone) } diff --git a/entc/integration/migrate/entv2/runtime.go b/entc/integration/migrate/entv2/runtime.go index 72707aa51..b250eacdf 100644 --- a/entc/integration/migrate/entv2/runtime.go +++ b/entc/integration/migrate/entv2/runtime.go @@ -32,6 +32,10 @@ func init() { userDescPhone := userFields[4].Descriptor() // user.DefaultPhone holds the default value on creation for the phone field. user.DefaultPhone = userDescPhone.Default.(string) + // userDescBuffer is the schema descriptor for buffer field. + userDescBuffer := userFields[5].Descriptor() + // user.DefaultBuffer holds the default value on creation for the buffer field. + user.DefaultBuffer = userDescBuffer.Default.(func() []byte) // userDescTitle is the schema descriptor for title field. userDescTitle := userFields[6].Descriptor() // user.DefaultTitle holds the default value on creation for the title field. diff --git a/entc/integration/migrate/entv2/schema/user.go b/entc/integration/migrate/entv2/schema/user.go index e2a5a9458..ff3987d85 100644 --- a/entc/integration/migrate/entv2/schema/user.go +++ b/entc/integration/migrate/entv2/schema/user.go @@ -53,7 +53,8 @@ func (User) Fields() []ent.Field { field.String("phone"). Default("unknown"), field.Bytes("buffer"). - Optional(), + Optional(). + DefaultFunc(func() []byte { return []byte("null") }), // adding new column with supported default value // in the database side, will append this value to // all existing rows. diff --git a/entc/integration/migrate/entv2/user/user.go b/entc/integration/migrate/entv2/user/user.go index 666f1ec2b..a6b428903 100644 --- a/entc/integration/migrate/entv2/user/user.go +++ b/entc/integration/migrate/entv2/user/user.go @@ -114,6 +114,8 @@ var ( NicknameValidator func(string) error // DefaultPhone holds the default value on creation for the phone field. DefaultPhone string + // DefaultBuffer holds the default value on creation for the buffer field. + DefaultBuffer func() []byte // DefaultTitle holds the default value on creation for the title field. DefaultTitle string ) diff --git a/entc/integration/migrate/entv2/user_create.go b/entc/integration/migrate/entv2/user_create.go index d111e0ca3..16654d634 100644 --- a/entc/integration/migrate/entv2/user_create.go +++ b/entc/integration/migrate/entv2/user_create.go @@ -286,6 +286,10 @@ func (uc *UserCreate) defaults() { v := user.DefaultPhone uc.mutation.SetPhone(v) } + if _, ok := uc.mutation.Buffer(); !ok { + v := user.DefaultBuffer() + uc.mutation.SetBuffer(v) + } if _, ok := uc.mutation.Title(); !ok { v := user.DefaultTitle uc.mutation.SetTitle(v) diff --git a/schema/field/field.go b/schema/field/field.go index 5877d3161..7dd50a822 100644 --- a/schema/field/field.go +++ b/schema/field/field.go @@ -208,7 +208,12 @@ func (b *stringBuilder) Default(s string) *stringBuilder { return b } -// DefaultFunc sets the default value generating function of the field. +// DefaultFunc sets the function that is applied to set the default value +// of the field on creation. For example: +// +// field.String("cuid"). +// DefaultFunc(cuid.New) +// func (b *stringBuilder) DefaultFunc(fn func() string) *stringBuilder { b.desc.Default = fn return b @@ -490,15 +495,14 @@ func (b *bytesBuilder) Default(v []byte) *bytesBuilder { return b } -// DefaultFunc sets the function that is applied to set default value +// DefaultFunc sets the function that is applied to set the default value // of the field on creation. For example: // // field.Bytes("cuid"). // DefaultFunc(cuid.New) // -func (b *bytesBuilder) DefaultFunc(v func() []byte) *bytesBuilder { - b.desc.Default = v - +func (b *bytesBuilder) DefaultFunc(fn func() []byte) *bytesBuilder { + b.desc.Default = fn return b } diff --git a/schema/field/field_test.go b/schema/field/field_test.go index 01469f8f0..bce503aeb 100644 --- a/schema/field/field_test.go +++ b/schema/field/field_test.go @@ -183,8 +183,7 @@ func TestBytes(t *testing.T) { assert.True(t, fd.Info.Nillable) assert.True(t, fd.Info.ValueScanner()) - fd = field. - Bytes("uuid"). + fd = field.Bytes("uuid"). GoType(&uuid.UUID{}). DefaultFunc(func() []byte { return []byte("{}")