diff --git a/cmd/definitions/bindata/bindata.go b/cmd/definitions/bindata/bindata.go index 70c406bd3..cb0f86e2e 100644 --- a/cmd/definitions/bindata/bindata.go +++ b/cmd/definitions/bindata/bindata.go @@ -11,9 +11,8 @@ // cmd/definitions/tmpl/object.tmpl (2.388kB) // cmd/definitions/tmpl/operation.tmpl (2.113kB) // cmd/definitions/tmpl/pair.tmpl (513B) -// cmd/definitions/tmpl/service.tmpl (12.553kB) +// cmd/definitions/tmpl/service.tmpl (13.058kB) -//go:build tools // +build tools package bindata @@ -303,7 +302,7 @@ func cmdDefinitionsTmplPairTmpl() (*asset, error) { return a, nil } -var _cmdDefinitionsTmplServiceTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x4b\x93\xdb\xb8\x11\xbe\xeb\x57\xf4\xb2\xa6\x52\x92\x4b\xa6\x76\x93\x5c\x32\x29\x1d\x92\xb1\xe3\x4c\xed\xda\x9e\xf2\x78\xb3\x07\xef\xd6\x14\x44\x36\x25\x44\x24\x40\x03\x90\xc6\x2a\x45\xff\x3d\x85\x07\xdf\x20\x45\x8d\xbd\x8f\x83\xe7\x32\x14\xd0\xe8\x6e\xf4\xe3\x43\x37\x89\xc5\x02\x6e\x78\x8c\xb0\x46\x86\x82\x28\x8c\x61\x75\x80\x35\x2f\x7f\xc3\x9e\x12\x88\xb2\x78\x11\x63\x42\x19\x55\x94\x33\xf9\x77\x78\xf1\x16\xde\xbc\x7d\x0f\x2f\x5f\xdc\xbe\x0f\x27\x39\x89\xb6\x64\x8d\x70\x3c\x42\xf8\x86\x64\x08\xa7\xd3\x64\x42\xb3\x9c\x0b\x05\xd3\x09\x00\x40\x10\x71\xa6\xf0\x93\x0a\xec\x2f\xca\xdd\x03\x43\xb5\xd8\x28\x95\xbb\x9f\x8a\x66\x18\x4c\xec\xf3\x9a\xaa\xcd\x6e\x15\x46\x3c\x5b\xac\xf0\xc0\x59\x2c\x15\x17\x64\x8d\x8b\x35\x7f\x5e\x3c\xee\xff\xba\xc8\xb7\x6b\xc3\x21\x4a\x29\xb2\x82\xff\xc8\xb5\x12\xc5\x9e\x46\x28\xed\xaa\x70\xf4\x3a\x75\xc8\xf5\xa2\xd9\x64\xb2\x27\x02\x1e\xe0\xde\x4e\x09\xf7\xb3\x60\x1b\xde\xdb\x87\x97\x42\xf0\x62\xae\x52\x35\x7c\x9b\x1b\x5b\xba\x09\xbd\xf5\xf0\xc5\x4e\x10\x3d\x58\x23\x0e\xdf\xe1\xc7\x1d\x4a\x35\x99\x2c\x16\xf0\xfe\x90\x23\x50\x09\x6a\x83\xa0\x95\x80\x84\x8b\x86\xd5\x23\xce\xa4\xb2\x64\x4b\x08\x6a\x33\x81\x59\xff\x76\xf5\x5f\x8c\xd4\xfd\x41\x2a\xcc\x5e\xa3\x22\x31\x51\x04\xf4\xc6\x50\x82\x34\xa3\x90\x15\xc3\x9a\x35\x37\xf4\xe1\xc4\xc8\xea\x59\x2c\x76\x91\x82\xe3\xe4\x78\x7c\x0e\x82\xb0\x35\xc2\xd5\xc3\x1c\xae\xf6\x70\xbd\x84\xf0\x96\x25\x5c\x6a\xbd\xb4\x7d\x35\x05\x4d\x00\x3f\xc2\xd5\x3e\xbc\x8f\x78\x8e\x10\x58\x01\x41\x8b\x84\x71\xa5\x69\x5e\xa5\x7c\x45\xd2\xfa\xdc\x55\xce\xf4\x76\xae\x97\x7a\xda\xec\xec\x7f\xa0\xf8\x1d\x91\x51\x93\x8e\x26\x9a\xe0\x05\x95\x79\x4a\x0e\x85\x6d\xc0\xfd\xd5\x18\x2d\x7b\xc8\x34\x09\xb2\xb8\xfa\x69\xe8\x50\x46\x82\x1a\xa7\xd5\x27\x2c\xa7\xd3\xc9\x51\x19\xdb\xf7\xb1\x29\x7f\xd6\x1e\x4f\xc6\x33\xaf\x50\x79\xed\xfb\x48\xd3\x14\xd6\xa8\xfc\xd6\x4f\x04\xcf\xdc\x4c\x38\x59\x2c\x34\xa3\xe7\xf0\x7e\x43\x25\x24\x3b\x16\x19\x4d\xe5\x86\xef\xd2\xd8\x98\x74\x85\x10\x91\x34\xb5\x19\xee\x82\x14\x68\x96\xa7\x98\x21\x53\x28\xc2\x62\x3d\x82\x40\xb5\x13\x8c\xb2\x75\x21\xd7\x52\x97\x82\xa9\x04\x81\x24\x06\xce\xd2\x03\x10\x16\xb7\xc4\x64\x3c\xa6\x09\xc5\x38\x9c\x68\x3d\xfa\x36\x37\xe5\xf0\xcc\x8e\xcf\xfc\xdb\x3b\x1a\xb3\xc9\x6c\x0e\x7c\xab\x9d\xce\xc3\x57\xd8\xe6\x31\x33\x34\x34\xd1\x24\xc7\xd2\xc7\x56\x7f\x90\x59\x38\xf5\x71\xb6\x8b\xac\x57\x1c\xa9\x8f\xec\x58\x78\x47\x0e\x79\x47\xf6\x79\x87\x32\xc5\xc7\x79\xc7\x98\xb1\x72\x0f\x67\x11\xce\x21\x4f\x91\x48\x84\x8c\x6c\x11\xe4\x4e\x20\x90\x34\x05\xc3\x78\x43\x24\xac\x10\x19\x3c\x0a\xaa\x14\x32\x58\x61\xc2\x05\x6a\x4d\x9c\xc5\x7b\x14\xae\x2c\x3e\x07\x99\x79\xb5\x9e\x39\x2b\xf2\xf0\xbe\x63\x6b\x99\xcd\x9c\x41\x1c\xe2\x8d\x47\x12\x87\x9e\x66\xd0\xe1\x49\x1f\x8f\xcf\x02\x14\x27\x27\x68\x27\x7c\x1f\xaa\x78\x40\x61\x10\x5d\x5a\x3c\xfb\x51\xe6\x02\xb4\xa9\x93\xd6\xe0\xa2\x1a\xee\x41\x9f\x3a\xc1\x00\x0a\x5d\x8e\x44\x7e\xcf\x94\x50\xe4\x03\x21\xb7\xe4\xb5\x71\x6f\x15\xeb\x75\x24\xf1\x73\xbd\x18\x49\xbc\x6c\xa6\x12\x9e\xd5\x54\x98\xf5\x08\x6b\x03\x8a\x7c\x0a\xa0\x78\x59\x7b\x10\xc5\x4b\x57\x87\x94\x01\x33\xcb\xae\x99\x0d\x9a\xf4\x98\xf9\x37\x82\x94\x31\xa6\x37\xc0\xe2\x37\x51\x61\xfe\x7e\x64\xf1\xe6\xfc\x1d\xa1\x42\x16\xa1\xea\xcb\xe3\x31\xb9\x5b\xe5\xeb\x0d\x67\x49\x4a\x23\xa5\x47\x17\x0b\x78\x81\xb9\xc0\x48\xd7\xbd\xd7\xf0\xa3\x44\xc8\xb5\xb4\xf0\x27\xaa\x36\x8d\xb4\xa2\x4c\x2a\x24\xb1\x31\x7a\x2d\x65\x16\x0b\xe8\x90\x1a\x07\x92\x3c\x4f\x0f\x2e\x19\x5d\xae\xc3\x9e\xa4\x3b\x04\x7d\x26\xd8\xca\xcf\x31\xf3\x64\x77\x03\xd9\x4c\x2e\x07\x2b\xce\x53\x83\x6a\xc6\x19\x6d\xa1\xd3\x19\x68\x33\x75\x03\x56\x8f\x56\x83\xdf\xe3\xe1\xda\x94\x85\x95\x56\xc1\xbc\x9c\xfd\x8f\xd6\xef\x1a\x94\xd8\xe1\xdc\x85\xb3\xc3\x87\x54\x62\xbf\xe8\x7d\x13\x73\xbe\xa0\x26\xfb\x96\x1a\x1d\xc4\xaa\x3d\x9a\x92\x59\x3b\xef\x35\xc9\x61\x09\x19\xc9\x3f\x48\x25\x28\x5b\xff\x62\xff\x39\x85\x86\x23\xec\x92\x93\xa0\xa5\x7c\xb9\x1b\x67\x06\xb7\x9b\x26\xbc\x7a\xa5\x6b\x0e\x32\x27\x11\x36\x54\x50\x98\xe5\xa9\x6e\xbf\x02\xaa\x6b\xb3\x44\xcf\x07\x26\x73\xef\x53\x5d\xb7\x15\xa2\xaf\xf6\xe1\x6d\x49\xe0\x67\x90\x20\x51\x3b\xd1\xbb\xfc\x5f\x3b\x16\x49\xf3\xe0\xe8\xfc\x5c\xb4\x6d\x1f\x18\x3e\xd6\xb9\x4c\x7d\xf6\x99\x99\x41\x7c\x6c\xb0\x34\x31\x9e\x90\x5d\xaa\xc8\x2a\xc5\x7e\x09\x2d\x25\x2b\xfd\xfc\x3b\x73\xa0\x37\xbc\xb5\x56\xa0\xe8\x67\xd3\xcb\xb6\x6c\x5b\x21\x89\x76\x0b\x65\x31\x7e\x82\x10\xbe\x2d\xc7\x0d\xad\xac\xcf\x7d\xa7\xe7\x74\xdc\x4d\x7b\x63\xab\x58\xe5\xd4\x7f\xa8\x43\x42\x23\xa6\x60\x09\x7f\xb2\x69\xd5\x1c\x3f\x76\x4e\xec\x59\xef\x6e\x2a\x47\xf7\xed\xa5\x0b\x8a\x57\x09\xeb\xee\xc9\x4e\x34\xc6\xff\x6c\xa4\x99\xc2\xcd\xa9\x79\x3a\x95\xde\x2d\x8b\xb6\x5e\x33\x24\x72\x54\x33\xe5\xb5\x8c\x86\xbe\x6e\x32\xf5\x19\xa1\x8a\xd3\x73\x0e\x4d\x58\xcf\xc6\x93\xce\xc6\xcd\x78\x9c\xd7\xc7\xff\x52\x4a\xbe\x4a\xd8\xd6\x6e\x92\xf9\xc0\x42\x1f\x12\x5a\xa9\xd2\x6c\xfa\x41\x2f\xd1\xc7\x8a\xed\xe5\x73\x22\x24\xc6\xce\x8c\xd6\xc8\xad\x15\x7a\xc1\xe9\xd4\x34\xb4\xc9\x17\xf8\xf0\x8b\x86\x2f\xfb\xd2\x64\xb1\x80\x77\xf8\x71\x47\x05\xc6\x76\xd6\xe7\x10\x3d\x51\xa8\x5b\x52\x3b\x1f\xfc\x9b\x48\x23\x94\x50\xe1\xf3\x04\xd4\x7d\x31\x44\x56\x4d\x0f\xf4\xc3\x8b\x85\x3b\x09\x49\x3a\x4e\xdb\x92\xfa\x4b\x6b\x3b\x5a\xdf\x97\xcc\xc0\x57\x91\x68\xc3\x0a\x27\xc5\xc2\x0d\x91\x76\xe1\x90\x1a\xa5\xae\xe7\x49\x9b\x3b\x6b\xeb\xe8\x70\x76\x84\x49\xe3\xbc\xa6\xe1\x28\xdd\x3e\xd3\xeb\x45\x32\x08\x89\x77\x3d\x19\x61\xaa\x27\x43\x61\xeb\x08\x69\x30\xdd\x14\xbf\xcf\x7a\xb2\xc8\xd6\x25\x43\x5c\xa7\x3c\x57\x45\xa6\xcc\x60\xda\xc3\x67\x0e\x28\x04\x17\x45\x9d\x2a\x50\x6a\x33\x5e\x2f\xfb\xb2\xb7\xaa\x66\x8c\xa9\xaf\x41\x4b\x29\x4a\x16\xf3\x4f\x77\xbe\x0f\x73\x30\x10\x68\x1d\x60\x14\xa9\x16\xca\x47\xaa\xa2\x0d\xec\xc3\xef\xf1\x50\x1b\xf6\xe7\xf1\x85\xb9\xac\xff\x22\x5d\xee\x07\x4d\xaf\xe9\x62\xa5\xd1\x3f\xd2\xc4\xed\x35\x3c\x93\x50\xc7\x4e\x77\x1b\x71\xa6\x28\xdb\x61\x63\xa2\xd9\x9d\x8e\x63\xbd\x34\x65\xa7\x6f\xe1\xf0\xaa\x7d\x68\x6a\xc5\x70\xda\x0e\xbd\x59\x5f\xef\xdb\x8f\x3c\x17\xa2\xcf\x57\xfb\x0e\xd9\xd7\x87\x94\x83\x06\x4e\xba\x76\x45\xc3\xe3\x61\xb4\x79\x47\xe1\xec\xe7\x18\x79\x94\x80\x7e\x53\x5f\xbc\xd6\x6f\xda\x2e\xc0\x0f\x19\xb6\x02\x79\xb8\x3c\x60\xcf\x9c\x0b\x9f\x69\xcb\x3f\x4e\xc0\x9e\xea\xa8\xfd\xe4\x73\xfe\xc9\x91\xd8\xca\xe1\x46\x6d\xdd\x32\x44\xdd\x08\x75\xba\x33\x66\x29\x79\x74\xce\xe4\xe2\x5c\x1f\x79\xaa\xd0\x04\xbe\xb9\x14\xcd\xdc\x1b\x80\xbe\x63\xf4\x34\xaf\x3e\x99\xe9\x13\xba\x10\x69\xbe\x9b\x1d\xe1\x7b\x3c\xc8\xeb\x0f\xae\x8d\x3f\x7a\x82\x17\x4e\xa5\xff\x7c\x7b\x73\xd2\xad\xd2\x73\x60\x34\x3d\xd3\x3d\x8c\xe8\x05\xcd\x3b\xb3\x76\xf3\x50\x2c\xb1\xcd\x40\xde\xdb\x0c\xb8\xfc\xb5\xa6\xd0\x16\xb0\xef\x1f\xa8\xd4\x5a\x54\x99\x6d\xdf\x9b\xe7\x18\xd1\x84\x46\x40\x4c\xa3\x6b\x7b\x83\x1e\x06\x83\xaf\xce\xad\xca\xe7\x5a\x2d\xd7\x4c\x34\x4b\x36\x4f\xf0\x77\x59\x82\xb7\x9d\x6f\xf4\xe5\x39\x83\xab\xfd\xe0\x1b\xe8\x8e\x2b\x9e\xd4\xc4\x8d\xf1\xc3\xc5\x7d\xdb\xf6\xf2\xc6\xad\xb5\xe4\x4c\xef\xf6\x7b\x74\x69\xe3\xfa\x9e\x3f\x66\x47\xe6\xed\x25\xb6\x4f\x69\x26\xb6\x9e\x6e\x62\x2a\xe1\x59\x35\x3b\x1b\x14\xd3\xdb\x5d\x6c\x2f\x6d\x2f\xb6\xbf\x51\x7f\xf1\xb5\x8b\xb8\xb8\x68\xf0\xea\xe9\xa9\x24\xbe\x36\x10\xbf\x9a\x69\xdd\xe9\xd8\xb4\x4d\xf1\x61\x27\x67\x7a\x07\xae\x1a\xfa\x81\x73\x9b\xae\xed\x4f\xa5\x8b\x05\xa4\x7a\xee\xc1\xf8\xc5\x95\x77\x1a\x10\x04\x8f\x77\x11\xc6\x40\x19\xbc\xba\xbf\x7b\xfe\xdd\xb7\x7f\x0b\xdb\x0b\x6f\x13\xd8\x49\x14\x60\xbb\x12\x50\xe6\xab\x9b\xe5\x50\x16\x30\xc5\xd7\x37\xba\x66\x5c\xa0\xf9\x54\x25\x77\xb9\xb9\x08\x65\x24\x1a\x04\x08\xdb\xce\x95\x61\x51\x68\x86\x95\xe6\x4f\xf2\x65\xcf\x27\xe4\x4e\x01\xb6\x1d\xae\xc0\x7e\x64\x4e\xeb\xa2\x08\xd3\x83\xd7\xfb\xfe\x7a\xf9\x66\x83\xd1\x16\x44\xe3\x9d\x45\x78\xe9\xb1\xf6\x45\x4a\xcb\x33\x3b\xfb\x3d\x6b\xcb\xda\xd7\x8a\xe6\xb7\xa6\xa1\x77\xf4\x25\x99\xbf\xe4\xf4\x98\xb8\xbf\x36\xb3\x1f\x40\x7f\xe0\xad\xfb\x0c\xcd\xb2\x2d\xd5\xd3\x0f\x85\xae\xbd\x05\x5c\x69\x0d\xf7\x6d\xd0\xcf\x6c\x3c\x9b\x73\x97\x13\xbc\x96\x7c\x6a\x79\x38\xa6\xf4\xab\x95\x11\xf6\xb1\xfd\xcd\xc2\x7e\x7e\x6f\x7e\x7c\x37\x05\x47\x24\x50\x6f\x9e\x80\xbb\xf4\x08\xab\x43\x81\x5d\x61\xbd\xba\xb8\xca\xd9\xe9\x34\xab\x09\x9a\x9a\xf7\xfc\xe1\x1d\x11\x24\x93\xe1\xbd\x09\x4a\x4d\xe1\xc6\xdf\x99\x28\xab\x4f\xd8\x3c\x88\xd4\x27\xbd\x17\x27\x2d\xfc\x27\x89\xb6\x6b\xc1\x77\x2c\x76\x77\x19\x8a\xbb\x0b\x61\x25\xe9\x27\xaa\x36\x37\x96\x7e\x1a\xa9\x4f\x73\x68\x48\xbe\x21\x69\x8a\x42\x43\x74\xdb\x14\xb5\x75\x3d\x56\x19\xda\x5f\x4b\x6a\xa9\xb1\x1b\x6b\x69\x31\x7a\xff\x31\x26\x28\x8c\x0f\xa6\xb3\x66\x8d\x73\x95\x13\xb5\x29\xfc\xec\xd8\xde\x11\xb5\xb1\x1b\xf4\xa4\x07\x61\x31\x4c\xf1\xa3\x5b\x18\x04\x33\xf7\x8b\x41\xe0\xae\xc0\x05\x33\xef\xf5\x1b\x4d\xbe\x84\x60\xfe\x73\xf0\x73\xd0\xb9\x7c\xd4\x42\x64\x14\x02\x96\x1a\xf4\xb9\xc8\x88\x32\x48\x34\x0d\xec\x16\x75\x2c\x9e\x4e\x81\x29\x15\x2b\xc6\xa7\x13\xb8\xfb\x25\xd3\x59\x95\xf2\x34\x01\x86\xb6\xb0\x30\xf7\xb8\x5e\xf3\x18\x21\x68\x62\x4b\xa6\xc7\x8a\xf2\xa3\xa2\xea\x42\x8c\xc6\x5e\x1e\xea\xc9\xf0\xd6\x40\xaf\x59\x69\x2e\x16\x1c\xdb\x8a\x17\x78\x5a\x31\xbc\x65\x7b\x92\x52\x07\xaa\x2f\x3f\xe5\x18\x99\xfb\x14\x7a\xaa\xc6\x6b\x0e\xff\x88\xd4\x8e\xa4\xd7\x60\x25\x9d\x5a\x28\x3e\x80\xb3\xb6\x5d\x5a\x02\xc9\x73\x64\xb1\x29\xb1\xe5\x1c\x64\xe8\xd2\xca\xf4\xbf\xb5\xf0\x0e\xc3\xd0\x1a\x6c\x4f\x84\x2e\x89\xfb\x5e\x3d\x58\xe6\x3c\x57\xf3\xd2\x29\x83\x9f\x11\x8c\xdc\xf2\x82\x90\x5e\xf2\xcd\x52\x83\x7e\xe7\x40\xaa\x1f\x8f\xad\xf4\xab\xf0\xe6\x86\x64\xa8\x1d\xe0\xc9\xc0\xf7\x82\x66\x3f\x10\xa9\x5c\x2a\xbe\x64\xb1\xae\xe4\x37\x37\x3c\xcb\xc8\xe9\xa4\x35\x9e\x0d\x1c\x34\x6d\x08\x1f\x3a\x6d\xea\x73\x3e\xb0\x2c\x22\xfc\x0c\x60\xba\x3a\xe0\x2c\x68\x5a\xba\x82\xfc\x52\xf0\xd4\xcb\x7e\x05\x00\xfd\x9c\x08\x1b\x1d\x65\x6e\xcb\xb7\xb6\x32\x34\x85\x20\x3c\x6e\x68\x8a\xb0\x21\x2c\x4e\x29\x5b\x83\xf1\x9b\xde\xa0\xbb\x1e\x54\x2c\x33\x01\xfa\x30\x3a\x3c\xdb\xc5\x91\xd1\xbb\x27\xf4\x2e\x8e\x3a\x1b\xd8\xf5\xc8\x33\x0e\xa1\x8c\xaa\x12\x2b\x46\x5e\x73\xd1\x7f\x25\x98\xbc\xc3\x35\x95\x0a\x45\xdf\xab\x29\x31\xd5\x7d\xc3\x1c\xde\xe0\x63\x2f\xc9\xcc\xf7\xf6\xa2\x23\xe1\x3e\xda\x60\x46\x1c\x3b\x77\x63\x48\x67\xd3\xff\x03\x00\x00\xff\xff\x4f\x40\xbb\xd1\x09\x31\x00\x00") +var _cmdDefinitionsTmplServiceTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x4b\x93\xdb\xb8\xf1\xbf\xeb\x53\xf4\xb2\xa6\xfe\x25\xb9\x64\x6a\xf7\x9f\x5c\x32\xa9\x39\x24\x63\xc7\x99\xf2\x6b\xca\xe3\x24\x07\xef\xd6\x14\x86\x6c\x4a\x88\x48\x80\x06\x20\x8d\x55\x8a\xbe\x7b\x0a\x0f\x3e\x05\x50\xd4\xd8\xbb\x9b\x83\xe7\x32\x14\xd0\xe8\x6e\xf4\xe3\xc7\x6e\x02\x8b\x05\x5c\xf3\x14\x61\x89\x0c\x05\x51\x98\xc2\xc3\x0e\x96\xbc\xfe\x0d\x5b\x4a\x20\x29\xd2\x45\x8a\x19\x65\x54\x51\xce\xe4\x9f\xe1\xc5\x7b\x78\xf7\xfe\x23\xbc\x7c\x71\xf3\x31\x9e\x94\x24\x59\x93\x25\xc2\x7e\x0f\xf1\x3b\x52\x20\x1c\x0e\x93\x09\x2d\x4a\x2e\x14\x4c\x27\x00\x00\x51\xc2\x99\xc2\x2f\x2a\xb2\xbf\x28\x77\x0f\x0c\xd5\x62\xa5\x54\xe9\x7e\x2a\x5a\x60\x34\x31\xcf\x31\x44\x4b\xaa\x56\x9b\x87\x38\xe1\xc5\xe2\x01\x77\x9c\xa5\x52\x71\x41\x96\xb8\x58\xf2\xe7\xd5\xe3\xf6\x8f\x8b\x92\x50\x21\x1d\x83\xb1\x4b\xd6\x4b\x23\x36\xc9\x29\x32\x75\xde\x5a\x89\x62\x4b\x13\x74\x12\xc7\xab\xa9\x76\xa5\x5e\x34\x9b\x4c\xb6\x44\xc0\x3d\xdc\xd9\x29\xe1\x7e\x56\x6c\xe3\x3b\xfb\xf0\x52\x08\x5e\xcd\x35\xaa\xc6\xef\x4b\xe3\x00\x37\xa1\xed\x15\xbf\xd8\x08\xa2\x07\x5b\xc4\xf1\x07\xfc\xbc\x41\xa9\xdc\x90\xe5\x35\x59\x2c\xe0\xe3\xae\x44\xa0\x12\xd4\x0a\x41\x2b\x04\x19\x17\x1d\xb7\x25\x9c\x49\x65\xc9\xae\x20\x6a\xcd\x44\x66\xfd\xfb\x87\x7f\x63\xa2\xee\x76\x52\x61\xf1\x16\x15\x49\x89\x22\xa0\x37\x89\x12\xa4\x19\x85\xa2\x1a\xd6\xac\xb9\xa1\x8f\x27\x46\x56\x60\xb1\xd8\x24\x0a\xf6\x93\xfd\xfe\x39\x08\xc2\x96\x08\x17\xf7\x73\xb8\xd8\xc2\xe5\x15\xc4\x37\x2c\xe3\x52\xeb\xa5\x6d\xad\x29\x68\x06\xf8\x19\x2e\xb6\xf1\x5d\xc2\x4b\x84\xc8\x0a\x88\x7a\x24\x8c\x2b\x4d\xf3\x2a\xe7\x0f\x24\x6f\xcf\x5d\x94\x4c\x6f\xe7\xf2\x4a\x4f\x9b\x9d\xfd\x07\x14\xbf\x25\x32\xe9\xd2\xd1\x4c\x13\xbc\xa0\xb2\xcc\xc9\xae\xb2\x0d\xb8\xbf\x16\xa3\xab\x00\x99\x26\x41\x96\x36\x3f\x0d\x1d\xca\x44\x50\xe3\xc0\xf6\x84\xe5\x74\x38\x38\x2a\x63\xfb\x10\x9b\xfa\x67\xeb\xf1\x60\x3c\xf3\x0a\x95\xd7\xbe\x8f\x34\xcf\x61\x89\xca\x6f\xfd\x4c\xf0\xc2\xcd\xc4\x93\xc5\x42\x33\x7a\x0e\x1f\x57\x54\x42\xb6\x61\x89\xd1\x54\xae\xf8\x26\x4f\x8d\x49\x1f\x10\x12\x92\xe7\x16\x22\x5c\xc0\x02\x2d\xca\x1c\x0b\x64\x0a\x45\x5c\xad\x47\x10\xa8\x36\x82\x51\xb6\xac\xe4\x5a\xea\x5a\x30\x95\x20\x90\xa4\xc0\x59\xbe\x03\xc2\xd2\x9e\x98\x82\xa7\x34\xa3\x98\xc6\x13\xad\x47\x68\x73\x53\x0e\xcf\xec\xf8\xcc\xbf\xbd\xbd\x31\x9b\x2c\xe6\xc0\xd7\xda\xe9\x3c\x7e\x85\x7d\x1e\x33\x43\x43\x33\x4d\xb2\xaf\x7d\x6c\xf5\x07\x59\xc4\x53\x1f\x67\xbb\xc8\x7a\xc5\x91\xfa\xc8\xf6\x95\x77\xe4\x90\x77\x64\xc8\x3b\x94\x29\x3e\xce\x3b\xc6\x8c\x8d\x7b\x38\x4b\x70\x0e\x65\x8e\x44\x22\x14\x64\x8d\x20\x37\x02\x81\xe4\x39\x18\xc6\x2b\x22\xe1\x01\x91\xc1\xa3\xa0\x4a\x21\x83\x07\xcc\xb8\x40\xad\x89\xb3\x78\x40\xe1\xc6\xe2\x73\x90\x85\x57\xeb\x99\xb3\x22\x8f\xef\x8e\x6c\x2d\x8b\x99\x33\x88\x43\xbf\xf1\x48\xe2\x90\xd4\x0c\x3a\x3c\x09\xf1\xf8\x2a\x40\x71\x72\xa2\x7e\xc2\x87\x50\xc5\x03\x0a\x83\xe8\xd2\xe3\x19\x46\x99\x33\xd0\xa6\x4d\xda\x82\x8b\x66\x38\x80\x3e\x6d\x82\x01\x14\x3a\x1f\x89\xfc\x9e\xa9\xa1\xc8\x07\x42\x6e\xc9\x5b\xe3\xde\x26\xd6\xdb\x48\xe2\xe7\x7a\x36\x92\x78\xd9\x4c\x25\x3c\x6b\xa9\x30\x0b\x08\xeb\x03\x8a\x7c\x0a\xa0\x78\x59\x7b\x10\xc5\x4b\xd7\x86\x94\x01\x33\xcb\x63\x33\x1b\x34\x09\x98\xf9\x37\x82\x94\x31\xa6\x37\xc0\xe2\x37\x51\x65\xfe\x30\xb2\x78\x73\xfe\x56\x17\x88\x55\xa8\xd2\xcc\x04\xc9\xb4\x93\xcc\xb3\xfa\xf7\x35\x67\x59\x4e\xf5\x0b\xc5\xd1\x9f\xca\xe9\xc5\x02\xfe\x45\xd5\xaa\x93\x42\xc6\x03\xa4\x2c\xf3\x9d\xcb\x26\x97\xac\xb0\x25\xf9\x06\x41\x83\xba\x2d\xe3\x8c\x0b\xbc\xe9\xd9\x81\x26\x93\x8c\xd1\x03\xe7\xb9\x81\x25\x63\xcd\xbe\xd0\xe9\x0c\xf4\x3e\x8f\x23\x4e\x8f\x36\x83\xaf\x71\x77\x69\xea\xba\x46\xab\x68\x5e\xcf\xfe\x53\xeb\x77\x09\x4a\x6c\x70\xee\xe2\xd1\x25\x78\x2e\x31\x2c\x7a\xdb\x05\x8d\x6f\xa8\xc9\xb6\xa7\xc6\x11\xe4\xb4\x1e\x4d\xb1\xab\x9b\x81\xb7\xa4\x84\x2b\x28\x48\xf9\x49\x2a\x41\xd9\xf2\x17\xfb\xcf\x29\x34\x1c\x22\xe7\x40\x79\x4f\xf9\x7a\x37\xce\x0c\x6e\x37\x5d\x7c\xf4\x4a\xd7\x1c\x64\x49\x12\xec\xa8\xa0\xb0\x28\x73\xdd\x80\x45\x54\x17\x57\x99\x9e\x8f\x4c\xea\xdd\xe5\xba\xf0\xaa\x44\x5f\x6c\xe3\x9b\x9a\xc0\xcf\x20\x43\xa2\x36\x22\xb8\xfc\x6f\x1b\x96\x48\xf3\xe0\xe8\xfc\x5c\xb4\x6d\xef\x19\x3e\xb6\xb9\x4c\x7d\xf6\x99\x99\x41\x7c\xec\xb0\x34\x31\x9e\x91\x4d\xae\xc8\x43\x8e\x61\x09\x3d\x25\x1b\xfd\xfc\x3b\x73\xa8\x35\xbc\xb5\x5e\xa0\xe8\x67\xd3\xcd\xf6\x6c\xdb\xa4\xbc\x76\x0b\x65\x29\x7e\x81\x18\x7e\xac\xc7\x0d\xad\x6c\xcf\xfd\xa4\xe7\x74\xdc\x4d\x83\xb1\x55\xad\x72\xea\xdf\xb7\x21\xa1\x13\x53\x70\x05\xff\x67\xd3\xaa\x3b\xbe\x3f\x7a\xe5\xce\x82\xbb\x69\x1c\x1d\xda\x4b\x37\x8c\x0d\x49\xc6\x8e\xf7\x64\x27\x3a\xe3\xff\x6f\xa4\x99\xca\xcb\xa9\x79\x38\xd4\xde\xad\xab\xae\xa0\x19\x32\x39\xaa\x1b\xf2\x5a\x46\x43\xdf\x71\x32\x85\x8c\xd0\xc4\xe9\x29\x87\x66\x2c\xb0\xf1\xec\x68\xe3\x66\x3c\x2d\xdb\xe3\x7f\xa8\x25\x5f\x64\x6c\x6d\x37\xc9\x7c\x60\xa1\x5f\x12\x5a\xa9\xda\x6c\xfa\x41\x2f\x39\x1c\xaa\x66\xbc\x24\x42\x62\xea\xcc\x68\x8d\xdc\x5b\xa1\x17\x1c\x0e\x5d\x43\x9b\x7c\x81\x4f\xbf\x68\xf8\xb2\x9f\x4d\x16\x0b\xd0\xbd\x3f\x15\x98\xda\x59\x9f\x43\xf4\x44\xa5\x6e\x4d\xed\x7c\xf0\x77\x22\x8d\x50\x42\x85\xcf\x13\xd0\xf6\xc5\x10\x59\x33\x3d\xd0\xd0\x2e\x16\xee\x4d\x48\xf2\x71\xda\xd6\xd4\xdf\x5a\xdb\xd1\xfa\xbe\x64\x06\xbe\xaa\x44\x1b\x56\x38\xab\x16\xae\x88\xb4\x0b\x87\xd4\xa8\x75\x3d\x4d\xda\xdd\x59\x5f\x47\x87\xb3\x03\x26\x35\xf1\xad\xc3\xb9\xd1\xcf\x2d\x32\x52\x33\xf3\x42\x1c\xd4\x71\x1c\x79\x65\x57\x47\x11\x30\x6d\x95\x21\x42\xe2\x6d\x20\x4d\x4c\x49\x65\x28\x6c\x71\x21\x0d\xd0\x9b\x92\xf6\x59\x20\xb5\x6c\xb1\x32\xc4\x75\xca\x4b\x55\xa5\xcf\x0c\xa6\x01\x3e\x73\x40\x21\xb8\xa8\xaa\x4f\x81\x52\xdb\xf6\xf2\x2a\x94\xd2\x4d\x89\x63\xec\x7f\x09\x5a\x4a\x55\xc7\x98\x7f\xba\x9f\xbd\x9f\x83\xc1\x45\xeb\x15\xa3\x48\xb3\x50\x3e\x52\x95\xac\x60\x1b\xbf\xc6\x5d\x6b\xd8\x9f\xdc\x67\x26\xb8\xfe\x4b\x74\x11\x1f\x75\x03\x4c\x57\x30\x9d\xae\x90\x66\x6e\xaf\xf1\x89\x2c\xdb\x1f\xf5\xac\x09\x67\x8a\xb2\x0d\x76\x26\xba\x3d\xe7\x38\xd6\x57\xa6\x16\xf5\x2d\x1c\x5e\xb5\x8d\x4d\x01\x19\x4f\xfb\x59\x3d\x0b\x75\xb4\x61\x38\x3a\x13\x92\xbe\xdb\x77\xc8\xbe\x3e\xf8\x1c\x34\x70\x76\x6c\x57\x34\x3c\xee\x47\x9b\x77\x14\xf8\x7e\x8d\x91\x47\x09\x08\x9b\xfa\xec\xb5\x7e\xd3\x1e\xa3\xbe\xcf\xb0\x7d\xe4\x6f\xcc\x9a\xda\xf5\xf7\x47\x90\x3e\x6c\xda\x71\x2f\x82\xaf\x34\xef\x38\x21\x61\x13\x8f\x5d\xdf\x8d\xeb\xee\x5b\x6b\x30\xb4\x0f\x6d\x7c\x7f\x72\x99\xf0\xe4\x98\xed\x65\x7b\xa7\x34\xef\x59\xa5\x9d\xdf\x6d\xba\x13\x19\x5f\xf3\x38\x7a\x7b\x3f\xbd\xea\xf8\xaa\x38\x6a\xb6\xdc\x5e\xa9\x77\x64\x9b\x79\x4f\xce\xb4\x74\xe1\xa6\x92\xd7\x92\x3a\xcd\x65\x20\x64\x6a\xae\xc6\x48\xbc\x3c\xb2\x0e\x29\x4b\x64\xe9\xf4\xec\xa5\xf3\xe6\x63\x4a\x70\xcf\x3e\xae\x41\xe2\x59\x30\x4a\xfd\x7e\xdb\xef\xc7\xd6\x0d\x34\x83\x1f\xce\x7d\x5f\xb9\x0f\x3f\xa1\x42\xe9\x30\x6f\x8e\x3d\xf5\x7e\x2a\x91\xe6\xbc\x72\x0f\xaf\x71\x27\x2f\x3f\xb9\xaf\x37\x7b\xcf\xfb\x14\x0e\x30\xb4\x37\x27\xdd\x2a\x3d\x07\x46\xf3\x13\x4d\xe3\x88\x4f\x00\xe6\x5b\x67\xbf\x67\xac\x96\xd8\x1e\xb0\x0c\xf6\x80\x9d\xb8\x58\xd7\x91\x4a\x25\xa4\xed\xdc\xb1\xe7\x1d\x25\x26\x34\xa3\x09\x10\xf3\x7d\xc3\xb6\x84\x01\x06\x83\x47\x1e\x56\xe5\x53\x1d\xb6\xeb\x21\xbb\x45\xb9\x27\x6f\x8e\x59\x82\xf7\x2b\x4e\xe7\x73\x4c\xc9\xe0\x62\x3b\x78\x72\x70\xe4\x8a\x27\xf5\xee\x63\xfc\x70\x76\xbb\xbe\x3e\xbf\x5f\xef\x2d\x39\xd1\xb2\xff\x1e\xcd\xf9\xb8\x76\xf7\x7f\xb3\x11\xf7\x76\x8b\xeb\xa7\xb4\x8b\x6b\x4f\xbf\x38\x95\xf0\xac\x99\x9d\x0d\x8a\x09\xf6\x8f\xeb\x73\x1b\xc8\xf5\x6f\xd4\x41\x7e\xef\x13\xcf\xee\x63\xbc\x7a\x7a\x2a\xc0\xef\x2d\xe2\xaf\x66\x5a\xf7\x76\xec\xda\xa6\x3a\x40\x2f\x99\xde\x81\xab\x62\xdf\x70\x6e\xd3\xb5\x7f\xc4\xbd\x58\x40\xae\xe7\xee\x8d\x5f\x5c\x59\xae\x01\x41\xf0\x74\x93\x60\x0a\x94\xc1\xab\xbb\xdb\xe7\x3f\xfd\xf8\xa7\xb8\xbf\xf0\x26\x83\x8d\x44\x01\xb6\xef\x04\x65\x4e\x4b\x2d\x87\xba\x80\xa9\x4e\x4d\xe9\x92\x71\x81\xe6\xf0\x59\x6e\x4a\x73\x03\xce\x48\x34\x08\x10\xf7\x9d\x2b\xe3\xaa\x41\x88\x1b\xcd\x9f\xe4\xcb\xc0\xd1\xff\x51\x01\xb6\x1e\xae\xc0\xfe\xc1\x9c\xd6\x55\x11\xa6\x07\x2f\xb7\xe1\x3e\xe7\x7a\x85\xc9\x1a\x44\xe7\xab\x54\x7c\xee\x6b\xed\x9b\x94\x96\x27\x76\xf6\x7b\xd6\x96\xad\x43\xaa\xee\x11\xe3\xd0\xd1\x4c\x4d\xe6\x2f\x39\x3d\x26\x0e\xd7\x66\xf6\xa2\xc9\x1b\xde\xbb\x87\xd2\x2d\xdb\x72\x3d\x7d\x5f\xe9\x1a\x2c\xe0\x6a\x6b\xb8\x23\x61\x3f\xb3\xf1\x6c\x4e\x5d\x2a\xf1\x5a\xf2\xa9\xe5\xe1\x98\xd2\xaf\x55\x46\xd8\xc7\xfe\x51\x95\xbd\x36\xd1\xbd\x34\x61\x0a\x8e\x44\xa0\xde\x3c\x01\x77\xdb\x15\x1e\x76\x15\x76\xc5\xed\xea\xe2\xa2\x64\x87\xc3\xac\x25\x68\x6a\x8e\x77\xe2\x5b\x22\x48\x21\xe3\x3b\x13\x94\x9a\xc2\x8d\x7f\x30\x51\xd6\x9e\xb0\x79\x90\xa8\x2f\x7a\x2f\x4e\x5a\xfc\x57\x92\xac\x97\x82\x6f\x58\xea\xee\xa0\x54\x77\x4e\xe2\x46\x92\x6e\x37\xaf\x2d\xfd\x34\x51\x5f\xe6\xd0\x91\x7c\x4d\xf2\x1c\x85\x86\xe8\xbe\x29\x5a\xeb\x02\x56\x19\xda\x5f\x4f\x6a\xad\xb1\x1b\xeb\x69\x31\x7a\xff\x29\x66\x28\x8c\x0f\xa6\xb3\x6e\x8d\x73\x51\x12\xb5\xaa\xfc\xec\xd8\xde\x12\xb5\xb2\x1b\xf4\xa4\x87\xb9\x13\x82\x9f\xdd\xc2\x28\x9a\xb9\x5f\x0c\x22\x77\x75\x31\x9a\x79\xaf\x4d\x69\xf2\x2b\x88\xe6\x3f\x47\x3f\x47\x47\x97\xc6\x7a\x88\x8c\x42\xc0\x95\x06\x7d\x2e\x0a\xa2\x0c\x12\x4d\x23\xbb\x45\x1d\x8b\x87\x43\x64\x4a\xc5\x86\xf1\xe1\x00\xee\x5e\xd0\x74\xd6\xa4\x3c\xcd\x80\xa1\x2d\x2c\xcc\xfd\xbb\xb7\x3c\x45\x88\xba\xd8\x52\xe8\xb1\xaa\xfc\x68\xa8\x8e\x21\x46\x63\x2f\x8f\xf5\x64\x7c\x63\xa0\xd7\xac\x34\xf7\x49\xf6\x7d\xc5\x2b\x3c\x6d\x18\xde\xb0\x2d\xc9\xa9\x03\xd5\x97\x5f\x4a\x4c\x14\xa6\x97\xa0\xa7\x5a\xbc\xe6\xf0\x97\x44\x6d\x48\x7e\x09\x56\xd2\xa1\x87\xe2\x03\x38\x5b\xba\x6f\x39\xee\x03\x8b\xf9\x39\x07\x19\xbb\xb4\x6a\xbe\xac\xd8\x40\x8b\xe3\xd8\x1a\x6c\x4b\x84\x2e\x89\x43\x9f\x1e\x2c\x73\x5e\xaa\x79\xed\x94\xc1\x83\x22\x23\xb7\xbe\xd8\xa5\x97\xfc\x70\xa5\x41\xff\xe8\x85\xd4\x7e\x3d\xf6\xd2\xaf\xc1\x9b\x6b\x52\xa0\xf9\xb2\x73\x9c\x81\x1f\x05\x2d\xde\x10\xa9\x5c\x2a\xbe\x64\xa9\xae\xe4\x57\xd7\xbc\x28\xc8\xe1\xa0\x35\x9e\x0d\xbc\x68\xfa\x10\x3e\xf4\xb6\x69\xcf\xf9\xc0\xb2\x8a\xf0\x13\x80\xe9\xea\x80\x93\xa0\x69\xe9\x2a\xf2\x73\xc1\x53\x2f\xfb\x15\x00\xf4\x6b\x22\x6c\x74\x94\xb9\x2d\xdf\xd8\xca\xd0\x14\x82\xf0\xb8\xa2\x39\xc2\x8a\xb0\x34\xa7\x6c\x09\xc6\x6f\x7a\x83\xee\x56\x58\xb5\xcc\x04\xe8\xfd\xe8\xf0\xec\x17\x47\x46\xef\x40\xe8\x9d\x1d\x75\x36\xb0\xdb\x91\x67\x1c\x42\x19\x55\x35\x56\x8c\xbc\xdd\xa4\xff\x6a\x30\xf9\x80\x4b\x2a\x15\x8a\xd0\xa7\x29\x31\xd5\x7d\xc3\x1c\xde\xe1\x63\x90\x64\xe6\xfb\x7a\x71\x24\xe1\x2e\x59\x61\x41\x1c\x3b\x77\x51\x4c\x67\xd3\x7f\x03\x00\x00\xff\xff\x2c\xfe\x93\x50\x02\x33\x00\x00") func cmdDefinitionsTmplServiceTmplBytes() ([]byte, error) { return bindataRead( @@ -319,7 +318,7 @@ func cmdDefinitionsTmplServiceTmpl() (*asset, error) { } info := bindataFileInfo{name: "cmd/definitions/tmpl/service.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb7, 0x95, 0xc9, 0x72, 0x9d, 0x19, 0x73, 0x90, 0x52, 0xa4, 0xc5, 0x79, 0x82, 0xdd, 0xa9, 0x78, 0x70, 0x68, 0xa5, 0xa9, 0xc3, 0x17, 0xcb, 0x8e, 0xa4, 0xa0, 0x2a, 0x1f, 0xf9, 0x69, 0x0, 0x8}} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbf, 0x8c, 0x1b, 0xb7, 0x44, 0x19, 0x70, 0xe1, 0x83, 0x91, 0x6c, 0x88, 0x4a, 0xe4, 0x64, 0x86, 0x66, 0xe4, 0x10, 0x44, 0xfd, 0x30, 0x4e, 0xfd, 0x55, 0xdf, 0x7b, 0xd6, 0xb2, 0x94, 0x5f, 0x97}} return a, nil } diff --git a/cmd/definitions/tmpl/service.tmpl b/cmd/definitions/tmpl/service.tmpl index 56cb7ebf6..96f9f8c7c 100644 --- a/cmd/definitions/tmpl/service.tmpl +++ b/cmd/definitions/tmpl/service.tmpl @@ -7,6 +7,7 @@ import ( "net/http" "time" + . "github.com/beyondstorage/go-storage/v4/pairs" "github.com/beyondstorage/go-storage/v4/pkg/httpclient" "github.com/beyondstorage/go-storage/v4/services" . "github.com/beyondstorage/go-storage/v4/types" @@ -17,6 +18,7 @@ var _ services.ServiceError var _ httpclient.Options var _ time.Duration var _ http.Request +var _ Error // Type is the type for {{ .Name }} const Type = "{{ .Name }}" @@ -91,12 +93,8 @@ func setStorageSystemMetadata(s *StorageMeta, sm StorageSystemMetadata) { } {{- range $_, $v := .Pairs }} -{{- if not $v.Global }} +{{- if and (not $v.Global) (not $v.Conflict) }} {{- $pname := $v.Name | toPascal }} -{{- if $v.Conflict }} -// Deprecated: Use pairs.With{{ $pname }} instead. -// -{{- end }} // With{{ $pname }} will apply {{ $v.Name }} value to Options. // {{ $v.Description }} @@ -184,9 +182,9 @@ type pair{{ $pn }}{{$fnk}} struct { Enable{{ $pair.Name | toPascal }} bool {{- end }} // Default pairs - {{- range $_, $pair := $dp }} - has{{ $pair.Name | toPascal }} bool - {{ $pair.Name | toPascal }} {{ $pair.Type }} + {{- range $_, $pf := $dp }} + hasDefault{{ $pf.Pair.Name | toPascal }} bool + Default{{ $pf.Pair.Name | toPascal }} {{ $pf.Pair.Type }} {{- end }} } @@ -226,13 +224,13 @@ func parsePair{{ $pn }}{{ $fnk }}(opts []Pair) (pair{{ $pn }}{{ $fnk }}, error) result.Enable{{ $pair.Name | toPascal }} = true {{- end }} // Default pairs - {{- range $_, $pair := $dp }} - case "{{ $pair.Name }}": - if result.has{{ $pair.Name | toPascal }} { + {{- range $_, $pf := $dp }} + case "default_{{ $pf.Pair.Name }}": + if result.hasDefault{{ $pf.Pair.Name | toPascal }} { continue } - result.has{{ $pair.Name | toPascal }} = true - result.{{ $pair.Name | toPascal }} = v.Value.({{ $pair.Type }}) + result.hasDefault{{ $pf.Pair.Name | toPascal }} = true + result.Default{{ $pf.Pair.Name | toPascal }} = v.Value.({{ $pf.Pair.Type }}) {{- end }} } } @@ -245,6 +243,16 @@ func parsePair{{ $pn }}{{ $fnk }}(opts []Pair) (pair{{ $pn }}{{ $fnk }}, error) } {{- end }} + // Default pairs + {{- range $_, $pf := $dp }} + if result.hasDefault{{ $pf.Pair.Name | toPascal }} { + result.HasDefault{{ $pn }}Pairs = true + {{- range $_, $op := $pf.Funcs }} + result.Default{{ $pn }}Pairs.{{ $op | toPascal }} = append(result.Default{{ $pn }}Pairs.{{ $op | toPascal }}, With{{ $pf.Pair.Name | toPascal }}(result.Default{{ $pf.Pair.Name | toPascal }})) + {{- end }} + } + {{- end }} + {{ range $_, $pair := $fn.Required }} if !result.Has{{ $pair.Name | toPascal }} { return pair{{ $pn }}{{ $fnk }}{}, services.PairRequiredError{ Keys:[]string{ "{{ $pair.Name }}" } } diff --git a/cmd/definitions/type.go b/cmd/definitions/type.go index a2f9ac0fb..2539b6b06 100644 --- a/cmd/definitions/type.go +++ b/cmd/definitions/type.go @@ -85,19 +85,39 @@ type Namespace struct { HasFeatureLoosePair bool // Add a marker to support feature loose_pair } -// Defaultable returns sorted defaultable pairs. -func (n *Namespace) Defaultable() []*Pair { - ps := make([]*Pair, 0, len(n.defaultable)) +// PairFuncs contains pair and the func names that contain it. +type PairFuncs struct { + Pair *Pair + Funcs []string +} + +// Defaultable returns sorted PairFuncs slice for defaultable pairs. +func (n *Namespace) Defaultable() []*PairFuncs { + pfs := make([]*PairFuncs, 0, len(n.defaultable)) + for _, v := range n.defaultable { - ps = append(ps, v) + var ops []string + for _, op := range n.Funcs { + ps := make([]*Pair, 0) + ps = append(ps, op.Required...) + ps = append(ps, op.Optional...) + + for _, pair := range ps { + if pair.Name == v.Name { + ops = append(ops, op.Name) + break + } + } + } + pf := &PairFuncs{Pair: v, Funcs: ops} + pfs = append(pfs, pf) } - sort.Slice(ps, func(i, j int) bool { - x := ps - return x[i].Name < x[j].Name + sort.Slice(pfs, func(i, j int) bool { + return pfs[i].Pair.Name < pfs[j].Pair.Name }) - return ps + return pfs } // Sort will sort the namespace @@ -598,7 +618,7 @@ func (d *Data) FormatNamespace(srv *Service, n specs.Namespace) *Namespace { Description: pair.Description, } srv.pairs[name] = defaultPair - ns.defaultable[name] = defaultPair + ns.defaultable[defaultablePairName] = pair } d.ValidateNamespace(srv, ns) diff --git a/docs/rfcs/700-config-features-and-defaultpairs-via-connection-string.md b/docs/rfcs/700-config-features-and-defaultpairs-via-connection-string.md index a5e004967..f62a87197 100644 --- a/docs/rfcs/700-config-features-and-defaultpairs-via-connection-string.md +++ b/docs/rfcs/700-config-features-and-defaultpairs-via-connection-string.md @@ -137,15 +137,12 @@ We can get the feature pairs with prefix `enable_` from connection string or `Wi **Parse default pairs in `parsePair*New`** -We can convert the defaultable pairs with prefix `default_` passed in by connection string or `WithDefaultXxx()` to pairs and append it to the pair array of supported operations in `Default*Pairs` in `ParsePair*New()`. +We can convert the default pairs with prefix `default_` passed in by connection string or `WithDefaultXxx()` to original pairs and append it to the pair array of supported operations in `Default*Pairs` in `ParsePair*New()`. -**Handle conflict** +**Usage notes** -When parsing pairs in specific operation: - -- We should combine default pairs and `pairs from args`, and make sure that `pairs form args` can overwrite default pairs. -- When using `WithDefautl*Pairs()` and `WithDefaultXxx()` at the same time for initialization, we will pick `Default*Pairs` first, and append pairs that parsed from `WithDefaultXxx()`. -- The above conflict handling should be generated. +- Using `WithDefautl*Pairs()` and `WithDefaultXxx()` at the same time for initialization are not allowed at present. +- `WithEnableXxx()` will fill or overwrite the value of the corresponding field in `*Features` when it is used in conjunction with `With*Features()`. ## Rationale diff --git a/tests/generated.go b/tests/generated.go index a32115d08..5c8974e48 100644 --- a/tests/generated.go +++ b/tests/generated.go @@ -7,6 +7,7 @@ import ( "net/http" "time" + . "github.com/beyondstorage/go-storage/v4/pairs" "github.com/beyondstorage/go-storage/v4/pkg/httpclient" "github.com/beyondstorage/go-storage/v4/services" . "github.com/beyondstorage/go-storage/v4/types" @@ -17,6 +18,7 @@ var _ services.ServiceError var _ httpclient.Options var _ time.Duration var _ http.Request +var _ Error // Type is the type for tests const Type = "tests" @@ -159,18 +161,6 @@ func WithServiceFeatures(v ServiceFeatures) Pair { } } -// Deprecated: Use pairs.WithSize instead. -// -// WithSize will apply size value to Options. -// -// Size tests pair conflict -func WithSize(v int64) Pair { - return Pair{ - Key: "size", - Value: v, - } -} - // WithStorageClass will apply storage_class value to Options. // // StorageClass @@ -306,6 +296,8 @@ func parsePairServiceNew(opts []Pair) (pairServiceNew, error) { // Enable features + // Default pairs + if !result.HasCredential { return pairServiceNew{}, services.PairRequiredError{Keys: []string{"credential"}} } @@ -702,6 +694,16 @@ func parsePairStorageNew(opts []Pair) (pairStorageNew, error) { result.StorageFeatures.VirtualDir = true } + // Default pairs + if result.hasDefaultContentType { + result.HasDefaultStoragePairs = true + result.DefaultStoragePairs.Write = append(result.DefaultStoragePairs.Write, WithContentType(result.DefaultContentType)) + } + if result.hasDefaultStorageClass { + result.HasDefaultStoragePairs = true + result.DefaultStoragePairs.Write = append(result.DefaultStoragePairs.Write, WithStorageClass(result.DefaultStorageClass)) + } + if !result.HasName { return pairStorageNew{}, services.PairRequiredError{Keys: []string{"name"}} }