From b0bbb76b5141a951cdf3330783b6ec345befe6d2 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 27 Aug 2021 15:44:32 +0800 Subject: [PATCH 1/6] feat: Use go-codegen to generate code for pairs Signed-off-by: Xuanwo --- cmd/definitions/bindata/bindata.go | 24 +----------- cmd/definitions/generate.go | 62 +++++++++++++++++++++++++++++- cmd/definitions/tmpl/pair.tmpl | 24 ------------ cmd/definitions/type.go | 4 +- go.mod | 1 + go.sum | 4 ++ pairs/generated.go | 57 +++++++++++++++++---------- 7 files changed, 106 insertions(+), 70 deletions(-) delete mode 100644 cmd/definitions/tmpl/pair.tmpl diff --git a/cmd/definitions/bindata/bindata.go b/cmd/definitions/bindata/bindata.go index aa34018b4..f751da991 100644 --- a/cmd/definitions/bindata/bindata.go +++ b/cmd/definitions/bindata/bindata.go @@ -10,9 +10,9 @@ // cmd/definitions/tmpl/info.tmpl (1.702kB) // 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 (13.034kB) +//go:build tools // +build tools package bindata @@ -282,26 +282,6 @@ func cmdDefinitionsTmplOperationTmpl() (*asset, error) { return a, nil } -var _cmdDefinitionsTmplPairTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x90\x41\x6b\xe3\x30\x10\x85\xef\xfa\x15\x0f\xe3\x43\x02\x89\x75\xd9\x53\x96\x3d\x6d\xf6\xb0\x14\x92\x1c\x42\x7b\x2c\x8a\x3c\x51\x44\x6c\x49\xc8\x63\xb7\xc6\xf5\x7f\x2f\xb2\x93\x40\xe9\xa5\x3a\xcd\x7c\xf3\xe6\xf1\x46\x52\xe2\xaf\x2f\x09\x86\x1c\x45\xc5\x54\xe2\xd4\xc3\xf8\x47\x0f\x5d\x97\xb2\xa4\xb3\x75\x96\xad\x77\xcd\x6f\x6c\xf7\xd8\xed\x8f\xf8\xb7\xfd\x7f\x2c\x44\x50\xfa\xaa\x0c\x21\x28\x1b\x1b\x21\x6c\x1d\x7c\x64\x2c\x04\x00\x64\xda\x3b\xa6\x77\xce\xe6\x8e\x6d\x4d\x99\x98\x6b\x63\xf9\xd2\x9e\x0a\xed\x6b\x79\xa2\xde\xbb\xb2\x61\x1f\x95\x21\x69\xfc\xfa\x5e\x76\xbf\x64\xb8\x1a\x79\x61\x0e\xba\xb2\xe4\x6e\x3e\xc5\x8f\xb7\xb9\x0f\xd4\x64\x42\x2c\x85\x18\x86\x35\xa2\x72\x86\x90\xbf\xae\x90\x77\xd8\xfc\x41\x71\x48\x99\x31\x8e\xd3\x34\x0f\x4e\xd5\x94\x78\xde\x15\xbb\x54\x7e\x80\xfd\x41\x35\x5a\x55\x49\x23\x25\x5e\x2c\x5f\x86\xe1\xae\x1c\x47\xbc\xd9\xaa\x82\x0a\xa1\xea\x91\xf8\x6d\x6f\x1c\xd1\xa9\xaa\x25\xb0\xc7\x3e\x4c\x9f\x56\x08\x29\xc5\x2c\xd9\x52\xa3\xa3\x9d\x70\xb2\x3d\xb7\x4e\x7f\x33\x5e\x74\x37\xbf\x63\x1f\x52\xbf\x44\x8a\x8a\x61\xba\x3f\x12\xb7\xd1\x4d\x64\x06\xe9\x3d\x51\xbf\x41\xf6\x25\x44\xb6\x7a\x4c\x9f\x53\x9c\x0d\xba\x99\x8c\x62\xbe\x98\x5c\x99\x12\x7c\x06\x00\x00\xff\xff\x4a\xa4\x90\x14\x01\x02\x00\x00") - -func cmdDefinitionsTmplPairTmplBytes() ([]byte, error) { - return bindataRead( - _cmdDefinitionsTmplPairTmpl, - "cmd/definitions/tmpl/pair.tmpl", - ) -} - -func cmdDefinitionsTmplPairTmpl() (*asset, error) { - bytes, err := cmdDefinitionsTmplPairTmplBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "cmd/definitions/tmpl/pair.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8f, 0x39, 0x9e, 0xc1, 0x58, 0xb2, 0xe1, 0x28, 0x83, 0x3f, 0x14, 0x45, 0x7, 0x96, 0x7c, 0xf8, 0xb7, 0x32, 0x8d, 0xde, 0xd, 0x5e, 0xeb, 0x65, 0x68, 0x64, 0x58, 0xd9, 0xad, 0x94, 0xe5, 0x38}} - return a, nil -} - var _cmdDefinitionsTmplServiceTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\xdf\x73\xdb\xb8\xf1\x7f\xd7\x5f\xb1\xc7\xf1\x7c\x47\xca\x28\xd4\xdd\xb7\x7d\xa9\x3b\x7e\x68\x9d\x34\xf5\xdc\xe5\xe2\x39\xa7\xed\x43\xee\xc6\x03\x93\x4b\x09\x15\x09\x30\x00\x24\x47\xa3\xf2\x7f\xef\xe0\x07\x7f\x0a\xa0\x29\x27\x77\xd7\x87\xf8\xc5\x14\xb0\xd8\x5d\xec\x8f\x0f\x77\x09\xac\x56\x70\xcd\x53\x84\x35\x32\x14\x44\x61\x0a\x0f\x07\x58\xf3\xe6\x37\xec\x29\x81\xa4\x48\x57\x29\x66\x94\x51\x45\x39\x93\x7f\x86\x57\xef\xe0\xc7\x77\xef\xe1\xf5\xab\x9b\xf7\xf1\xac\x24\xc9\x96\xac\x11\x8e\x47\x88\x7f\x24\x05\x42\x55\xcd\x66\xb4\x28\xb9\x50\x30\x9f\x01\x00\x44\x09\x67\x0a\x3f\xa9\xc8\xfe\xa2\xdc\x3d\x30\x54\xab\x8d\x52\xa5\xfb\xa9\x68\x81\xd1\xcc\x3c\xc7\x10\xad\xa9\xda\xec\x1e\xe2\x84\x17\xab\x07\x3c\x70\x96\x4a\xc5\x05\x59\xe3\x6a\xcd\x5f\xd6\x8f\xfb\x3f\xae\x4a\x42\x85\x74\x0c\xa6\x2e\xd9\xae\x8d\xd8\x24\xa7\xc8\xd4\x79\x6b\x25\x8a\x3d\x4d\xd0\x49\x9c\xae\xa6\x3a\x94\x7a\xd1\x62\x36\xdb\x13\x01\xf7\x70\x67\xa7\x84\xfb\x59\xb3\x8d\xef\xec\xc3\x6b\x21\x78\x3d\xd7\xaa\x1a\xbf\x2b\x8d\x03\xdc\x84\xb6\x57\xfc\x6a\x27\x88\x1e\xec\x10\xc7\x3f\xe1\xc7\x1d\x4a\xe5\x86\x2c\xaf\xd9\x6a\x05\xef\x0f\x25\x02\x95\xa0\x36\x08\x5a\x21\xc8\xb8\xe8\xb9\x2d\xe1\x4c\x2a\x4b\x76\x05\x51\x67\x26\x32\xeb\xdf\x3d\xfc\x1b\x13\x75\x77\x90\x0a\x8b\xb7\xa8\x48\x4a\x14\x01\xbd\x49\x94\x20\xcd\x28\x14\xf5\xb0\x66\xcd\x0d\x7d\x3c\x33\xb2\x02\x8b\xc5\x2e\x51\x70\x9c\x1d\x8f\x2f\x41\x10\xb6\x46\xb8\xb8\x5f\xc2\xc5\x1e\x2e\xaf\x20\xbe\x61\x19\x97\x5a\x2f\x6d\x6b\x4d\x41\x33\xc0\x8f\x70\xb1\x8f\xef\x12\x5e\x22\x44\x56\x40\x34\x20\x61\x5c\x69\x9a\x37\x39\x7f\x20\x79\x77\xee\xa2\x64\x7a\x3b\x97\x57\x7a\xda\xec\xec\x3f\xa0\xf8\x2d\x91\x49\x9f\x8e\x66\x9a\xe0\x15\x95\x65\x4e\x0e\xb5\x6d\xc0\xfd\x75\x18\x5d\x05\xc8\x34\x09\xb2\xb4\xfd\x69\xe8\x50\x26\x82\x1a\x07\x76\x27\x2c\xa7\xaa\x72\x54\xc6\xf6\x21\x36\xcd\xcf\xce\x63\x65\x3c\xf3\x06\x95\xd7\xbe\x8f\x34\xcf\x61\x8d\xca\x6f\xfd\x4c\xf0\xc2\xcd\xc4\xb3\xd5\x4a\x33\x7a\x09\xef\x37\x54\x42\xb6\x63\x89\xd1\x54\x6e\xf8\x2e\x4f\x8d\x49\x1f\x10\x12\x92\xe7\x16\x22\x5c\xc0\x02\x2d\xca\x1c\x0b\x64\x0a\x45\x5c\xaf\x47\x10\xa8\x76\x82\x51\xb6\xae\xe5\x5a\xea\x46\x30\x95\x20\x90\xa4\xc0\x59\x7e\x00\xc2\xd2\x81\x98\x82\xa7\x34\xa3\x98\xc6\x33\xad\x47\x68\x73\x73\x0e\x2f\xec\xf8\xc2\xbf\xbd\xa3\x31\x9b\x2c\x96\xc0\xb7\xda\xe9\x3c\x7e\x83\x43\x1e\x0b\x43\x43\x33\x4d\x72\x6c\x7c\x6c\xf5\x07\x59\xc4\x73\x1f\x67\xbb\xc8\x7a\xc5\x91\xfa\xc8\x8e\xb5\x77\xe4\x98\x77\x64\xc8\x3b\x94\x29\x3e\xcd\x3b\xc6\x8c\xad\x7b\x38\x4b\x70\x09\x65\x8e\x44\x22\x14\x64\x8b\x20\x77\x02\x81\xe4\x39\x18\xc6\x1b\x22\xe1\x01\x91\xc1\xa3\xa0\x4a\x21\x83\x07\xcc\xb8\x40\xad\x89\xb3\x78\x40\xe1\xd6\xe2\x4b\x90\x85\x57\xeb\x85\xb3\x22\x8f\xef\x4e\x6c\x2d\x8b\x85\x33\x88\x43\xbf\xe9\x48\xe2\x90\xd4\x0c\x3a\x3c\x09\xf1\xf8\x2c\x40\x71\x72\xa2\x61\xc2\x87\x50\xc5\x03\x0a\xa3\xe8\x32\xe0\x19\x46\x99\x33\xd0\xa6\x4b\xda\x81\x8b\x76\x38\x80\x3e\x5d\x82\x11\x14\x3a\x1f\x89\xfc\x9e\x69\xa0\xc8\x07\x42\x6e\xc9\x5b\xe3\xde\x36\xd6\xbb\x48\xe2\xe7\x7a\x36\x92\x78\xd9\xcc\x25\xbc\xe8\xa8\xb0\x08\x08\x1b\x02\x8a\x7c\x0e\xa0\x78\x59\x7b\x10\xc5\x4b\xd7\x85\x94\x11\x33\xcb\x53\x33\x1b\x34\x09\x98\xf9\x37\x82\x94\x29\xa6\x37\xc0\xe2\x37\x51\x6d\xfe\x30\xb2\x78\x73\xfe\x56\x17\x88\x75\xa8\xfa\xf2\x78\x4a\xee\xae\x56\xf0\x2f\xaa\x36\xbd\x54\x31\x96\x26\x65\x99\x1f\x5c\xd6\xb8\xa4\x84\x3d\xc9\x77\x08\x1a\xbc\x6d\xb9\x66\x4c\xed\x4d\xc3\x1e\x04\x99\xa4\x8b\x1e\x38\xcf\x0d\xfc\x18\xab\x0d\x85\xce\x17\xa0\xf7\x73\x1a\x59\x7a\xb4\x1d\xfc\x1e\x0f\x97\xa6\x7e\x6b\xb5\x8a\x96\xcd\xec\x3f\xb5\x7e\x97\xa0\xc4\x0e\x97\x2e\xee\x5c\x22\xe7\x12\xc3\xa2\xf7\x7d\x70\xf8\x82\x9a\xec\x07\x6a\x9c\x40\x4b\xe7\xd1\x14\xb5\xba\xe8\x7f\x4b\x4a\xb8\x82\x82\x94\x1f\xa4\x12\x94\xad\x7f\xb1\xff\x9c\x42\xe3\xa1\x70\x0e\x64\x0f\x94\x6f\x76\xe3\xcc\xe0\x76\xd3\xc7\x41\xaf\x74\xcd\x41\x96\x24\xc1\x9e\x0a\x0a\x8b\x32\xd7\x8d\x56\x44\x75\x11\x95\xe9\xf9\xc8\xa4\xd8\x5d\xae\x0b\xac\x5a\xf4\xc5\x3e\xbe\x69\x08\xfc\x0c\x32\x24\x6a\x27\x82\xcb\xff\xb6\x63\x89\x34\x0f\x8e\xce\xcf\x45\xdb\xf6\x9e\xe1\x63\x97\xcb\xdc\x67\x9f\x85\x19\xc4\xc7\x1e\x4b\x13\xe3\x19\xd9\xe5\x8a\x3c\xe4\x18\x96\x30\x50\xb2\xd5\xcf\xbf\x33\x87\x4e\xe3\x5b\x1b\x04\x8a\x7e\x36\x5d\xeb\xc0\xb6\x6d\xca\x6b\xb7\x50\x96\xe2\x27\x88\xe1\xdb\x66\xdc\xd0\xca\xee\xdc\x77\x7a\x4e\xc7\xdd\x3c\x18\x5b\xf5\x2a\xa7\xfe\x7d\x17\x12\x7a\x31\x05\x57\xf0\x7f\x36\xad\xfa\xe3\xc7\x93\x57\xeb\x22\xb8\x9b\xd6\xd1\xa1\xbd\xf4\xc3\xd8\x90\x64\xec\x74\x4f\x76\xa2\x37\xfe\xff\x46\x9a\xa9\xb0\x9c\x9a\x55\xd5\x78\xb7\xa9\xae\x82\x66\xc8\xe4\xa4\xae\xc7\x6b\x19\x0d\x7d\xa7\xc9\x14\x32\x42\x1b\xa7\x4f\x39\x34\x63\x81\x8d\x67\x27\x1b\x37\xe3\x69\xd9\x1d\xff\x43\x23\xf9\x22\x63\x5b\xbb\x49\xe6\x03\x0b\xfd\x92\xd0\x4a\x35\x66\xd3\x0f\x7a\x49\x55\xd5\x4d\x77\x49\x84\xc4\xd4\x99\xd1\x1a\x79\xb0\x42\x2f\xa8\xaa\xbe\xa1\x4d\xbe\xc0\x87\x5f\x34\x7c\xd9\xcf\x23\xab\x15\xe8\x1e\x9f\x0a\x4c\xed\xac\xcf\x21\x7a\xa2\x56\xb7\xa1\x76\x3e\xf8\x3b\x91\x46\x28\xa1\xc2\xe7\x09\xe8\xfa\x62\x8c\xac\x9d\x1e\x69\x5c\x57\x2b\xf7\x26\x24\xf9\x34\x6d\x1b\xea\x2f\xad\xed\x64\x7d\x5f\x33\x03\x5f\x75\xa2\x8d\x2b\x9c\xd5\x0b\x37\x44\xda\x85\x63\x6a\x34\xba\x3e\x4d\xda\xdf\xd9\x50\x47\x87\xb3\x23\x26\x35\xf1\xad\xc3\xb9\xd5\xcf\x2d\x32\x52\x33\xf3\x42\x1c\xd5\x71\x1a\x79\x6d\x57\x47\x11\x30\x6d\x9d\x21\x42\xe2\x6d\x20\x4d\x4c\x49\x65\x28\x6c\x71\x21\x0d\xd0\x9b\xd2\xf5\x45\x20\xb5\x6c\xb1\x32\xc6\x75\xce\x4b\x55\xa7\xcf\x02\xe6\x01\x3e\x4b\x40\x21\xb8\xa8\xab\x4c\x81\x52\xdb\xf6\xf2\x2a\x94\xd2\x6d\x89\x63\xec\x7f\x09\x5a\x4a\x5d\xc7\x98\x7f\xba\x6f\xbd\x5f\x82\xc1\x45\xeb\x15\xa3\x48\xbb\x50\x3e\x52\x95\x6c\x60\x1f\x7f\x8f\x87\xce\xb0\x3f\xb9\xcf\x4c\x70\xfd\x97\xe8\x62\x3d\xea\x07\x98\xae\x60\x7a\xdd\x1f\xcd\xdc\x5e\xe3\x27\xb2\xec\x78\xd2\x9b\x26\x9c\x29\xca\x76\xd8\x9b\xe8\xf7\x96\xd3\x58\x5f\x99\x5a\xd4\xb7\x70\x7c\xd5\x3e\x36\x05\x64\x3c\x1f\x66\xf5\x22\xd4\xb9\x86\xe1\xe8\x4c\x48\xfa\x6a\xdf\x31\xfb\xfa\xe0\x73\xd4\xc0\xd9\xa9\x5d\xd1\xf0\xb8\x9f\x6c\xde\x49\xe0\xfb\x39\x46\x9e\x24\x20\x6c\xea\xb3\xd7\xfa\x4d\x7b\x8a\xfa\x3e\xc3\x0e\x91\xbf\x35\x6b\x6a\xd7\xdf\x9f\x40\xfa\xb8\x69\xa7\xbd\x08\x3e\xd3\xbc\xd3\x84\x84\x4d\x3c\x75\x7d\x3f\xae\xfb\x6f\xad\xd1\xd0\xae\xba\xf8\xfe\xec\x32\xe1\xd9\x31\x3b\xc8\xf6\x5e\x69\x3e\xb0\x4a\x37\xbf\xbb\x74\x4f\x64\x7c\xc3\xe3\xe4\xed\xfd\xfc\xaa\xe3\xb3\xe2\xa8\xdd\x72\x77\xa5\xde\x91\x6d\xe6\x3d\x39\xd3\xd1\x85\x9b\x4a\x5e\x4b\xea\x35\x97\x81\x90\x69\xb8\x1a\x23\xf1\xf2\xc4\x3a\xa4\x2c\x91\xa5\xf3\xb3\x97\x2e\xdb\x8f\x29\xc1\x3d\xfb\xb8\x06\x89\x17\xc1\x28\xf5\xfb\xed\x78\x9c\x5a\x37\xd0\x0c\xbe\x39\xf7\x7d\xe5\x3e\xfc\x84\x0a\xa5\x6a\xd9\x1e\x6f\xea\xfd\xd4\x22\xcd\xb9\xe4\x11\xbe\xc7\x83\xbc\xfc\xe0\xbe\xde\x1c\x3d\xef\x53\xa8\x60\x6c\x6f\x4e\xba\x55\x7a\x09\x8c\xe6\x4f\x34\x8d\x13\x3e\x01\x98\x6f\x9a\xc3\x9e\xb1\x5e\x62\x7b\xc0\x32\xd8\x03\xf6\xe2\x62\xdb\x44\x2a\x95\x90\x76\x73\xc7\x9e\x6b\x94\x98\xd0\x8c\x26\x40\xcc\xf7\x0d\xdb\x12\x06\x18\x8c\x1e\x6d\x58\x95\x9f\xea\xb0\x5d\x0f\xd9\x2f\xca\x3d\x79\x73\xca\x12\xbc\x5f\x71\x7a\x9f\x63\x4a\x06\x17\xfb\xd1\x13\x82\x13\x57\x3c\xab\x77\x9f\xe2\x87\xb3\xdb\xf5\xed\xf9\xfd\xfa\x60\xc9\x13\x2d\xfb\xef\xd1\x9c\x4f\x6b\x77\xff\x37\x1b\x71\x6f\xb7\xb8\x7d\x4e\xbb\xb8\xf5\xf4\x8b\x73\x09\x2f\xda\xd9\xc5\xa8\x98\x60\xff\xb8\x3d\xb7\x81\xdc\xfe\x46\x1d\xe4\xd7\x3e\xf1\xec\x3e\xc6\xab\xa7\xa7\x02\xfc\xda\x22\xfe\x6a\xa6\x75\x6f\xc7\xbe\x6d\xea\x83\xf2\x92\xe9\x1d\xb8\x2a\xf6\x07\xce\x6d\xba\x0e\x8f\xb2\x57\x2b\xc8\xf5\xdc\xbd\xf1\x8b\x2b\xcb\x35\x20\x08\x9e\xee\x12\x4c\x81\x32\x78\x73\x77\xfb\xf2\xbb\x6f\xff\x14\x0f\x17\xde\x64\xb0\x93\x28\xc0\xf6\x9d\xa0\xcc\xa9\xa8\xe5\xd0\x14\x30\xf5\xe9\x28\x5d\x33\x2e\xd0\x1c\x25\xca\x5d\x69\x6e\xba\x19\x89\x06\x01\xe2\xa1\x73\x65\x5c\x37\x08\x71\xab\xf9\xb3\x7c\x19\x38\xe2\x3f\x29\xc0\xb6\xe3\x15\xd8\x3f\x98\xd3\xba\x2e\xc2\xf4\xe0\xe5\x3e\xdc\xe7\x5c\x6f\x30\xd9\x82\xe8\x7d\x95\x8a\xcf\x7d\xad\x7d\x91\xd2\xf2\x89\x9d\xfd\x9e\xb5\x65\xe7\x90\xaa\x7f\xc4\x38\x76\x34\xd3\x90\xf9\x4b\x4e\x8f\x89\xc3\xb5\x99\xbd\x50\xf2\x03\x1f\xdc\x37\xe9\x97\x6d\xb9\x9e\xbe\xaf\x75\x0d\x16\x70\x8d\x35\xdc\x91\xb0\x9f\xd9\x74\x36\x4f\x5d\x1e\xf1\x5a\xf2\xb9\xe5\xe1\x94\xd2\xaf\x53\x46\xd8\xc7\xe1\x51\x95\xbd\x1e\xd1\xbf\x1c\x61\x0a\x8e\x44\xa0\xde\x3c\x01\x77\xab\x15\x1e\x0e\x35\x76\xc5\xdd\xea\xe2\xa2\x64\x55\xb5\xe8\x08\x9a\x9b\xe3\x9d\xf8\x96\x08\x52\xc8\xf8\xce\x04\xa5\xa6\x70\xe3\x3f\x99\x28\xeb\x4e\xd8\x3c\x48\xd4\x27\xbd\x17\x27\x2d\xfe\x2b\x49\xb6\x6b\xc1\x77\x2c\x75\x77\x4d\xea\xbb\x25\x71\x2b\x49\xb7\x9b\xd7\x96\x7e\x9e\xa8\x4f\x4b\xe8\x49\xbe\x26\x79\x8e\x42\x43\xf4\xd0\x14\x9d\x75\x01\xab\x8c\xed\x6f\x20\xb5\xd1\xd8\x8d\x0d\xb4\x98\xbc\xff\x14\x33\x14\xc6\x07\xf3\x45\xbf\xc6\xb9\x28\x89\xda\xd4\x7e\x76\x6c\x6f\x89\xda\xd8\x0d\x7a\xd2\x83\xb0\x14\xe6\xf8\xd1\x2d\x8c\xa2\x85\xfb\xc5\x20\x72\x57\x14\xa3\x85\xf7\x7a\x94\x26\xbf\x82\x68\xf9\x73\xf4\x73\x74\x72\x39\x6c\x80\xc8\x28\x04\x5c\x69\xd0\xe7\xa2\x20\xca\x20\xd1\x3c\xb2\x5b\xd4\xb1\x58\x55\x91\x29\x15\x5b\xc6\x55\x05\xee\xfe\xcf\x7c\xd1\xa6\x3c\xcd\x80\xa1\x2d\x2c\xcc\x3d\xbb\xb7\x3c\x45\x88\xfa\xd8\x52\xe8\xb1\xba\xfc\x68\xa9\x4e\x21\x46\x63\x2f\x8f\xf5\x64\x7c\x63\xa0\xd7\xac\x34\xf7\x49\x8e\x43\xc5\x6b\x3c\x6d\x19\xde\xb0\x3d\xc9\xa9\x03\xd5\xd7\x9f\x4a\x4c\x14\xa6\x97\xa0\xa7\x3a\xbc\x96\xf0\x97\x44\xed\x48\x7e\x09\x56\x52\x35\x40\xf1\x11\x9c\x2d\xdd\xb7\x1c\xf7\x81\xc5\xfc\x5c\x82\x8c\x5d\x5a\xb5\x5f\x56\x6c\xa0\xc5\x71\x6c\x0d\xb6\x27\x42\x97\xc4\xa1\x4f\x0f\x96\x39\x2f\xd5\xb2\x71\xca\xe8\x41\x91\x91\xdb\x5c\xe0\xd2\x4b\xbe\xb9\xd2\xa0\x7f\xf2\x42\xea\xbe\x1e\x07\xe9\xd7\xe2\xcd\x35\x29\xd0\x7c\xd9\x39\xcd\xc0\xf7\x82\x16\x3f\x10\xa9\x5c\x2a\xbe\x66\xa9\xae\xe4\x37\xd7\xbc\x28\x48\x55\x69\x8d\x17\x23\x2f\x9a\x21\x84\x8f\xbd\x6d\xba\x73\x3e\xb0\xac\x23\xfc\x09\xc0\x74\x75\xc0\x93\xa0\x69\xe9\x6a\xf2\x73\xc1\x53\x2f\xfb\x15\x00\xf4\x73\x22\x6c\x72\x94\xb9\x2d\xdf\xd8\xca\xd0\x14\x82\xf0\xb8\xa1\x39\xc2\x86\xb0\x34\xa7\x6c\x0d\xc6\x6f\x7a\x83\xee\x56\x58\xbd\xcc\x04\xe8\xfd\xe4\xf0\x1c\x16\x47\x46\xef\x40\xe8\x9d\x1d\x75\x36\xb0\xbb\x91\x67\x1c\x42\x19\x55\x0d\x56\x4c\xbc\xdd\xa4\xff\x1a\x30\xf9\x09\xd7\x54\x2a\x14\xa1\x4f\x53\x62\xae\xfb\x86\x25\xfc\x88\x8f\x41\x92\x85\xef\xeb\xc5\x89\x84\xbb\x64\x83\x05\x71\xec\xdc\x45\x31\x9d\x4d\xff\x0d\x00\x00\xff\xff\xf9\xfa\xc3\x3f\xea\x32\x00\x00") func cmdDefinitionsTmplServiceTmplBytes() ([]byte, error) { @@ -423,7 +403,6 @@ var _bindata = map[string]func() (*asset, error){ "cmd/definitions/tmpl/info.tmpl": cmdDefinitionsTmplInfoTmpl, "cmd/definitions/tmpl/object.tmpl": cmdDefinitionsTmplObjectTmpl, "cmd/definitions/tmpl/operation.tmpl": cmdDefinitionsTmplOperationTmpl, - "cmd/definitions/tmpl/pair.tmpl": cmdDefinitionsTmplPairTmpl, "cmd/definitions/tmpl/service.tmpl": cmdDefinitionsTmplServiceTmpl, } @@ -478,7 +457,6 @@ var _bintree = &bintree{nil, map[string]*bintree{ "info.tmpl": {cmdDefinitionsTmplInfoTmpl, map[string]*bintree{}}, "object.tmpl": {cmdDefinitionsTmplObjectTmpl, map[string]*bintree{}}, "operation.tmpl": {cmdDefinitionsTmplOperationTmpl, map[string]*bintree{}}, - "pair.tmpl": {cmdDefinitionsTmplPairTmpl, map[string]*bintree{}}, "service.tmpl": {cmdDefinitionsTmplServiceTmpl, map[string]*bintree{}}, }}, }}, diff --git a/cmd/definitions/generate.go b/cmd/definitions/generate.go index ef8ebaa34..c352d3cb1 100644 --- a/cmd/definitions/generate.go +++ b/cmd/definitions/generate.go @@ -7,10 +7,12 @@ import ( "fmt" "go/parser" "go/token" + "io" "os" "sort" "text/template" + "github.com/Xuanwo/go-codegen" "github.com/Xuanwo/templateutils" "github.com/dave/dst" "github.com/dave/dst/decorator" @@ -21,7 +23,6 @@ import ( var ( infoT = newTmpl("cmd/definitions/tmpl/info") - pairT = newTmpl("cmd/definitions/tmpl/pair") serviceT = newTmpl("cmd/definitions/tmpl/service") operationT = newTmpl("cmd/definitions/tmpl/operation") functionT = newTmpl("cmd/definitions/tmpl/function") @@ -33,7 +34,7 @@ func generateGlobal(data *Data) { generateT(infoT, "types/info.generated.go", data) // Pair generate - generateT(pairT, "pairs/generated.go", data) + generateF("pairs/generated.go", generatePair(data)) // Operation generate generateT(operationT, "types/operation.generated.go", data) @@ -42,6 +43,63 @@ func generateGlobal(data *Data) { generateT(objectT, "types/object.generated.go", data) } +func generatePair(data *Data) *codegen.File { + f := codegen. + NewFile("pairs"). + WithComment("Code generated by go generate cmd/definitions; DO NOT EDIT."). + AddImports( + codegen.NewImport("context"), + codegen.NewImport("time"), + codegen.NewImport("github.com/beyondstorage/go-storage/v4/pkg/httpclient"), + codegen.NewDotImport("github.com/beyondstorage/go-storage/v4/types"), + ) + + ps := make([]*Pair, 0, len(data.Pairs)) + for _, v := range data.Pairs { + v := v + ps = append(ps, v) + } + sort.SliceStable(ps, func(i, j int) bool { + return ps[i].Name < ps[j].Name + }) + + for _, v := range ps { + pname := templateutils.ToPascal(v.Name) + + fn := codegen.NewFunction("With" + pname) + + fn.WithComment(fmt.Sprintf(` +With%s will apply %s value to Options. + +%s %s +`, pname, v.Name, pname, v.originalDescription)) + + fn.WithParameters(codegen.NewParameter("v", v.Type(), false)) + fn.WithResults(codegen.NewResult("p", "Pair", false)) + fn.WithBody(` +return Pair{ + Key: "{{ .Name }}", + Value: v, +} +`, v) + + f.AddFunction(fn) + } + + return f +} + +func generateF(filePath string, content *codegen.File) { + file, err := os.Create(filePath) + if err != nil { + log.Fatalf("create file %s: %s", filePath, err) + } + _, err = io.WriteString(file, content.String()) + if err != nil { + log.Fatalf("write file %s: %s", filePath, err) + } +} + func generateService(data *Data) { generateT(serviceT, "generated.go", data.Service) for _, v := range data.Service.Namespaces { diff --git a/cmd/definitions/tmpl/pair.tmpl b/cmd/definitions/tmpl/pair.tmpl deleted file mode 100644 index 97ccad39d..000000000 --- a/cmd/definitions/tmpl/pair.tmpl +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by go generate cmd/definitions; DO NOT EDIT. -package pairs - -import ( - "context" - "time" - - "github.com/beyondstorage/go-storage/v4/pkg/httpclient" - . "github.com/beyondstorage/go-storage/v4/types" - -) - -{{- range $_, $v := .Pairs }} -{{- $pname := $v.Name | toPascal }} -// With{{ $pname }} will apply {{ $v.Name }} value to Options. -// -{{ $v.Description }} -func With{{ $pname }}(v {{ $v.Type }}) Pair { - return Pair{ - Key: "{{ $v.Name }}", - Value: v, - } -} -{{- end }} diff --git a/cmd/definitions/type.go b/cmd/definitions/type.go index 8e8b2741c..00dd7383e 100644 --- a/cmd/definitions/type.go +++ b/cmd/definitions/type.go @@ -147,7 +147,8 @@ func (f *Feature) Format(s specs.Feature) { type Pair struct { Name string - ptype string + ptype string + originalDescription string // Runtime generated Global bool @@ -164,6 +165,7 @@ func (p *Pair) Format(s specs.Pair, global bool) { p.ptype = s.Type p.Global = global + p.originalDescription = s.Description p.Description = formatDescription(templateutils.ToPascal(p.Name), s.Description) } diff --git a/go.mod b/go.mod index 5bd36fa9f..3833671c7 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/beyondstorage/go-storage/v4 go 1.15 require ( + github.com/Xuanwo/go-codegen v0.0.0-20210827074258-cf28e75d8bfc github.com/Xuanwo/templateutils v0.1.0 github.com/dave/dst v0.26.2 github.com/golang/mock v1.6.0 diff --git a/go.sum b/go.sum index 66b893e7d..e1416f6c4 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,7 @@ +github.com/Xuanwo/go-bufferpool v0.2.0 h1:DXzqJD9lJufXbT/03GrcEvYOs4gXYUj9/g5yi6Q9rUw= +github.com/Xuanwo/go-bufferpool v0.2.0/go.mod h1:Mle++9GGouhOwGj52i9PJLNAPmW2nb8PWBP7JJzNCzk= +github.com/Xuanwo/go-codegen v0.0.0-20210827074258-cf28e75d8bfc h1:fPvLKcgGw0IjU1ciLlgDwgMGKyyddOoAbQywIZNqRhY= +github.com/Xuanwo/go-codegen v0.0.0-20210827074258-cf28e75d8bfc/go.mod h1:KmDSU7aTytcpplfc/RNmOuXIAil+3QmCdlGFH0PLAqI= github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY= github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuHuVUpPCG++Wb8= github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY= diff --git a/pairs/generated.go b/pairs/generated.go index abc9a1339..f3a98c58c 100644 --- a/pairs/generated.go +++ b/pairs/generated.go @@ -3,16 +3,16 @@ package pairs import ( "context" - "time" - "github.com/beyondstorage/go-storage/v4/pkg/httpclient" . "github.com/beyondstorage/go-storage/v4/types" + "time" ) // WithContentMd5 will apply content_md5 value to Options. // // ContentMd5 -func WithContentMd5(v string) Pair { +func WithContentMd5(v string) (p Pair) { + return Pair{ Key: "content_md5", Value: v, @@ -22,7 +22,8 @@ func WithContentMd5(v string) Pair { // WithContentType will apply content_type value to Options. // // ContentType -func WithContentType(v string) Pair { +func WithContentType(v string) (p Pair) { + return Pair{ Key: "content_type", Value: v, @@ -32,7 +33,8 @@ func WithContentType(v string) Pair { // WithContext will apply context value to Options. // // Context -func WithContext(v context.Context) Pair { +func WithContext(v context.Context) (p Pair) { + return Pair{ Key: "context", Value: v, @@ -42,7 +44,8 @@ func WithContext(v context.Context) Pair { // WithContinuationToken will apply continuation_token value to Options. // // ContinuationToken specify the continuation token for list -func WithContinuationToken(v string) Pair { +func WithContinuationToken(v string) (p Pair) { + return Pair{ Key: "continuation_token", Value: v, @@ -52,7 +55,8 @@ func WithContinuationToken(v string) Pair { // WithCredential will apply credential value to Options. // // Credential specify how to provide credential for service or storage -func WithCredential(v string) Pair { +func WithCredential(v string) (p Pair) { + return Pair{ Key: "credential", Value: v, @@ -62,7 +66,8 @@ func WithCredential(v string) Pair { // WithEndpoint will apply endpoint value to Options. // // Endpoint specify how to provide endpoint for service or storage -func WithEndpoint(v string) Pair { +func WithEndpoint(v string) (p Pair) { + return Pair{ Key: "endpoint", Value: v, @@ -72,7 +77,8 @@ func WithEndpoint(v string) Pair { // WithExpire will apply expire value to Options. // // Expire specify when the url returned by reach will expire -func WithExpire(v time.Duration) Pair { +func WithExpire(v time.Duration) (p Pair) { + return Pair{ Key: "expire", Value: v, @@ -82,7 +88,8 @@ func WithExpire(v time.Duration) Pair { // WithHTTPClientOptions will apply http_client_options value to Options. // // HTTPClientOptions -func WithHTTPClientOptions(v *httpclient.Options) Pair { +func WithHTTPClientOptions(v *httpclient.Options) (p Pair) { + return Pair{ Key: "http_client_options", Value: v, @@ -92,7 +99,8 @@ func WithHTTPClientOptions(v *httpclient.Options) Pair { // WithInterceptor will apply interceptor value to Options. // // Interceptor -func WithInterceptor(v Interceptor) Pair { +func WithInterceptor(v Interceptor) (p Pair) { + return Pair{ Key: "interceptor", Value: v, @@ -102,7 +110,8 @@ func WithInterceptor(v Interceptor) Pair { // WithIoCallback will apply io_callback value to Options. // // IoCallback specify what todo every time we read data from source -func WithIoCallback(v func([]byte)) Pair { +func WithIoCallback(v func([]byte)) (p Pair) { + return Pair{ Key: "io_callback", Value: v, @@ -112,7 +121,8 @@ func WithIoCallback(v func([]byte)) Pair { // WithListMode will apply list_mode value to Options. // // ListMode -func WithListMode(v ListMode) Pair { +func WithListMode(v ListMode) (p Pair) { + return Pair{ Key: "list_mode", Value: v, @@ -122,7 +132,8 @@ func WithListMode(v ListMode) Pair { // WithLocation will apply location value to Options. // // Location specify the location for service or storage -func WithLocation(v string) Pair { +func WithLocation(v string) (p Pair) { + return Pair{ Key: "location", Value: v, @@ -132,7 +143,8 @@ func WithLocation(v string) Pair { // WithMultipartID will apply multipart_id value to Options. // // MultipartID -func WithMultipartID(v string) Pair { +func WithMultipartID(v string) (p Pair) { + return Pair{ Key: "multipart_id", Value: v, @@ -142,7 +154,8 @@ func WithMultipartID(v string) Pair { // WithName will apply name value to Options. // // Name specify the storage name -func WithName(v string) Pair { +func WithName(v string) (p Pair) { + return Pair{ Key: "name", Value: v, @@ -152,7 +165,8 @@ func WithName(v string) Pair { // WithObjectMode will apply object_mode value to Options. // // ObjectMode ObjectMode hint -func WithObjectMode(v ObjectMode) Pair { +func WithObjectMode(v ObjectMode) (p Pair) { + return Pair{ Key: "object_mode", Value: v, @@ -162,7 +176,8 @@ func WithObjectMode(v ObjectMode) Pair { // WithOffset will apply offset value to Options. // // Offset specify offset for this request, storage will seek to this offset before read -func WithOffset(v int64) Pair { +func WithOffset(v int64) (p Pair) { + return Pair{ Key: "offset", Value: v, @@ -172,7 +187,8 @@ func WithOffset(v int64) Pair { // WithSize will apply size value to Options. // // Size specify size for this request, storage will only read limited content data -func WithSize(v int64) Pair { +func WithSize(v int64) (p Pair) { + return Pair{ Key: "size", Value: v, @@ -185,7 +201,8 @@ func WithSize(v int64) Pair { // work_dir MUST start with / for every storage services. // work_dir will be default to / if not set. // For fs storage service on windows platform, the behavior is undefined. -func WithWorkDir(v string) Pair { +func WithWorkDir(v string) (p Pair) { + return Pair{ Key: "work_dir", Value: v, From 1fc2cba5f9618c82a49c7badf74d480609b17cce Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Wed, 1 Sep 2021 18:58:45 +0800 Subject: [PATCH 2/6] Another style Signed-off-by: Xuanwo --- cmd/definitions/generate.go | 59 ++++---- go.mod | 2 +- go.sum | 5 +- pairs/generated.go | 262 ++++++++++++++++-------------------- 4 files changed, 147 insertions(+), 181 deletions(-) diff --git a/cmd/definitions/generate.go b/cmd/definitions/generate.go index c352d3cb1..428b735f9 100644 --- a/cmd/definitions/generate.go +++ b/cmd/definitions/generate.go @@ -7,15 +7,14 @@ import ( "fmt" "go/parser" "go/token" - "io" "os" "sort" "text/template" - "github.com/Xuanwo/go-codegen" "github.com/Xuanwo/templateutils" "github.com/dave/dst" "github.com/dave/dst/decorator" + "github.com/dave/jennifer/jen" log "github.com/sirupsen/logrus" "github.com/beyondstorage/go-storage/v4/cmd/definitions/bindata" @@ -43,16 +42,20 @@ func generateGlobal(data *Data) { generateT(objectT, "types/object.generated.go", data) } -func generatePair(data *Data) *codegen.File { - f := codegen. - NewFile("pairs"). - WithComment("Code generated by go generate cmd/definitions; DO NOT EDIT."). - AddImports( - codegen.NewImport("context"), - codegen.NewImport("time"), - codegen.NewImport("github.com/beyondstorage/go-storage/v4/pkg/httpclient"), - codegen.NewDotImport("github.com/beyondstorage/go-storage/v4/types"), - ) +func generatePair(data *Data) *jen.File { + f := jen.NewFile("pairs") + f.HeaderComment("Code generated by go generate cmd/definitions; DO NOT EDIT.") + + // It's a workaround for jen. + // Technically, we need to use `jen.Qual` to allow jen import correct path for us. + // But it's not suitable for us. So we hand-write the logic here. + f.Op("import").Defs( + jen.Lit("context"), + jen.Lit("time"), + jen.Line(), + jen.Lit("github.com/beyondstorage/go-storage/v4/pkg/httpclient"), + jen.Op(".").Lit("github.com/beyondstorage/go-storage/v4/types"), + ) ps := make([]*Pair, 0, len(data.Pairs)) for _, v := range data.Pairs { @@ -66,35 +69,35 @@ func generatePair(data *Data) *codegen.File { for _, v := range ps { pname := templateutils.ToPascal(v.Name) - fn := codegen.NewFunction("With" + pname) + f.Commentf(`With%s will apply %s value to Options. - fn.WithComment(fmt.Sprintf(` -With%s will apply %s value to Options. +%s %s`, pname, v.Name, pname, v.originalDescription) -%s %s -`, pname, v.Name, pname, v.originalDescription)) + fn := f.Func().Id("With" + pname) - fn.WithParameters(codegen.NewParameter("v", v.Type(), false)) - fn.WithResults(codegen.NewResult("p", "Pair", false)) - fn.WithBody(` -return Pair{ - Key: "{{ .Name }}", - Value: v, -} -`, v) + // Generate parameter + fn.Params(jen.Id("v").Id(v.Type())) + // Generate result + fn.Params(jen.Id("p").Id("Pair")) - f.AddFunction(fn) + fn.Block( + jen.Return(jen.Id("Pair").Values( + jen.Id("Key").Op(":").Lit(v.Name), + jen.Id("Value").Op(":").Id("v"), + )), + ) } return f } -func generateF(filePath string, content *codegen.File) { +func generateF(filePath string, content *jen.File) { file, err := os.Create(filePath) if err != nil { log.Fatalf("create file %s: %s", filePath, err) } - _, err = io.WriteString(file, content.String()) + + err = content.Render(file) if err != nil { log.Fatalf("write file %s: %s", filePath, err) } diff --git a/go.mod b/go.mod index 3833671c7..246169d15 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/beyondstorage/go-storage/v4 go 1.15 require ( - github.com/Xuanwo/go-codegen v0.0.0-20210827074258-cf28e75d8bfc github.com/Xuanwo/templateutils v0.1.0 github.com/dave/dst v0.26.2 + github.com/dave/jennifer v1.2.0 github.com/golang/mock v1.6.0 github.com/google/uuid v1.3.0 github.com/kevinburke/go-bindata v3.22.0+incompatible diff --git a/go.sum b/go.sum index e1416f6c4..2ef632965 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,9 @@ -github.com/Xuanwo/go-bufferpool v0.2.0 h1:DXzqJD9lJufXbT/03GrcEvYOs4gXYUj9/g5yi6Q9rUw= -github.com/Xuanwo/go-bufferpool v0.2.0/go.mod h1:Mle++9GGouhOwGj52i9PJLNAPmW2nb8PWBP7JJzNCzk= -github.com/Xuanwo/go-codegen v0.0.0-20210827074258-cf28e75d8bfc h1:fPvLKcgGw0IjU1ciLlgDwgMGKyyddOoAbQywIZNqRhY= -github.com/Xuanwo/go-codegen v0.0.0-20210827074258-cf28e75d8bfc/go.mod h1:KmDSU7aTytcpplfc/RNmOuXIAil+3QmCdlGFH0PLAqI= github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY= github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuHuVUpPCG++Wb8= github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY= github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU= github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= +github.com/dave/jennifer v1.2.0 h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/dave/kerr v0.0.0-20170318121727-bc25dd6abe8e/go.mod h1:qZqlPyPvfsDJt+3wHJ1EvSXDuVjFTK0j2p/ca+gtsb8= github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA= diff --git a/pairs/generated.go b/pairs/generated.go index f3a98c58c..8f1f467b7 100644 --- a/pairs/generated.go +++ b/pairs/generated.go @@ -1,210 +1,176 @@ // Code generated by go generate cmd/definitions; DO NOT EDIT. + package pairs import ( "context" + "time" + "github.com/beyondstorage/go-storage/v4/pkg/httpclient" . "github.com/beyondstorage/go-storage/v4/types" - "time" ) -// WithContentMd5 will apply content_md5 value to Options. -// -// ContentMd5 -func WithContentMd5(v string) (p Pair) { +/* +WithContentMd5 will apply content_md5 value to Options. - return Pair{ - Key: "content_md5", - Value: v, - } +ContentMd5 +*/ +func WithContentMd5(v string) (p Pair) { + return Pair{Key: "content_md5", Value: v} } -// WithContentType will apply content_type value to Options. -// -// ContentType -func WithContentType(v string) (p Pair) { +/* +WithContentType will apply content_type value to Options. - return Pair{ - Key: "content_type", - Value: v, - } +ContentType +*/ +func WithContentType(v string) (p Pair) { + return Pair{Key: "content_type", Value: v} } -// WithContext will apply context value to Options. -// -// Context -func WithContext(v context.Context) (p Pair) { +/* +WithContext will apply context value to Options. - return Pair{ - Key: "context", - Value: v, - } +Context +*/ +func WithContext(v context.Context) (p Pair) { + return Pair{Key: "context", Value: v} } -// WithContinuationToken will apply continuation_token value to Options. -// -// ContinuationToken specify the continuation token for list -func WithContinuationToken(v string) (p Pair) { +/* +WithContinuationToken will apply continuation_token value to Options. - return Pair{ - Key: "continuation_token", - Value: v, - } +ContinuationToken specify the continuation token for list +*/ +func WithContinuationToken(v string) (p Pair) { + return Pair{Key: "continuation_token", Value: v} } -// WithCredential will apply credential value to Options. -// -// Credential specify how to provide credential for service or storage -func WithCredential(v string) (p Pair) { +/* +WithCredential will apply credential value to Options. - return Pair{ - Key: "credential", - Value: v, - } +Credential specify how to provide credential for service or storage +*/ +func WithCredential(v string) (p Pair) { + return Pair{Key: "credential", Value: v} } -// WithEndpoint will apply endpoint value to Options. -// -// Endpoint specify how to provide endpoint for service or storage -func WithEndpoint(v string) (p Pair) { +/* +WithEndpoint will apply endpoint value to Options. - return Pair{ - Key: "endpoint", - Value: v, - } +Endpoint specify how to provide endpoint for service or storage +*/ +func WithEndpoint(v string) (p Pair) { + return Pair{Key: "endpoint", Value: v} } -// WithExpire will apply expire value to Options. -// -// Expire specify when the url returned by reach will expire -func WithExpire(v time.Duration) (p Pair) { +/* +WithExpire will apply expire value to Options. - return Pair{ - Key: "expire", - Value: v, - } +Expire specify when the url returned by reach will expire +*/ +func WithExpire(v time.Duration) (p Pair) { + return Pair{Key: "expire", Value: v} } -// WithHTTPClientOptions will apply http_client_options value to Options. -// -// HTTPClientOptions -func WithHTTPClientOptions(v *httpclient.Options) (p Pair) { +/* +WithHTTPClientOptions will apply http_client_options value to Options. - return Pair{ - Key: "http_client_options", - Value: v, - } +HTTPClientOptions +*/ +func WithHTTPClientOptions(v *httpclient.Options) (p Pair) { + return Pair{Key: "http_client_options", Value: v} } -// WithInterceptor will apply interceptor value to Options. -// -// Interceptor -func WithInterceptor(v Interceptor) (p Pair) { +/* +WithInterceptor will apply interceptor value to Options. - return Pair{ - Key: "interceptor", - Value: v, - } +Interceptor +*/ +func WithInterceptor(v Interceptor) (p Pair) { + return Pair{Key: "interceptor", Value: v} } -// WithIoCallback will apply io_callback value to Options. -// -// IoCallback specify what todo every time we read data from source -func WithIoCallback(v func([]byte)) (p Pair) { +/* +WithIoCallback will apply io_callback value to Options. - return Pair{ - Key: "io_callback", - Value: v, - } +IoCallback specify what todo every time we read data from source +*/ +func WithIoCallback(v func([]byte)) (p Pair) { + return Pair{Key: "io_callback", Value: v} } -// WithListMode will apply list_mode value to Options. -// -// ListMode -func WithListMode(v ListMode) (p Pair) { +/* +WithListMode will apply list_mode value to Options. - return Pair{ - Key: "list_mode", - Value: v, - } +ListMode +*/ +func WithListMode(v ListMode) (p Pair) { + return Pair{Key: "list_mode", Value: v} } -// WithLocation will apply location value to Options. -// -// Location specify the location for service or storage -func WithLocation(v string) (p Pair) { +/* +WithLocation will apply location value to Options. - return Pair{ - Key: "location", - Value: v, - } +Location specify the location for service or storage +*/ +func WithLocation(v string) (p Pair) { + return Pair{Key: "location", Value: v} } -// WithMultipartID will apply multipart_id value to Options. -// -// MultipartID -func WithMultipartID(v string) (p Pair) { +/* +WithMultipartID will apply multipart_id value to Options. - return Pair{ - Key: "multipart_id", - Value: v, - } +MultipartID +*/ +func WithMultipartID(v string) (p Pair) { + return Pair{Key: "multipart_id", Value: v} } -// WithName will apply name value to Options. -// -// Name specify the storage name -func WithName(v string) (p Pair) { +/* +WithName will apply name value to Options. - return Pair{ - Key: "name", - Value: v, - } +Name specify the storage name +*/ +func WithName(v string) (p Pair) { + return Pair{Key: "name", Value: v} } -// WithObjectMode will apply object_mode value to Options. -// -// ObjectMode ObjectMode hint -func WithObjectMode(v ObjectMode) (p Pair) { +/* +WithObjectMode will apply object_mode value to Options. - return Pair{ - Key: "object_mode", - Value: v, - } +ObjectMode ObjectMode hint +*/ +func WithObjectMode(v ObjectMode) (p Pair) { + return Pair{Key: "object_mode", Value: v} } -// WithOffset will apply offset value to Options. -// -// Offset specify offset for this request, storage will seek to this offset before read -func WithOffset(v int64) (p Pair) { +/* +WithOffset will apply offset value to Options. - return Pair{ - Key: "offset", - Value: v, - } +Offset specify offset for this request, storage will seek to this offset before read +*/ +func WithOffset(v int64) (p Pair) { + return Pair{Key: "offset", Value: v} } -// WithSize will apply size value to Options. -// -// Size specify size for this request, storage will only read limited content data -func WithSize(v int64) (p Pair) { +/* +WithSize will apply size value to Options. - return Pair{ - Key: "size", - Value: v, - } +Size specify size for this request, storage will only read limited content data +*/ +func WithSize(v int64) (p Pair) { + return Pair{Key: "size", Value: v} } -// WithWorkDir will apply work_dir value to Options. -// -// WorkDir specify the work dir for service or storage, every operation will be relative to this dir. -// work_dir MUST start with / for every storage services. -// work_dir will be default to / if not set. -// For fs storage service on windows platform, the behavior is undefined. -func WithWorkDir(v string) (p Pair) { +/* +WithWorkDir will apply work_dir value to Options. - return Pair{ - Key: "work_dir", - Value: v, - } +WorkDir specify the work dir for service or storage, every operation will be relative to this dir. +work_dir MUST start with / for every storage services. +work_dir will be default to / if not set. +For fs storage service on windows platform, the behavior is undefined. +*/ +func WithWorkDir(v string) (p Pair) { + return Pair{Key: "work_dir", Value: v} } From c25706ad088eff7f6c839b92fc209b1f3fe81ccd Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Thu, 2 Sep 2021 14:04:01 +0800 Subject: [PATCH 3/6] API demo Signed-off-by: Xuanwo --- cmd/definitions/generate.go | 192 +++++++++++++++++++++++++++++++----- go.mod | 5 + 2 files changed, 170 insertions(+), 27 deletions(-) diff --git a/cmd/definitions/generate.go b/cmd/definitions/generate.go index 428b735f9..6ab58d995 100644 --- a/cmd/definitions/generate.go +++ b/cmd/definitions/generate.go @@ -5,6 +5,7 @@ package main import ( "fmt" + g "github.com/Xuanwo/go-codegen" "go/parser" "go/token" "os" @@ -42,19 +43,160 @@ func generateGlobal(data *Data) { generateT(objectT, "types/object.generated.go", data) } +func generateServiceViaCodegen(data *Service) { + f := g.Group{} + f.Comment("Code generated by go generate cmd/definitions; DO NOT EDIT.") + f.Package(data.Name) + f.Import("context"). + Import("io"). + Import("net/http"). + Import("time"). + Line(). + ImportDot("github.com/beyondstorage/go-storage/v4/pairs"). + Import("github.com/beyondstorage/go-storage/v4/pkg/httpclient"). + Import("github.com/beyondstorage/go-storage/v4/services"). + ImportDot("github.com/beyondstorage/go-storage/v4/types") + + f.Vars( + g.Field("_", "Storager"), + g.Field("_", "services.ServiceError"), + g.Field("_", "httpclient.Options"), + g.Field("_", "time.Duration"), + g.Field("_", "http.Request"), + g.Field("_", "Error"), + ) + + f.Const("Type", data.Name) + + osm := f.Struct("ObjectSystemMetadata"). + Comment("ObjectSystemMetadata stores system metadata for object.") + for _, info := range data.Infos { + if info.Scope != "object" { + continue + } + if info.Global { + continue + } + pname := templateutils.ToPascal(info.Name) + if info.DisplayName() != "" { + pname = info.DisplayName() + } + // FIXME: we will support comment on field later. + osm.Field(pname, info.Type()) + } + + gosmfn := f.Function("GetObjectSystemMetadata").Comment(` +// GetObjectSystemMetadata will get ObjectSystemMetadata from Object. +// +// - This function should not be called by service implementer. +// - The returning ObjectServiceMetadata is read only and should not be modified. +`) + gosmfn.Parameter("o", "*Object") + gosmfn.Body( + g.Decl(g.List("sm, ok"), g.String("o.GetSystemMetadata()")), + g.If(g.String("ok")).Body( + g.Return(g.Struct("sm.(ObjectSystemMetadata)")), + ), + g.Return(g.Value("ObjectSystemMetadata")), + ) + + for _, ns := range data.Namespaces { + nsName := templateutils.ToPascal(ns.Name) + fnName := templateutils.ToPascal(ns.New.Name) + + // Generate pair struct + pairStructName := fmt.Sprintf("pair%s%s", nsName, fnName) + + pairStruct := f.Struct(pairStructName). + CommentF("%s is the parsed struct", pairStructName) + pairStruct.Field("pairs", "[]Pair") + + for _, pair := range ns.New.Required { + pairName := templateutils.ToPascal(pair.Name) + + pairStruct.Field("Has"+pairName, "bool") + pairStruct.Field(pairName, pair.Type()) + } + for _, pair := range ns.New.Optional { + pairName := templateutils.ToPascal(pair.Name) + + pairStruct.Field("Has"+pairName, "bool") + pairStruct.Field(pairName, pair.Type()) + } + for _, feature := range ns.Features { + pairName := templateutils.ToPascal(feature.Name) + + pairStruct.Field("has"+pairName, "bool") + pairStruct.Field("Enable"+pairName, "bool") + } + for _, defalutable := range ns.Defaultable() { + pairName := templateutils.ToPascal(defalutable.Pair.Name) + + pairStruct.Field("hasDefault"+pairName, "bool") + pairStruct.Field("Default"+pairName, defalutable.Pair.Type()) + } + + // Generate pair parse function. + pairFuncName := fmt.Sprintf("parsePair%s%s", nsName, fnName) + + fn := f.Function(pairFuncName). + CommentF("%s will parse Pair slice into *%s", pairFuncName, pairStructName). + Parameter("opts", "[]Pair"). + Result("", pairStructName). + Result("", "error") + fn.Body( + g.Decl( + g.String("result"), + g.Value(pairStructName).Field("pairs", "opts")), + g.For(g.String("_, v := range opts")).Body( + func() g.Node { + iswitch := g.Switch(g.String("v.Key")) + for _, pair := range ns.New.Required { + pairName := templateutils.ToPascal(pair.Name) + + iswitch.Case(g.Lit(pair.Name)).Body( + g.If(g.StringF("result.Has%s", pairName)).Body( + g.Continue(), + ), + g.Assign( + g.StringF("result.Has%s", pairName), + g.Lit(true)), + g.Assign(g.StringF("result.%s", pairName), + g.StringF("v.Value.(%s)", pair.Type())), + ) + } + for _, pair := range ns.New.Optional { + pairName := templateutils.ToPascal(pair.Name) + + iswitch.Case(g.Lit(pair.Name)).Body( + g.If(g.StringF("result.Has%s", pairName)).Body( + g.Continue(), + ), + g.Assign( + g.StringF("result.Has%s", pairName), + g.Lit(true)), + g.Assign(g.StringF("result.%s", pairName), + g.StringF("v.Value.(%s)", pair.Type())), + ) + } + // TODO: features and defaultable are omitted in this demo. + return iswitch + }(), + ), + ) + } +} + func generatePair(data *Data) *jen.File { - f := jen.NewFile("pairs") - f.HeaderComment("Code generated by go generate cmd/definitions; DO NOT EDIT.") - - // It's a workaround for jen. - // Technically, we need to use `jen.Qual` to allow jen import correct path for us. - // But it's not suitable for us. So we hand-write the logic here. - f.Op("import").Defs( - jen.Lit("context"), - jen.Lit("time"), - jen.Line(), - jen.Lit("github.com/beyondstorage/go-storage/v4/pkg/httpclient"), - jen.Op(".").Lit("github.com/beyondstorage/go-storage/v4/types"), + xf := g.Group{} + xf.Comment("Code generated by go generate cmd/definitions; DO NOT EDIT.") + xf.Package("pairs") + xf.Imports( + g.Import("context"), + g.Import("time"), + g.Line(), + g.Import("github.com/beyondstorage/go-storage/v4/pkg/httpclient"), + g.ImportDot("github.com/beyondstorage/go-storage/v4/types"), ) ps := make([]*Pair, 0, len(data.Pairs)) @@ -69,26 +211,22 @@ func generatePair(data *Data) *jen.File { for _, v := range ps { pname := templateutils.ToPascal(v.Name) - f.Commentf(`With%s will apply %s value to Options. + xfn := xf.Function("With" + pname) -%s %s`, pname, v.Name, pname, v.originalDescription) + xfn.CommentF(`With%s will apply %s value to Options. - fn := f.Func().Id("With" + pname) - - // Generate parameter - fn.Params(jen.Id("v").Id(v.Type())) - // Generate result - fn.Params(jen.Id("p").Id("Pair")) - - fn.Block( - jen.Return(jen.Id("Pair").Values( - jen.Id("Key").Op(":").Lit(v.Name), - jen.Id("Value").Op(":").Id("v"), - )), +%s %s`, pname, v.Name, pname, v.originalDescription) + xfn.Parameter("v", v.Type()) + xfn.Result("p", "Pair") + xfn.Body( + g.Return( + g.Value("Pair"). + Field("Key", v.Name). + Field("Value", "v")), ) } - return f + return nil } func generateF(filePath string, content *jen.File) { diff --git a/go.mod b/go.mod index 246169d15..ef3855d23 100644 --- a/go.mod +++ b/go.mod @@ -12,4 +12,9 @@ require ( github.com/pelletier/go-toml v1.9.3 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 + github.com/Xuanwo/go-codegen v1.0.0 +) + +replace ( + github.com/Xuanwo/go-codegen => ../../xuanwo/go-codegen ) From 7a87b5aeab183fc371ce485afa169758cbda9f54 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 3 Sep 2021 09:32:40 +0800 Subject: [PATCH 4/6] Use Xuanwo/gg to play good game Signed-off-by: Xuanwo --- cmd/definitions/generate.go | 192 ++++-------------------------------- go.mod | 7 +- go.sum | 5 +- pairs/generated.go | 150 +++++++++++----------------- 4 files changed, 82 insertions(+), 272 deletions(-) diff --git a/cmd/definitions/generate.go b/cmd/definitions/generate.go index 6ab58d995..5ed02219c 100644 --- a/cmd/definitions/generate.go +++ b/cmd/definitions/generate.go @@ -5,17 +5,16 @@ package main import ( "fmt" - g "github.com/Xuanwo/go-codegen" "go/parser" "go/token" "os" "sort" "text/template" + "github.com/Xuanwo/gg" "github.com/Xuanwo/templateutils" "github.com/dave/dst" "github.com/dave/dst/decorator" - "github.com/dave/jennifer/jen" log "github.com/sirupsen/logrus" "github.com/beyondstorage/go-storage/v4/cmd/definitions/bindata" @@ -34,7 +33,7 @@ func generateGlobal(data *Data) { generateT(infoT, "types/info.generated.go", data) // Pair generate - generateF("pairs/generated.go", generatePair(data)) + generatePair(data, "pairs/generated.go") // Operation generate generateT(operationT, "types/operation.generated.go", data) @@ -43,161 +42,16 @@ func generateGlobal(data *Data) { generateT(objectT, "types/object.generated.go", data) } -func generateServiceViaCodegen(data *Service) { - f := g.Group{} +func generatePair(data *Data, path string) { + f := gg.Group() f.Comment("Code generated by go generate cmd/definitions; DO NOT EDIT.") - f.Package(data.Name) - f.Import("context"). - Import("io"). - Import("net/http"). - Import("time"). + f.Package("pairs") + f.Imports(). + Path("context"). + Path("time"). Line(). - ImportDot("github.com/beyondstorage/go-storage/v4/pairs"). - Import("github.com/beyondstorage/go-storage/v4/pkg/httpclient"). - Import("github.com/beyondstorage/go-storage/v4/services"). - ImportDot("github.com/beyondstorage/go-storage/v4/types") - - f.Vars( - g.Field("_", "Storager"), - g.Field("_", "services.ServiceError"), - g.Field("_", "httpclient.Options"), - g.Field("_", "time.Duration"), - g.Field("_", "http.Request"), - g.Field("_", "Error"), - ) - - f.Const("Type", data.Name) - - osm := f.Struct("ObjectSystemMetadata"). - Comment("ObjectSystemMetadata stores system metadata for object.") - for _, info := range data.Infos { - if info.Scope != "object" { - continue - } - if info.Global { - continue - } - pname := templateutils.ToPascal(info.Name) - if info.DisplayName() != "" { - pname = info.DisplayName() - } - // FIXME: we will support comment on field later. - osm.Field(pname, info.Type()) - } - - gosmfn := f.Function("GetObjectSystemMetadata").Comment(` -// GetObjectSystemMetadata will get ObjectSystemMetadata from Object. -// -// - This function should not be called by service implementer. -// - The returning ObjectServiceMetadata is read only and should not be modified. -`) - gosmfn.Parameter("o", "*Object") - gosmfn.Body( - g.Decl(g.List("sm, ok"), g.String("o.GetSystemMetadata()")), - g.If(g.String("ok")).Body( - g.Return(g.Struct("sm.(ObjectSystemMetadata)")), - ), - g.Return(g.Value("ObjectSystemMetadata")), - ) - - for _, ns := range data.Namespaces { - nsName := templateutils.ToPascal(ns.Name) - fnName := templateutils.ToPascal(ns.New.Name) - - // Generate pair struct - pairStructName := fmt.Sprintf("pair%s%s", nsName, fnName) - - pairStruct := f.Struct(pairStructName). - CommentF("%s is the parsed struct", pairStructName) - pairStruct.Field("pairs", "[]Pair") - - for _, pair := range ns.New.Required { - pairName := templateutils.ToPascal(pair.Name) - - pairStruct.Field("Has"+pairName, "bool") - pairStruct.Field(pairName, pair.Type()) - } - for _, pair := range ns.New.Optional { - pairName := templateutils.ToPascal(pair.Name) - - pairStruct.Field("Has"+pairName, "bool") - pairStruct.Field(pairName, pair.Type()) - } - for _, feature := range ns.Features { - pairName := templateutils.ToPascal(feature.Name) - - pairStruct.Field("has"+pairName, "bool") - pairStruct.Field("Enable"+pairName, "bool") - } - for _, defalutable := range ns.Defaultable() { - pairName := templateutils.ToPascal(defalutable.Pair.Name) - - pairStruct.Field("hasDefault"+pairName, "bool") - pairStruct.Field("Default"+pairName, defalutable.Pair.Type()) - } - - // Generate pair parse function. - pairFuncName := fmt.Sprintf("parsePair%s%s", nsName, fnName) - - fn := f.Function(pairFuncName). - CommentF("%s will parse Pair slice into *%s", pairFuncName, pairStructName). - Parameter("opts", "[]Pair"). - Result("", pairStructName). - Result("", "error") - fn.Body( - g.Decl( - g.String("result"), - g.Value(pairStructName).Field("pairs", "opts")), - g.For(g.String("_, v := range opts")).Body( - func() g.Node { - iswitch := g.Switch(g.String("v.Key")) - for _, pair := range ns.New.Required { - pairName := templateutils.ToPascal(pair.Name) - - iswitch.Case(g.Lit(pair.Name)).Body( - g.If(g.StringF("result.Has%s", pairName)).Body( - g.Continue(), - ), - g.Assign( - g.StringF("result.Has%s", pairName), - g.Lit(true)), - g.Assign(g.StringF("result.%s", pairName), - g.StringF("v.Value.(%s)", pair.Type())), - ) - } - for _, pair := range ns.New.Optional { - pairName := templateutils.ToPascal(pair.Name) - - iswitch.Case(g.Lit(pair.Name)).Body( - g.If(g.StringF("result.Has%s", pairName)).Body( - g.Continue(), - ), - g.Assign( - g.StringF("result.Has%s", pairName), - g.Lit(true)), - g.Assign(g.StringF("result.%s", pairName), - g.StringF("v.Value.(%s)", pair.Type())), - ) - } - // TODO: features and defaultable are omitted in this demo. - return iswitch - }(), - ), - ) - } -} - -func generatePair(data *Data) *jen.File { - xf := g.Group{} - xf.Comment("Code generated by go generate cmd/definitions; DO NOT EDIT.") - xf.Package("pairs") - xf.Imports( - g.Import("context"), - g.Import("time"), - g.Line(), - g.Import("github.com/beyondstorage/go-storage/v4/pkg/httpclient"), - g.ImportDot("github.com/beyondstorage/go-storage/v4/types"), - ) + Path("github.com/beyondstorage/go-storage/v4/pkg/httpclient"). + Dot("github.com/beyondstorage/go-storage/v4/types") ps := make([]*Pair, 0, len(data.Pairs)) for _, v := range data.Pairs { @@ -211,7 +65,7 @@ func generatePair(data *Data) *jen.File { for _, v := range ps { pname := templateutils.ToPascal(v.Name) - xfn := xf.Function("With" + pname) + xfn := f.Function("With" + pname) xfn.CommentF(`With%s will apply %s value to Options. @@ -219,25 +73,19 @@ func generatePair(data *Data) *jen.File { xfn.Parameter("v", v.Type()) xfn.Result("p", "Pair") xfn.Body( - g.Return( - g.Value("Pair"). - Field("Key", v.Name). - Field("Value", "v")), + gg.Embed(func() gg.Node { + r := gg.Return() + r.Value("Pair"). + Field("Key", gg.Lit(v.Name).String()). + Field("Value", "v") + return r + }), ) } - return nil -} - -func generateF(filePath string, content *jen.File) { - file, err := os.Create(filePath) - if err != nil { - log.Fatalf("create file %s: %s", filePath, err) - } - - err = content.Render(file) + err := f.WriteFile(path) if err != nil { - log.Fatalf("write file %s: %s", filePath, err) + log.Fatalf("generate to %s: %v", path, err) } } diff --git a/go.mod b/go.mod index ef3855d23..76c21a819 100644 --- a/go.mod +++ b/go.mod @@ -3,18 +3,13 @@ module github.com/beyondstorage/go-storage/v4 go 1.15 require ( + github.com/Xuanwo/gg v0.0.0-20210903012417-03a447370afa github.com/Xuanwo/templateutils v0.1.0 github.com/dave/dst v0.26.2 - github.com/dave/jennifer v1.2.0 github.com/golang/mock v1.6.0 github.com/google/uuid v1.3.0 github.com/kevinburke/go-bindata v3.22.0+incompatible github.com/pelletier/go-toml v1.9.3 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 - github.com/Xuanwo/go-codegen v1.0.0 -) - -replace ( - github.com/Xuanwo/go-codegen => ../../xuanwo/go-codegen ) diff --git a/go.sum b/go.sum index 2ef632965..cbbaa40bd 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,12 @@ +github.com/Xuanwo/gg v0.0.0-20210903012417-03a447370afa h1:N5OBLTnGC2p9gJaFkn5ptgdZcwQXnsWPVFemnVnz66M= +github.com/Xuanwo/gg v0.0.0-20210903012417-03a447370afa/go.mod h1:TjGrC5F6B9H//RFhXGxv/znfrz0uRq46gZdZ0f0bvVQ= +github.com/Xuanwo/go-bufferpool v0.2.0 h1:DXzqJD9lJufXbT/03GrcEvYOs4gXYUj9/g5yi6Q9rUw= +github.com/Xuanwo/go-bufferpool v0.2.0/go.mod h1:Mle++9GGouhOwGj52i9PJLNAPmW2nb8PWBP7JJzNCzk= github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY= github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuHuVUpPCG++Wb8= github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY= github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU= github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= -github.com/dave/jennifer v1.2.0 h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/dave/kerr v0.0.0-20170318121727-bc25dd6abe8e/go.mod h1:qZqlPyPvfsDJt+3wHJ1EvSXDuVjFTK0j2p/ca+gtsb8= github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA= diff --git a/pairs/generated.go b/pairs/generated.go index 8f1f467b7..c82443357 100644 --- a/pairs/generated.go +++ b/pairs/generated.go @@ -10,167 +10,131 @@ import ( . "github.com/beyondstorage/go-storage/v4/types" ) -/* -WithContentMd5 will apply content_md5 value to Options. - -ContentMd5 -*/ +// WithContentMd5 will apply content_md5 value to Options. +// +// ContentMd5 func WithContentMd5(v string) (p Pair) { return Pair{Key: "content_md5", Value: v} } -/* -WithContentType will apply content_type value to Options. - -ContentType -*/ +// WithContentType will apply content_type value to Options. +// +// ContentType func WithContentType(v string) (p Pair) { return Pair{Key: "content_type", Value: v} } -/* -WithContext will apply context value to Options. - -Context -*/ +// WithContext will apply context value to Options. +// +// Context func WithContext(v context.Context) (p Pair) { return Pair{Key: "context", Value: v} } -/* -WithContinuationToken will apply continuation_token value to Options. - -ContinuationToken specify the continuation token for list -*/ +// WithContinuationToken will apply continuation_token value to Options. +// +// ContinuationToken specify the continuation token for list func WithContinuationToken(v string) (p Pair) { return Pair{Key: "continuation_token", Value: v} } -/* -WithCredential will apply credential value to Options. - -Credential specify how to provide credential for service or storage -*/ +// WithCredential will apply credential value to Options. +// +// Credential specify how to provide credential for service or storage func WithCredential(v string) (p Pair) { return Pair{Key: "credential", Value: v} } -/* -WithEndpoint will apply endpoint value to Options. - -Endpoint specify how to provide endpoint for service or storage -*/ +// WithEndpoint will apply endpoint value to Options. +// +// Endpoint specify how to provide endpoint for service or storage func WithEndpoint(v string) (p Pair) { return Pair{Key: "endpoint", Value: v} } -/* -WithExpire will apply expire value to Options. - -Expire specify when the url returned by reach will expire -*/ +// WithExpire will apply expire value to Options. +// +// Expire specify when the url returned by reach will expire func WithExpire(v time.Duration) (p Pair) { return Pair{Key: "expire", Value: v} } -/* -WithHTTPClientOptions will apply http_client_options value to Options. - -HTTPClientOptions -*/ +// WithHTTPClientOptions will apply http_client_options value to Options. +// +// HTTPClientOptions func WithHTTPClientOptions(v *httpclient.Options) (p Pair) { return Pair{Key: "http_client_options", Value: v} } -/* -WithInterceptor will apply interceptor value to Options. - -Interceptor -*/ +// WithInterceptor will apply interceptor value to Options. +// +// Interceptor func WithInterceptor(v Interceptor) (p Pair) { return Pair{Key: "interceptor", Value: v} } -/* -WithIoCallback will apply io_callback value to Options. - -IoCallback specify what todo every time we read data from source -*/ +// WithIoCallback will apply io_callback value to Options. +// +// IoCallback specify what todo every time we read data from source func WithIoCallback(v func([]byte)) (p Pair) { return Pair{Key: "io_callback", Value: v} } -/* -WithListMode will apply list_mode value to Options. - -ListMode -*/ +// WithListMode will apply list_mode value to Options. +// +// ListMode func WithListMode(v ListMode) (p Pair) { return Pair{Key: "list_mode", Value: v} } -/* -WithLocation will apply location value to Options. - -Location specify the location for service or storage -*/ +// WithLocation will apply location value to Options. +// +// Location specify the location for service or storage func WithLocation(v string) (p Pair) { return Pair{Key: "location", Value: v} } -/* -WithMultipartID will apply multipart_id value to Options. - -MultipartID -*/ +// WithMultipartID will apply multipart_id value to Options. +// +// MultipartID func WithMultipartID(v string) (p Pair) { return Pair{Key: "multipart_id", Value: v} } -/* -WithName will apply name value to Options. - -Name specify the storage name -*/ +// WithName will apply name value to Options. +// +// Name specify the storage name func WithName(v string) (p Pair) { return Pair{Key: "name", Value: v} } -/* -WithObjectMode will apply object_mode value to Options. - -ObjectMode ObjectMode hint -*/ +// WithObjectMode will apply object_mode value to Options. +// +// ObjectMode ObjectMode hint func WithObjectMode(v ObjectMode) (p Pair) { return Pair{Key: "object_mode", Value: v} } -/* -WithOffset will apply offset value to Options. - -Offset specify offset for this request, storage will seek to this offset before read -*/ +// WithOffset will apply offset value to Options. +// +// Offset specify offset for this request, storage will seek to this offset before read func WithOffset(v int64) (p Pair) { return Pair{Key: "offset", Value: v} } -/* -WithSize will apply size value to Options. - -Size specify size for this request, storage will only read limited content data -*/ +// WithSize will apply size value to Options. +// +// Size specify size for this request, storage will only read limited content data func WithSize(v int64) (p Pair) { return Pair{Key: "size", Value: v} } -/* -WithWorkDir will apply work_dir value to Options. - -WorkDir specify the work dir for service or storage, every operation will be relative to this dir. -work_dir MUST start with / for every storage services. -work_dir will be default to / if not set. -For fs storage service on windows platform, the behavior is undefined. -*/ +// WithWorkDir will apply work_dir value to Options. +// +// WorkDir specify the work dir for service or storage, every operation will be relative to this dir. +// work_dir MUST start with / for every storage services. +// work_dir will be default to / if not set. +// For fs storage service on windows platform, the behavior is undefined. func WithWorkDir(v string) (p Pair) { return Pair{Key: "work_dir", Value: v} } From a86997579e3ea90123211918c43251ba32f6d778 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 3 Sep 2021 09:52:42 +0800 Subject: [PATCH 5/6] Merge orgin master Signed-off-by: Xuanwo --- cmd/definitions/bindata/bindata.go | 515 +++++++++++++++++++++++++++++ cmd/definitions/generate.go | 21 ++ cmd/definitions/tmpl/pair.tmpl | 36 -- cmd/definitions/type.go | 8 - pairs/generated.go | 156 +++++++++ 5 files changed, 692 insertions(+), 44 deletions(-) create mode 100644 cmd/definitions/bindata/bindata.go delete mode 100644 cmd/definitions/tmpl/pair.tmpl create mode 100644 pairs/generated.go diff --git a/cmd/definitions/bindata/bindata.go b/cmd/definitions/bindata/bindata.go new file mode 100644 index 000000000..119fb6c2e --- /dev/null +++ b/cmd/definitions/bindata/bindata.go @@ -0,0 +1,515 @@ +// Code generated by go-bindata. DO NOT EDIT. +// sources: +// definitions/features.toml (1.578kB) +// definitions/fields.toml (714B) +// definitions/info_object_meta.toml (932B) +// definitions/info_storage_meta.toml (1.139kB) +// definitions/operations.toml (9.297kB) +// definitions/pairs.toml (1.566kB) +// cmd/definitions/tmpl/function.tmpl (567B) +// cmd/definitions/tmpl/info.tmpl (1.702kB) +// cmd/definitions/tmpl/object.tmpl (2.388kB) +// cmd/definitions/tmpl/operation.tmpl (1.724kB) +// cmd/definitions/tmpl/service.tmpl (13.034kB) + +//go:build tools +// +build tools + +package bindata + +import ( + "bytes" + "compress/gzip" + "crypto/sha256" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time" +) + +func bindataRead(data []byte, name string) ([]byte, error) { + gz, err := gzip.NewReader(bytes.NewBuffer(data)) + if err != nil { + return nil, fmt.Errorf("read %q: %w", name, err) + } + + var buf bytes.Buffer + _, err = io.Copy(&buf, gz) + clErr := gz.Close() + + if err != nil { + return nil, fmt.Errorf("read %q: %w", name, err) + } + if clErr != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +type asset struct { + bytes []byte + info os.FileInfo + digest [sha256.Size]byte +} + +type bindataFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (fi bindataFileInfo) Name() string { + return fi.name +} +func (fi bindataFileInfo) Size() int64 { + return fi.size +} +func (fi bindataFileInfo) Mode() os.FileMode { + return fi.mode +} +func (fi bindataFileInfo) ModTime() time.Time { + return fi.modTime +} +func (fi bindataFileInfo) IsDir() bool { + return false +} +func (fi bindataFileInfo) Sys() interface{} { + return nil +} + +var _definitionsFeaturesToml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x94\x41\x8b\x13\x41\x10\x85\xef\xf3\x2b\x1e\x7b\x51\x21\x09\x7a\x11\x15\x3c\x8b\x37\x41\x6f\x8b\x84\xca\x74\xc5\x29\xd3\xd3\x35\x54\xd7\x4c\xd8\x7f\x2f\x3d\x93\xd9\x0d\x21\x13\xc4\xdd\x83\xb7\x24\xdd\xf5\xea\xbd\xf7\x35\xb9\x8f\xaa\x99\xb7\x1d\x89\xfd\xac\x02\xe7\xda\xa4\x73\xd1\x84\xcf\xb8\xbb\xbb\xab\x9e\x4e\xb1\x67\xf2\xde\x18\x92\x11\x38\xcb\xaf\xc4\x01\x7b\x35\xf4\x99\x2d\xe3\xd8\x28\x82\xa6\x57\x8e\x23\x25\x47\x76\x93\xda\x31\x0e\xd6\x0d\xd7\x87\xbc\xa9\xaa\xaf\x7b\x78\x23\xf9\x5c\x89\x13\xed\x22\x87\x15\xbc\x61\x64\xb6\x41\x6a\xc6\x51\x62\x44\x52\x87\xb1\xf7\x96\x40\x09\x6c\xa6\x36\xae\x2b\xbf\xe7\xbe\xeb\xd4\x26\xf9\x22\xfc\xe3\x5c\xf5\x48\x19\x92\xdc\x34\xf4\x35\x07\x48\xc2\x97\xef\xdf\xd6\xef\xde\x7e\xdc\x54\x25\x51\x75\x3f\x88\x79\x4f\x71\x1b\xae\x47\x3e\x3b\x5e\xcc\x4c\x8f\x5e\xbd\x21\x47\x50\xce\x25\x7a\x43\x03\x23\x91\xcb\xc0\x28\xe3\xb3\xcf\x5d\x3f\xd5\x92\xe1\x8a\xce\x74\x90\xc0\xc8\xd2\xf6\x91\x9c\x03\xb4\x63\xa3\xe2\xa0\x64\x59\xe3\x4a\x4d\x41\xf2\xd8\x13\x5e\x97\x9e\x02\xef\xa9\x8f\x8e\x1d\x37\x34\x88\xda\x9b\x2b\xf5\x8d\x67\x8c\x28\x07\x86\x5c\x38\xa4\xf4\x70\x6e\x6f\x73\x7d\xe7\x32\x9a\x39\xd6\x53\x82\xa2\x36\xbb\x29\x8d\xd7\xc6\xe4\x5c\x2a\x5c\x9d\x3e\xaf\x10\x25\xfb\x0a\x81\x23\x97\x6f\x94\x02\xb2\x42\xd3\x3f\xe3\xd3\xdd\x6f\xae\x7d\xdb\xb2\x53\x20\xa7\x5b\x28\x2f\xae\x3e\x07\xeb\x24\x85\x47\xa9\xff\x18\xf1\x82\xd5\x17\xc0\x7d\xa9\x7c\x8e\xbe\x8c\x4f\xa8\xb3\x93\xbf\x04\xe8\x28\xe9\x70\x8b\x6e\x39\x7f\x0e\xd2\x39\x5f\xb9\x5e\xb4\x96\x08\x2d\x37\x64\x7d\x42\xad\x6d\x47\x2e\xbb\xc8\x68\x35\xf0\xa7\xd3\xbb\x1f\x15\x31\x08\xcd\xdb\x5a\xf6\x46\x43\x5e\x8d\x2f\x86\x62\xd4\x23\x8c\x29\x4c\xf7\xf6\xa6\x2d\x34\x86\x75\xf6\x87\x78\x9a\x9d\xca\x5e\xa0\x56\xfe\x0d\x6f\xfb\x92\x34\x6f\xa6\x0c\xf5\x86\x6d\xbe\xf3\x77\x40\x3e\xbc\x3f\xf1\xf8\x13\x00\x00\xff\xff\x02\x8a\xc0\x31\x2a\x06\x00\x00") + +func definitionsFeaturesTomlBytes() ([]byte, error) { + return bindataRead( + _definitionsFeaturesToml, + "definitions/features.toml", + ) +} + +func definitionsFeaturesToml() (*asset, error) { + bytes, err := definitionsFeaturesTomlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "definitions/features.toml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe8, 0xde, 0x64, 0x57, 0x6f, 0xe4, 0xa1, 0x28, 0x9a, 0xdf, 0xf5, 0xa, 0x78, 0xe3, 0xe7, 0xe5, 0x4c, 0x35, 0xce, 0xe9, 0xb8, 0x4b, 0x32, 0xb7, 0xb2, 0xdc, 0x74, 0xc5, 0x98, 0xd5, 0x9f, 0x28}} + return a, nil +} + +var _definitionsFieldsToml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x52\xb1\x4e\xc3\x30\x14\xdc\xf3\x15\x55\xc7\x0e\x9e\x10\x1b\x0b\x62\x61\x40\x54\x65\x60\x88\x3a\xbc\x24\xd7\xf4\x41\x13\xbb\xcf\x2f\xa2\xf0\xf5\x28\x09\x95\x5f\xa8\xd7\xbb\xf3\xdd\xe9\x9e\xcb\x8a\xf7\x85\x7e\x07\xac\x1e\x56\xeb\xcd\xe3\xc9\xd7\x9f\xcf\x0a\x21\xf5\xb2\x2e\x8a\xb2\xe2\x26\xd1\x51\x85\xfb\xf6\x0f\x8e\x09\x2f\xf7\x89\x69\xa2\xe6\x1e\x40\x24\xc1\x10\x99\xdd\x71\x09\x2c\x48\x84\x72\x07\xf7\x34\x08\x29\xfb\x7e\x14\x70\xdf\xe0\x92\x78\xee\x75\x44\x3b\x28\x99\xd2\x6f\xea\x85\x5a\xbc\x40\x69\x64\xfb\x85\xfe\xfe\x6e\xc2\xa8\x43\xae\x96\x37\x36\xaf\xd5\x07\xea\xc9\xdf\x1f\x0e\x11\x9a\xb1\xf1\x7c\xa3\xb7\x63\xf9\x90\xcb\x08\xc4\x62\xc6\x72\xce\x6d\x89\x65\x66\xc4\xa4\x6c\xb6\x24\x7a\x85\x17\xeb\x1a\x46\x8f\xd9\x08\xfe\x67\x63\x5b\x99\xe1\xd9\xbb\x1d\xa8\xc1\x8c\xe3\x6c\x5e\x1d\x55\x83\xdb\xe1\x3c\x20\x4e\x51\x91\x7f\x90\x59\x20\x4a\x9d\x2b\x10\x95\x6f\x0f\x22\xb6\x45\x54\x6f\x2f\x7d\x95\x8c\xd4\x20\xa7\x9c\xe7\xd7\xa2\xf7\xbb\xb0\xce\x72\x25\x69\x91\xf9\x64\xbf\x01\x00\x00\xff\xff\x5c\xa2\x94\x99\xca\x02\x00\x00") + +func definitionsFieldsTomlBytes() ([]byte, error) { + return bindataRead( + _definitionsFieldsToml, + "definitions/fields.toml", + ) +} + +func definitionsFieldsToml() (*asset, error) { + bytes, err := definitionsFieldsTomlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "definitions/fields.toml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfe, 0xa5, 0x29, 0x70, 0xa5, 0x18, 0x85, 0x7b, 0xfe, 0x73, 0xbf, 0x8c, 0xef, 0x61, 0xf6, 0xa1, 0xa2, 0x5, 0x4c, 0xf, 0xe9, 0x27, 0xee, 0x26, 0x1b, 0x41, 0xe8, 0x33, 0x87, 0xaa, 0x98, 0x7f}} + return a, nil +} + +var _definitionsInfo_object_metaToml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x52\xb1\x8e\xd4\x40\x0c\xed\xf3\x15\xd6\x36\x57\xe5\x2a\xa0\xbb\x02\xe9\x1a\x24\x56\x87\xc4\x21\x8a\xd5\x15\x73\x3b\x4e\x62\x36\x33\x1e\x6c\x07\x58\x21\xfe\x1d\xcd\xcc\x45\x1b\xb2\x41\xba\x6e\xc6\x7e\x7e\xcf\x7e\xf6\xc1\xa5\x84\xd1\xb7\xdc\x75\x8a\xf6\xd4\xd8\x39\x21\xdc\xc1\x8e\xa2\xbd\x7b\xb3\x6b\x3c\xea\x51\x28\x19\x71\xcc\xd1\xf7\x05\xfc\x50\xb0\x40\x0a\x36\x20\xd4\x4a\xe0\xae\xfc\x2a\x1d\xf0\xf3\x37\x3c\xda\xed\xae\x69\x0e\x47\x8e\x86\xd1\xda\x11\x63\x6f\xc3\x95\xc2\x05\x10\xfc\xdb\x4b\x56\x4d\x28\xf6\xcb\x74\xce\x6c\xe5\xd1\x5c\xbf\x15\x27\x7f\x1d\xc5\x5f\x89\xc5\xe0\x0e\x4c\x26\x5c\x0f\xf7\xe1\x7e\x1e\x69\x8a\xf4\x7d\x42\x38\xe1\x19\x28\x82\x1a\x8b\xeb\xb1\x0c\x33\x3a\xb5\x36\xb0\xa7\x8e\x70\xc1\x6f\x14\xf0\xf6\x91\x02\x16\x0c\xc5\x53\x6b\x4e\xfa\xa5\x9f\x73\x07\x2b\xcd\x8f\x14\x4f\x8f\x05\x3a\x6b\xeb\x39\x64\x02\xa8\x04\xd0\xb1\x40\xf9\x2f\x1c\x0d\xec\x17\x4e\x3c\x94\xc4\x9e\x3d\xae\xe7\x6b\x0e\x61\x1a\x8d\x92\x13\x6b\xb7\xdc\x58\xf5\xb2\x9f\xc1\x17\x23\xf2\x0f\xc8\xe7\xe5\x96\xe7\xa2\x89\xe4\x96\xcb\x7c\x95\xc1\x9f\x9c\x0d\x99\x19\xc9\x06\x94\x7a\x2e\xcf\xca\xe3\x64\x59\xc9\x06\xe0\x1a\x14\x1c\x9d\xd1\x8f\x97\xa0\xf1\x4f\x27\x5e\xe7\x35\xdc\x28\x7c\x65\x39\xdd\x93\x80\xc7\x7c\x6b\x0a\x1c\x61\x52\x94\x1b\x05\x8a\x69\xaa\xed\xe9\x59\x0d\x43\x1b\xd0\x9c\x77\xe6\xfe\x39\x3b\x94\xce\x1d\xf1\xf7\x9f\x2b\x07\x3e\x97\xa2\xfd\x4b\x4d\x51\x44\x85\x4a\x05\x1e\x3b\x8a\xe8\x61\xa6\x2c\x32\x59\x77\x43\x24\xb8\x74\xa8\x96\x3c\xfd\xc7\xec\x2f\x8a\xb2\x16\xca\x64\x5b\x32\x7f\x03\x00\x00\xff\xff\x6b\x55\xfd\x86\xa4\x03\x00\x00") + +func definitionsInfo_object_metaTomlBytes() ([]byte, error) { + return bindataRead( + _definitionsInfo_object_metaToml, + "definitions/info_object_meta.toml", + ) +} + +func definitionsInfo_object_metaToml() (*asset, error) { + bytes, err := definitionsInfo_object_metaTomlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "definitions/info_object_meta.toml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x97, 0xc7, 0x12, 0x2e, 0xc1, 0x1f, 0x6, 0x2a, 0xc2, 0xf5, 0x95, 0x4b, 0x90, 0x32, 0x59, 0x47, 0x96, 0xc7, 0x79, 0xa4, 0x2e, 0x79, 0x2f, 0x9b, 0xb9, 0xb8, 0xbf, 0x8, 0xb1, 0xc3, 0x8c, 0x18}} + return a, nil +} + +var _definitionsInfo_storage_metaToml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\xd2\xbd\x72\xab\x30\x10\x05\xe0\x5e\x4f\xa1\xa1\xe7\x56\x77\xd2\xf9\x11\x5c\xa5\xf4\xa4\x58\xa3\xc5\xd9\x09\xfa\x99\xd5\x12\x43\x32\x79\xf7\x8c\x84\x21\x63\x4c\x1c\xdb\x94\x08\x9d\xef\x2c\x48\x3b\x08\x01\x9d\x29\x5d\x6b\xf7\xc8\xa5\x85\x8e\x6c\x6b\x5f\x94\xf4\x01\xf5\x46\x17\xe4\xa4\x50\x06\x63\xc5\x14\x84\xbc\x4b\x6b\x5b\xe8\xf4\x10\xd3\x43\x2c\x6a\x72\xe3\x8a\x0f\xc8\x90\x76\xfe\x2b\x94\x1a\xf5\x48\x1f\xb8\x68\x3f\xfd\xbf\xa6\xa7\x58\xa2\x03\xf2\x55\x5e\xbc\x40\xf3\x68\x49\x0e\x4f\x55\x8b\x35\x95\x0f\xfd\xbd\x7c\xda\x36\xa8\xb5\x67\x9d\x84\x19\x5a\xa3\x54\xaf\xeb\xd4\x4c\xcc\xd8\xc6\x57\xf9\xe1\x07\x8b\xc2\xe4\x0e\xe9\x9d\xf5\xef\xb8\xae\x31\x09\xb3\x42\xdb\x36\x42\x01\x58\xee\xbd\x43\x59\x4e\xc1\xd3\x2d\x4a\xbf\x7f\xc2\x7e\x2d\x79\x64\xfc\x0c\xe6\x6f\x30\x58\x93\x43\xa3\xf7\xbd\x8e\xe2\x19\x0e\xc8\x8b\x3e\xb9\x9b\xfc\x61\xdb\x0d\xbe\x03\x8b\x97\x27\x82\x5d\xf0\x2c\x7a\xa3\x85\x5b\x54\x6a\x17\xfb\x28\x68\x4b\x8b\x02\x06\x04\xce\xea\x91\x6b\xa8\xf0\xf3\xeb\x62\x88\xe7\x1c\xda\x9e\x32\xb9\x16\xa3\x1e\xa8\x69\x9e\x91\xcc\xc3\x1c\x3d\xbf\x95\x86\xf8\xef\x81\x8e\x4c\xb2\xf2\xc6\x64\xe2\xec\x34\xbf\x03\x00\x00\xff\xff\x41\xde\xf8\x57\x73\x04\x00\x00") + +func definitionsInfo_storage_metaTomlBytes() ([]byte, error) { + return bindataRead( + _definitionsInfo_storage_metaToml, + "definitions/info_storage_meta.toml", + ) +} + +func definitionsInfo_storage_metaToml() (*asset, error) { + bytes, err := definitionsInfo_storage_metaTomlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "definitions/info_storage_meta.toml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9c, 0xdc, 0x18, 0x27, 0xc0, 0x7d, 0xb9, 0x57, 0x8b, 0xe9, 0x90, 0xfd, 0xf8, 0xb3, 0x2, 0x40, 0x16, 0xce, 0x94, 0xf9, 0x18, 0x51, 0x52, 0x7a, 0xff, 0x6b, 0x10, 0x2d, 0x50, 0x8, 0x2e, 0xb0}} + return a, nil +} + +var _definitionsOperationsToml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x4d\x8f\xdb\x38\x12\xbd\xfb\x57\x14\x34\x87\x5c\xba\x8d\x39\x0f\x90\x43\x26\x9d\xc5\x04\xc8\xd7\x4e\x67\x76\x0e\x41\xa3\x4d\x4b\x25\x8b\x1b\x89\x54\x48\xca\x8e\xf7\xd7\x2f\x8a\x45\x49\xd4\x97\xad\xf4\xf4\xee\x65\xf7\x12\xb8\x25\xb2\xaa\x58\x7c\xf5\xea\x91\xca\x17\x51\xd7\xa8\x32\x34\x0f\x9b\x0c\x6d\x6a\x64\xed\xa4\x56\xf0\x12\x12\x69\xc1\x15\x08\x52\x39\x34\xb9\x48\x11\x72\x6d\xe0\x95\x1f\x0d\x06\x4b\xe1\x30\x03\x5d\xa3\x11\x34\xc1\x6e\x93\xcd\xa6\xb3\xb5\xd5\xf5\x36\x35\x28\x1c\x3e\xf2\xa3\x87\x4d\x2d\x8c\xa8\x2c\xbc\x84\x2f\x49\x2d\x5c\x91\x3c\x6c\x0c\xda\xa6\x74\xfc\x48\x27\x13\xf7\x49\xb2\x39\xc9\xb2\x04\xb6\x03\x42\x01\x9b\x02\xbd\xff\x27\xa6\x6e\xbb\xd9\xfc\xf4\x13\xfc\x8a\x85\x38\x4a\x6d\x36\x9b\x5b\x78\xed\x07\x86\x00\xef\x7f\xfb\xf8\xc7\xbb\xbb\xc9\x64\xb1\x2f\x31\x18\x80\x93\x74\x05\xd4\xda\x4a\xef\xf1\x67\x10\x2a\x03\x2b\xff\x85\xf0\xf3\x76\xc1\xda\x87\x8f\x9f\xc1\xa0\x6b\x8c\x22\x8b\x68\x8c\x36\x20\x38\x4b\xc1\x26\x7e\x97\xd6\x6d\x37\x00\xb7\x70\x8f\xe6\x28\x53\xec\x22\x29\x30\xfd\xea\x7d\x64\x58\xa2\xc3\x78\x96\xcc\x79\xa2\xdd\x6e\x68\xd9\xc3\x3c\x9e\x8c\x8c\xd2\x38\x4a\x92\xcf\x50\xc8\x4b\xaa\x95\x43\xe5\xc0\xe9\x69\xb2\x92\x38\xff\x3a\xb9\x81\xc4\xd0\x3f\xb4\xdc\xd1\x4e\xa8\xe4\x61\xc3\x93\x1e\x2b\x9d\x21\x39\x61\x53\x93\xfd\xd5\x55\x25\xdd\xc5\xc0\x78\x88\x5f\x74\x2e\x95\xb4\x45\x14\x58\x6d\x74\x8a\xd6\x8e\x23\xbb\xe0\x7c\x5f\xea\xf4\xeb\x5a\x9c\xfe\x4a\x83\x97\x60\x1a\x2c\x45\x28\xf5\x4f\x9e\x01\xa4\xa0\xf0\x04\xde\xd8\x3c\x4c\x5b\x5c\x71\x78\x7f\x05\x56\xae\x10\x0e\x0a\x61\x41\x09\x27\x8f\x08\xb6\xa9\x6b\x6d\x9c\x5f\xfc\x4e\x1f\xd1\x78\xdc\xec\x20\xd3\x68\xd5\x0b\x07\x1f\xde\xbc\xb9\x23\x68\x30\x0e\xc7\xb6\x2d\x68\x03\x4a\xcf\xf9\x68\x0d\x14\xe2\x88\xd7\x9c\x3d\x05\xeb\xd1\x66\x30\xd4\xc3\x5e\xcc\x01\xca\x0f\x18\x00\x9d\x93\x7d\x11\xdf\x37\x90\xec\x65\x76\x1d\xe6\xde\xd2\x18\x1e\xba\xda\x4b\x75\x31\xa6\x30\x84\x03\xb1\x04\x43\x5f\x7f\x8b\x85\xb7\x97\x99\x5d\xe7\xbc\x94\xd6\x5d\xf2\x4c\xef\x5b\xb7\x7b\x2c\xb5\x3a\x50\x4a\x5c\x21\xed\x82\xf7\x61\x0a\xf6\xf2\x42\x18\xa9\xae\xe5\xda\x5a\x7b\xad\xeb\xf3\xb6\x9f\xc4\x79\xab\xcf\x83\x72\xb2\x26\xa5\xc5\x67\xd6\x5d\x28\x22\x5d\x9f\x29\x75\x1f\x19\x29\xda\x40\xd5\x94\x4e\xd6\x3d\x65\x4b\xe5\xdd\x5b\xc6\xe7\x4c\x0b\x20\x0b\x5a\x95\x67\xb6\xa5\x15\x7a\x14\xfa\x27\xf4\x47\x5b\x93\x31\xc8\xef\x3e\x7e\x78\xf1\xb9\x2b\x8f\x16\xd9\x1c\x0b\x28\xad\x6e\xb1\xaa\xdd\x19\x32\x69\x30\x75\xda\x9c\x29\x2e\xff\x36\x97\x25\x5a\x30\x98\x36\xc6\xca\x23\x96\x67\xb6\xfb\x87\x45\xd3\x99\x93\x55\x5d\x62\x45\x60\xbd\x60\x50\x78\xf2\xae\xcf\xb1\x2d\xd8\x9f\x69\xa9\x95\xc5\x32\x67\xbb\xaf\xd9\x00\x79\x65\xe4\xf7\x06\x42\xd9\x05\x0e\xd9\xbd\x31\x86\x53\xf8\x5e\x67\xf8\x56\x1d\x45\x29\xb3\xdd\xb6\x4d\xcf\x65\xd2\xc9\xac\x1b\x12\xc3\x73\xb3\xce\xc4\xc1\x7f\x9e\x79\x22\x97\x11\xfb\xdc\xc2\x2b\xb0\x4d\x4a\x4d\x28\x6f\x02\xf8\x74\xcd\x6d\x02\x6c\xa1\x9b\x32\x83\x3d\x91\x0d\x6d\xa1\xc3\x1b\x38\x15\x32\x2d\xa0\x42\xa1\xec\xc8\xec\x0b\xdb\x71\x12\xb9\xae\xd0\x89\x4c\x38\x11\x59\xf1\xa8\x15\x15\x52\x8a\xad\x49\x3b\x20\x32\x05\xd2\x4e\xae\xac\xb5\xbb\x76\xd3\xb7\xdd\xc4\xa8\x8d\x65\x72\x6a\x66\xda\x9f\x32\x69\x66\x09\x62\xa1\xe5\x6d\xbe\xe4\xe8\xd2\x62\x6d\x84\x7f\xa3\xc1\x3e\xba\x30\x8d\xe2\xf3\x3f\xa7\xfd\xf5\x06\x92\xc6\x94\xcb\x8c\xe0\xa7\x41\x6e\x74\x05\x02\x0e\xf2\x88\x0a\x1a\x53\x12\xa0\x68\xfa\xb4\xfe\xbd\xef\x1f\x6c\xab\x53\x28\xb0\xd7\x4e\x33\xac\x02\xc3\x53\x80\x60\xf0\x5b\x23\x8d\x54\x07\x5e\x21\xbd\x6a\x4c\xd9\x82\xa2\x22\x74\xaf\x4b\xf9\x7b\x7d\xc4\x6d\x37\x87\xf2\x4d\x3f\x7e\x98\x7f\x69\x52\xdf\xba\xae\x92\x2d\x79\x65\x6a\xad\xf8\xd7\x93\xc9\x96\x1d\xcf\x71\xe3\x45\x4a\x5d\x9e\x36\x65\xcf\xf7\x3c\xf6\xaf\xb0\xa7\x37\xf1\x7f\xf6\x9c\x2d\x19\x46\x40\x57\x31\xc1\xde\x7f\x89\x3e\x59\x25\x08\xe3\x56\xd7\x4b\x3b\x61\xe9\x80\x10\x59\x8c\xd8\xb5\x7b\xfa\x5c\x07\x85\xce\xe0\xd2\x61\xb6\x0f\xf4\x87\x39\x6d\x92\x9a\x5e\x60\x47\xeb\x58\x29\xb2\xfb\x40\xaf\x08\x6d\xa9\x32\xfc\x3e\x91\xda\x37\x90\xd0\xe4\xa9\xdc\xf4\x4f\x67\xf2\x1d\x40\x73\x2d\xd2\x76\x5c\x1c\x21\x34\x75\xa9\x45\x16\x44\x95\xb2\xce\x34\xa9\xeb\x55\xe5\xcc\x02\x68\xd6\x8c\x22\x5f\x88\xcd\x8b\xf2\x2b\x71\x79\x61\xee\xcd\x8e\x75\xf9\x62\x22\x87\x29\xab\x67\xa4\x79\x1b\x4f\x2d\x0e\x6b\x71\xfe\x49\x1c\x70\x06\xe2\xa1\x14\x5b\x32\x30\x42\x65\xba\xe2\x6d\xdf\x76\x1e\x22\xdc\xd3\xdf\xcf\x05\x79\xb2\x75\xe5\x06\xc7\x47\xfd\x44\xbc\x77\xa1\x33\xd2\x39\xf2\x55\x20\xb7\x35\xa6\x32\x97\x29\xe8\x3c\xb7\x78\x15\xe8\x3c\xea\xfa\xa1\x92\x22\xa0\xc0\x0c\x8a\x59\x09\x95\x24\x9b\xd9\xad\xfb\x9d\xc6\x6f\x37\x9b\x3b\xac\x0d\xa6\xb4\x81\xbf\x50\x1b\x84\x7b\xa7\x8d\x38\xe0\x6f\x9f\x3f\x7f\xba\x97\x07\x85\x06\xa4\xb2\x0e\x45\xd6\x66\x20\x38\xa2\x1c\xf8\x9f\xd7\x36\xee\xa2\xfe\xaa\x8d\x3e\xca\x8c\xf6\xee\x24\xce\x2d\x85\xa7\x42\x81\x37\x1d\x6d\xc3\x4c\xa4\x7f\x6f\xd0\x9c\x29\x46\x8a\xf5\x77\x14\xd9\x38\xd2\x20\x2c\xa6\x39\x21\x07\x95\x90\xca\x09\xa9\xa2\xc2\xb6\xbc\xf4\x56\x90\x30\x53\xb7\x46\x7a\xb8\xae\x10\xc0\xc1\x12\xe7\x4e\xa8\x14\x87\xbb\xad\x44\x35\xbe\x15\xa3\x19\xe8\xb5\x70\xec\x90\xbb\xe4\xbc\xc3\xd0\x41\xc5\x4a\x67\x43\xc3\x07\x5c\x60\x96\x03\x3a\x10\xe0\x35\xc9\xd4\xb0\x07\x4e\x2b\xd7\x9e\xb6\x22\x62\xae\x0b\x9c\x26\xca\x72\xea\xd6\x42\xa3\x32\x34\x4c\x70\xbd\xfb\xa1\x33\xc9\xae\xc2\xdc\x75\xf4\x35\xda\x70\xde\xef\x60\x21\x4e\xff\x14\xe0\xb5\x90\x26\x54\x6e\x5f\x8e\xcb\x30\x6f\xf7\xaa\x93\xbe\x5e\x8f\x2f\x0a\xdf\x3b\x1e\xee\x85\x6e\xd6\xfe\x7e\xb2\xf8\x35\xc8\x3a\xb6\x2c\x2f\x8a\x5d\x1e\xf6\x48\x3b\x30\x10\xb7\x5d\x38\xd2\x82\xcc\xb0\xaa\x35\x31\x5a\x70\xdc\x0b\xb4\x76\x89\xe5\x49\x9c\x6d\x4b\xa9\x4a\x96\xcc\xa9\x3c\x3c\x18\x0a\xd4\xab\xf0\x88\xa6\x53\xc5\xdc\x3d\x3f\x68\xf7\x86\xf8\x76\x17\x8f\x1f\x2e\x6b\xfe\x7e\xb1\x93\xa9\xa1\xf4\xa3\x5d\x6c\xe5\xde\x3c\xec\x82\xff\xb4\x31\x86\xb2\xd0\x81\xaf\x9d\x35\x02\x1a\x3d\x4e\x1e\x36\xa5\x4e\x45\x09\x2f\xc1\x99\x06\x47\xee\x18\xe1\x97\x20\xc3\x1d\x9e\x01\x33\x68\x71\x72\x19\x41\x21\x4c\x2e\x92\xbe\x97\xcc\x9f\x52\x47\x5f\x06\x5a\x20\x64\x98\x8b\xa6\x74\xb0\x7b\x27\xad\x3f\x7c\xf8\x53\xc7\x68\x70\x0f\x88\x6e\xd8\x9d\x34\x3b\xff\x31\x43\x37\xce\x27\x9e\xb7\xc0\x6b\xfc\x7f\x48\xe3\x1a\x51\xd2\x90\xd8\xd8\x70\xcb\x76\xf7\x4e\xb8\x1d\xb1\x7b\x49\x25\xc8\x96\x77\x73\x7b\x65\x50\x2c\x5c\xf5\xd3\x1b\xef\x9c\x4e\x58\x2f\x2c\x84\xbd\x99\x39\xf0\x9f\x06\xc9\x1e\xf5\x53\x92\x90\xfa\x31\x15\x65\xb9\x17\xe9\xd7\x99\xf6\x3a\x8c\xa7\x65\xfc\xeb\xda\x64\x89\x11\x06\x48\x59\x23\x60\xa2\x8f\x47\x94\x6f\xa1\xce\x20\x6a\x09\xa9\xaf\xdf\x79\x41\x13\x8b\x19\x8b\x2a\xf3\x93\x5e\x7d\x7a\x1b\x26\x8d\x87\x89\x34\xc5\xda\x41\x7f\x08\x05\x0a\x9e\x64\x4f\xf0\x4d\xa1\xcf\xed\x8e\x75\xe2\x0a\xb4\x87\x6b\x5f\xa9\xdf\xc8\x2c\x08\x8f\x65\x42\x0b\xb5\x20\xa9\x72\x0d\x3a\x8f\xee\xb9\xa7\x20\xa7\x59\x57\x57\x54\x48\x35\x3e\x24\xbf\xf6\x53\xfc\xa9\x35\x93\x79\x8e\xbe\xee\x3b\xd8\x07\x05\x4b\xe0\xee\xdf\x0e\xf2\xb2\xf8\xed\x4d\xe6\xa1\x4c\xa5\x3a\xc4\xb1\x90\x2c\x17\x2e\x2d\x66\x32\xea\x55\xe2\xec\xb5\x55\xfc\xf9\xac\xcf\xef\x65\xec\x2e\xe4\x97\xa5\xa8\x3f\xf1\xf2\xc7\x03\x5f\x43\xd3\x8c\xfe\xe9\xc7\xfd\x8f\x7f\x33\x1a\xdd\x3b\x70\xee\x7e\xec\xe2\xe1\x49\x97\x0e\xcc\xe8\x48\x22\x36\x38\x35\xf8\xad\x41\x3b\x6e\x69\x8f\x85\x73\xf5\xa3\xf5\xd2\x7c\x9d\xca\xb9\x6f\x5b\xda\xd5\x83\x9a\x68\x5c\x81\xca\xc9\xd4\xbf\xdd\x2e\x78\x25\xdc\x7e\x23\xed\xed\xff\xe6\x37\x57\x78\xdb\x2f\xbc\xbb\x83\xf4\x77\x64\xfb\x33\x34\x96\x0a\xc5\x9b\x02\x5f\x01\xe8\xd0\x58\x7f\x21\xd0\x07\xd2\xe5\xc1\xce\xb3\x3d\x7e\xaf\xa5\x19\x93\x8d\xc1\x6f\x31\x95\x5f\x8b\x3e\x54\xe1\xf2\x31\x6e\x5c\x3b\xcf\x16\x7d\xdb\x9d\x2e\xae\xa2\x94\x6a\xf5\x67\x69\x1a\x9b\x74\x73\xa2\x33\x36\x3d\x98\x25\x1a\x27\xcc\x61\x72\xd0\x9c\x67\xeb\x3f\x07\xcd\x8a\x2c\x46\xec\x3c\xa0\x92\x1d\x59\xdf\x79\xe0\xef\xd8\xc1\x2e\xf0\xee\x3e\x5c\x18\x50\xc5\x12\xa5\xec\xad\x2e\x1b\x87\x41\xc9\xdc\xc2\xdb\xbc\x9f\xa1\x74\xcb\x04\x37\xa1\x85\xbd\x23\x9f\xa1\x69\x2c\x05\xd3\xdf\xde\xb3\x35\x0e\x85\xed\xfc\xe2\xa9\xa4\x7f\x2a\x2d\xa9\xa9\x73\x15\x4d\x9f\xba\x0a\x02\xda\x97\xeb\x60\x28\xdf\x01\xc5\xcd\x7b\x36\x8c\x89\x4b\x5a\xd7\x1a\xb7\x2d\xfb\xce\xdd\x18\x07\x4a\x3e\x15\x38\xb8\x45\xf7\xcc\xe8\x1d\xb4\x45\xdd\x31\x21\x73\x5b\x1c\x61\xb4\x23\xe4\x8a\xc9\x27\x88\x35\x22\xd1\x20\xd3\x6e\xe3\xd0\x5e\x8f\x54\xe2\x91\x05\xa0\xc7\x17\xe4\x28\x5c\x63\x90\xa3\x6a\x23\x6a\x95\xcc\x90\xa6\xfb\xb3\x88\x6d\x49\x15\x95\xff\xdf\x33\xfe\x98\xd7\x5a\xea\x8f\x22\x47\x0c\x97\x30\xff\x0e\x00\x00\xff\xff\x73\x4a\x07\x43\x51\x24\x00\x00") + +func definitionsOperationsTomlBytes() ([]byte, error) { + return bindataRead( + _definitionsOperationsToml, + "definitions/operations.toml", + ) +} + +func definitionsOperationsToml() (*asset, error) { + bytes, err := definitionsOperationsTomlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "definitions/operations.toml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb7, 0x6d, 0x76, 0xd8, 0x7d, 0x7d, 0x7b, 0xc2, 0xac, 0x37, 0xda, 0x9f, 0x19, 0x2f, 0xfb, 0x87, 0x3f, 0xb8, 0x1c, 0xd9, 0x54, 0xa8, 0x36, 0xbb, 0xfd, 0x9, 0x4, 0x5f, 0x8e, 0x3, 0x29, 0xba}} + return a, nil +} + +var _definitionsPairsToml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x54\x4b\x6f\xdb\x30\x0c\xbe\xfb\x57\x10\x39\x6d\x40\x91\x5e\xb6\x1d\x06\xec\x56\x0c\x1b\xb0\x62\x5b\x1f\xa7\xa2\x48\x64\x89\x8e\xb9\xc8\xa2\x47\x51\xf1\xbc\x5f\x3f\x48\x4e\x9a\xa0\x6d\xfa\xd8\xcd\x90\xf8\x3d\x48\x7d\xf4\x8d\xe5\xa0\x18\x74\xd1\xb9\xf7\xb7\x95\x8e\x3d\xc2\x27\x98\x45\x15\x0a\xab\x59\x55\xdd\x5d\xe7\x9b\xdb\xca\x61\x63\x92\x57\x53\xfb\x5c\xa6\x92\xf0\x08\x84\x42\x32\x4a\x1c\x16\xca\x6b\x0c\x0f\x89\x1d\x46\x2b\xd4\xe7\x92\x72\xdc\xa3\xa5\x66\x04\x6d\x11\x0e\xe1\x50\xe0\xd0\xb0\x80\xa7\xa8\x85\x5d\xd0\x61\x50\x32\xfe\xc5\xac\x2d\x0f\xa0\x0c\xbd\xf0\x86\x1c\xc2\x9e\xa1\x10\x47\x94\x0d\x59\x84\xfc\xa9\x2c\x66\x85\x59\x06\x83\xeb\x99\x82\xfe\xaf\xc8\x0e\xff\x94\xc4\x9f\x9e\x04\xf7\x02\x4a\x1d\xce\xcf\x92\x94\xce\x1f\xe8\xcc\x66\xd5\x4e\x6a\x68\x31\x94\x51\x25\xf1\x20\xa8\x49\x02\x3a\xa8\x47\x10\x34\xb6\x85\x81\xbc\x87\x89\x7c\x5e\x55\x67\xd8\x0b\x5a\xa3\xe8\x3e\xc2\x75\x44\x58\xfe\x4c\x28\xe3\x25\xad\xc2\x97\xab\xab\x1f\x17\x68\xdc\x12\x28\x44\x45\xe3\x80\x1b\x58\x5e\x64\x8e\x25\x98\xe0\x60\x39\x91\x2c\x81\x62\x91\x73\x68\xbd\x11\x74\x60\x64\x95\x3a\x0c\x3a\xaf\xb2\xad\xea\x86\x82\xa2\x58\xec\x95\x65\xdf\xce\xd7\xfd\x61\xae\xc9\xef\xb7\xe8\xd8\x1d\x34\xfc\x8d\xa2\x9e\xb3\x2b\xc3\xf0\x6c\x4b\xdf\xaf\x8a\xca\x0e\xf4\xc4\x90\x83\xe9\xf0\x55\x9c\x5b\x2c\x64\x60\x26\xe0\xfa\x17\xda\xfb\xce\xbf\x97\xc3\xc9\xfb\x3d\xae\xfd\x15\xb4\x14\x4a\x64\xb9\x69\x22\x1e\x24\x89\x82\x7e\x78\x77\xd4\xc4\x54\x5d\x5a\xd2\x96\x22\x08\xfe\x4e\x18\xf5\xe4\xce\x59\x79\xdf\x88\xb8\xce\x79\x2b\x25\x5b\x48\x8d\x0d\x0b\xe6\x14\xb8\x2c\xdb\x25\xaf\xd4\x1b\xd1\x05\xb9\xc7\x56\x9b\x78\x61\x8d\xf7\xb5\xb1\xeb\xfd\x75\x93\x82\x7d\x73\x73\x5b\x8f\x8a\x6f\x67\x8f\xed\xfb\x11\xd7\x43\x6b\x14\x94\x1d\x03\x6e\x50\x46\xc8\x61\x86\x61\x32\x03\xce\xa8\x81\x46\xb8\x83\xc8\x49\x6c\x99\x6b\xa4\xbf\xf8\xd2\x91\xe4\xda\xe7\x06\xc2\xc1\x8f\x93\x9a\xa7\x8e\x14\x1d\x6c\x7f\x5d\x45\x3d\x2b\x0e\x2c\xeb\x85\x23\x79\x36\x0e\x07\xab\x96\x13\x91\x71\xe0\x48\x8e\xa4\xec\x64\xdb\x31\xf7\x38\xad\xee\xe4\xa7\xce\xbd\x7b\xa3\xb4\xc1\xbb\x77\x72\x24\xf3\x6a\x67\x03\xce\xaf\x2f\xaf\x20\xaa\x11\x85\x81\xb4\x85\xd3\x22\x30\x91\xed\x5a\xdb\xca\xc5\x03\xd8\x8e\x7d\xfb\x36\x99\xfc\x14\xa8\x81\xc0\x0a\x11\x75\x5e\x7d\x66\x81\x26\xde\xa7\x80\x62\x2c\x38\x1e\x22\xf4\xde\x68\xc3\xd2\x9d\x94\xfe\x6a\x6c\xcd\x86\x58\xf2\x9a\xa7\xe0\xb0\xa1\x80\x6e\x5a\xed\x7f\x01\x00\x00\xff\xff\x1a\xd1\x94\x09\x1e\x06\x00\x00") + +func definitionsPairsTomlBytes() ([]byte, error) { + return bindataRead( + _definitionsPairsToml, + "definitions/pairs.toml", + ) +} + +func definitionsPairsToml() (*asset, error) { + bytes, err := definitionsPairsTomlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "definitions/pairs.toml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb3, 0x32, 0x6d, 0x72, 0x3a, 0x90, 0xe5, 0xa2, 0x6c, 0xf4, 0x2e, 0x91, 0xf5, 0x83, 0x10, 0xb8, 0x34, 0x5, 0x5c, 0x2c, 0xb1, 0xbb, 0xbc, 0xc8, 0xcd, 0x54, 0x88, 0x77, 0x80, 0xd1, 0x1a, 0x5d}} + return a, nil +} + +var _cmdDefinitionsTmplFunctionTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x91\x41\x4b\xc4\x30\x10\x85\xef\xfd\x15\x8f\x25\x87\xae\xec\xe6\x07\x08\x9e\x8a\x82\xb0\xc8\xa2\xde\x25\x64\xa7\x6b\xb0\x99\x94\x66\x5a\x17\x62\xfe\xbb\xa4\x55\x17\x11\x0f\xde\x3c\x25\xcc\xcc\x7b\xf3\x3e\x26\xa5\x2d\x06\xc3\x47\x82\x7a\xda\x40\x4d\xb8\xbc\x82\xd2\x37\x23\xdb\x88\x9c\xab\xd2\x76\x2d\x38\x08\xd4\xa4\x6f\x7d\xdf\x91\x27\x16\x3a\x7c\x36\x55\xcb\x2f\xb3\x66\xd2\x77\xc6\x13\xde\x20\xa1\x31\x9e\xba\x65\xa0\x88\xd5\xa4\x77\xc1\x9a\xb9\xd2\x8e\x6c\x51\x47\x5c\xa4\x04\x75\x56\xec\x4d\x5c\x06\xd6\x48\xa9\x58\xe6\x5c\xa7\xa4\x26\xbd\x37\x83\xf1\x51\x3f\x0e\xce\xef\x4c\x14\xfd\x20\x83\xe3\xe3\x35\x1f\xe2\xab\x93\xe7\x26\x78\x6f\x72\x46\xe8\x05\xbd\x71\xc3\x2f\xa6\xa5\x5c\x62\x7e\xdf\xb4\x2c\xb8\xa7\x38\x76\x12\x3f\x8c\xe7\x00\x15\x00\xf4\x86\x9d\xad\x57\x05\xdc\x9d\xa9\x57\xeb\x6a\xa6\xa2\x2e\xd2\x1f\x71\xac\x9c\x60\x03\x0b\x9d\x44\x37\xcb\xbb\xc1\x3f\x66\xdc\x82\xf8\xeb\xca\x3f\xbe\xef\x01\x00\x00\xff\xff\x41\xc8\xae\xbf\x37\x02\x00\x00") + +func cmdDefinitionsTmplFunctionTmplBytes() ([]byte, error) { + return bindataRead( + _cmdDefinitionsTmplFunctionTmpl, + "cmd/definitions/tmpl/function.tmpl", + ) +} + +func cmdDefinitionsTmplFunctionTmpl() (*asset, error) { + bytes, err := cmdDefinitionsTmplFunctionTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "cmd/definitions/tmpl/function.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc1, 0xfc, 0xb, 0xf4, 0xfb, 0xf, 0x94, 0xca, 0x64, 0x7a, 0xb8, 0x48, 0xf9, 0x69, 0xf1, 0x88, 0x46, 0x59, 0xd3, 0xbc, 0x0, 0x4e, 0xe7, 0x8, 0x1e, 0xdf, 0x27, 0x59, 0x81, 0x75, 0x52, 0xa2}} + return a, nil +} + +var _cmdDefinitionsTmplInfoTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x94\x5f\x6f\xd3\x30\x14\xc5\xdf\xfd\x29\x0e\x55\x85\x1a\xd4\x35\x9b\x84\x78\x80\xe5\x69\x1b\x68\x42\xdb\x90\x36\xf1\x82\x10\x72\x92\x9b\xca\x34\xb6\x23\xdb\x89\x56\x32\x7f\x77\xe4\x24\x74\x4d\xf7\x07\x8a\x78\xe1\xcd\x37\xf6\xbd\xe7\x77\x8f\xaf\x13\xc7\x38\xd1\x39\x61\x49\x8a\x0c\x77\x94\x23\x5d\x63\xa9\x37\x31\x32\x99\xc7\x39\x15\x42\x09\x27\xb4\xb2\xef\x70\x7a\x85\xcb\xab\x1b\x9c\x9d\x9e\xdf\x2c\x58\xc5\xb3\x15\x5f\x12\xdc\xba\x22\xcb\x98\x90\x95\x36\x0e\x33\x06\x00\x93\x42\xba\x09\x8b\x18\x6b\xdb\x03\x18\xae\x96\x84\xe9\x6a\x8e\xa9\x50\x85\xb6\x78\x9b\x60\x71\x1e\x56\x17\xbc\x82\xf7\xac\x6d\x31\xb5\x64\x1a\x91\xd1\x25\x97\x14\xf6\xa7\x2b\xdc\xc1\xe9\x13\x2e\xa9\x0c\x47\x58\x1c\xe3\xbd\xa0\x32\x87\x50\x39\xdd\x42\x28\xb4\xed\x76\x92\xf7\x48\x85\x63\x99\x56\x36\x40\xec\xe8\x36\x5d\xcd\x5e\xdd\xfb\x0e\x71\x37\xfd\x3c\xd4\x0d\x24\xcd\xa2\x83\x08\xf2\x9f\xb8\xcd\x78\xd0\x47\x82\xa3\xe3\xe3\xb0\xbb\xea\x81\x0f\x40\x2a\x0f\xcb\x88\xb1\x60\x00\x76\x7b\x18\xa7\x5b\x67\xea\xcc\xa1\x1d\x94\x37\x6c\xdf\x9e\x62\x0b\x18\x37\xeb\xaa\xaf\xe5\xfd\xd6\x97\xfb\x33\x1b\x86\x2e\x8e\xe3\x60\x00\x6a\x4b\x39\xb8\x05\x0f\x91\xe4\x15\x0a\x6d\xa0\xd3\xef\x94\x39\x34\xbc\xac\x69\x8e\x43\x48\xe2\xca\x42\x69\x07\x4b\x6e\x8e\xa3\xe1\x83\x25\xd7\x95\xea\xea\x08\xe5\xde\xbc\xee\x42\x09\xc9\xab\x2f\xd6\x19\xa1\x96\x5f\x85\x72\x64\x0a\x9e\x51\xeb\xd9\xa0\xfc\xbc\xd7\x61\x57\x14\x81\xfe\xec\xb6\x9b\x10\xef\x59\x51\xab\x0c\x33\x89\x57\xcf\xba\x16\xe1\x03\xb9\xbe\xf1\x53\x61\xab\x92\xaf\x07\x37\x66\xd1\xd8\x8f\xc1\x57\x43\xae\x36\x0a\x72\xf1\xc0\xbe\x40\xfa\xa7\x9a\xd7\x4f\x68\x36\x63\xcd\xe8\x37\x85\x06\xa6\x47\x60\x90\xa0\x19\xf1\xb2\x61\xa0\x4a\xdb\xb1\xfe\x03\x77\x66\x23\xd4\x39\x52\xad\xcb\x68\x20\x12\x05\xe4\x22\xdc\xf0\xcb\x3d\x9f\xc0\x8b\x04\x87\x43\x8d\xe7\xdd\x9e\xc3\x99\x9a\xba\x83\x7e\xbb\xd1\x2d\xa8\x3b\xfc\x20\xa3\x3f\x87\x79\xec\x12\x0a\x5e\x5a\xda\xe7\x96\x2e\x6a\xeb\xf6\x9b\x8e\xbf\xee\x3b\x19\xf7\x5d\x71\x25\xb2\x59\x21\xdd\xe2\xba\x32\x42\xb9\x62\x36\x79\x8c\xf5\x23\xa5\x3c\xbd\x7f\xb9\xbf\xee\x5e\x6c\x9e\xdd\x24\x8a\x1e\x5a\xf4\xdf\xcc\x6e\x6f\xe5\x5d\xb2\x9f\x97\x8f\x8e\x7d\xff\x0f\xdb\xf9\xa5\xdd\x2f\x7f\x06\x00\x00\xff\xff\x26\xf5\xd0\xb3\xa6\x06\x00\x00") + +func cmdDefinitionsTmplInfoTmplBytes() ([]byte, error) { + return bindataRead( + _cmdDefinitionsTmplInfoTmpl, + "cmd/definitions/tmpl/info.tmpl", + ) +} + +func cmdDefinitionsTmplInfoTmpl() (*asset, error) { + bytes, err := cmdDefinitionsTmplInfoTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "cmd/definitions/tmpl/info.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa6, 0x9d, 0xdc, 0x29, 0x17, 0xc8, 0x8a, 0x14, 0x25, 0x13, 0xa5, 0x85, 0x13, 0x6, 0xf, 0xb3, 0x4a, 0x21, 0xd1, 0x20, 0x4e, 0x6f, 0x92, 0x60, 0xe2, 0x6e, 0x29, 0x96, 0x4a, 0xee, 0x99, 0x66}} + return a, nil +} + +var _cmdDefinitionsTmplObjectTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x56\x4f\x6f\xe3\xb6\x13\x3d\x87\x9f\xe2\xfd\x82\xe0\x57\xbb\xb0\xa5\xdd\xb6\xe8\x21\x5d\x1f\x8a\x75\xda\x06\x68\xe2\x05\x9c\xf6\x1c\x9a\x1a\xd9\x6c\x28\x52\x25\x47\x5e\x7b\x1d\x7d\xf7\x82\x92\x9c\xd8\x89\xbd\xf5\xa2\x68\x4f\xe6\x9f\x99\xc7\x99\x37\x6f\xc6\x4a\x53\xbc\x77\x19\x61\x4e\x96\xbc\x64\xca\x30\x5b\x63\xee\x9e\xf6\x50\x45\x96\x66\x94\x6b\xab\x59\x3b\x1b\x7e\xc0\x78\x82\xdb\xc9\x1d\xae\xc6\xd7\x77\x89\x28\xa5\x7a\x90\x73\x02\xaf\x4b\x0a\x42\xe8\xa2\x74\x9e\xd1\x13\x00\x70\x9e\x17\x7c\xde\xae\x58\x17\xd4\x2d\xc3\xda\xaa\x73\xd1\x17\x22\x4d\xf1\x93\x26\x93\x41\xdb\x8c\x56\xd0\x16\x6e\xf6\x07\x29\xc6\x4c\xb3\x50\xce\x86\x88\xb3\xd9\x0c\xe1\xa5\x9d\x13\x2e\x1e\x06\xb8\x58\xe2\x72\x84\x64\xd2\xd8\xdd\x10\x4b\xd4\x75\x83\xda\x7a\x5e\x47\xa0\xcd\x06\x17\xcb\xe4\x56\x16\x84\x47\xb0\xfb\x20\x83\x92\x06\x75\x8d\x4a\x5b\xfe\xfe\x3b\x8c\xf0\xf6\xdd\xbb\x68\xf4\x10\x9d\x23\x3e\xd9\x2c\x2e\xdb\x90\x5a\x6c\xe8\x00\x5e\x10\x42\x21\x8d\xa1\xc0\xa8\xac\xe6\x18\xe2\xdc\x0d\x03\x3b\x2f\xe7\x94\x88\x34\x8d\x0e\xb7\x93\xbb\xab\xe9\x65\x5c\x01\xc3\xce\xfd\xab\x80\x3c\xa6\x16\x30\xfd\x65\xf2\xdb\xaf\x63\x58\xc7\x98\x11\xd4\x22\xa6\x92\xc1\x55\x1c\x74\x46\x08\xe4\x97\x5a\x51\x48\xf6\xdd\xf1\xfe\xc7\xdb\x48\x71\xf4\x70\xa5\xa6\xec\xc5\xb5\x0e\x50\xce\xaa\xca\x7b\xb2\x8c\x20\x73\x7a\x06\xb0\x66\x8d\xfb\xeb\xf1\xfd\x00\xf7\x1f\x24\x2f\xe2\xef\x8d\xcb\xe8\x1e\xd2\x13\x3c\xfd\x59\x69\x4f\x19\xb2\xca\x6b\x3b\x87\xd1\x81\xe1\xca\x58\xe8\x58\xdb\x01\x1c\x2f\xc8\x77\xb1\xb7\x90\x80\x72\x95\xc9\x62\x2c\x39\xb1\x5a\x50\x86\xa5\x96\x30\xf2\xd3\x1a\x81\x25\xc3\xb8\xb9\x56\x97\x58\x30\x97\xe1\x32\x4d\x67\xb4\x76\x36\xdb\x72\xa4\x5d\x9a\x39\x15\xd2\x67\xda\x52\x6d\x99\xbc\x95\x26\x6d\x6b\x36\x8c\x48\xc3\x88\x24\xa2\x86\xb6\x29\x06\xf6\x95\x62\x6c\x4e\x15\x40\x34\xd3\x79\xac\xfc\x98\x82\xf2\xba\x8c\x09\x3d\x5f\x1e\xbd\x78\xaa\xfe\xb3\xdd\xdd\xba\xa4\x46\x3e\x75\xbd\x73\xf2\x42\x2c\xe2\x2c\x4d\xa1\x8c\x8e\x05\xe8\xb4\xb2\xdd\x59\x7c\x5c\x68\xb5\xd8\x29\x96\x34\x7a\x49\x89\x38\xeb\x2c\xa6\x2d\x13\x5e\x34\x8f\xa6\x69\x14\x3c\xaa\x40\x19\x64\x80\x8c\xbb\x42\x96\xc8\x9d\xdf\x36\xc4\x52\x9a\x8a\x06\x78\x83\x82\xa4\x0d\x8d\x98\x02\xf1\x00\x6f\xbb\x83\x40\xdc\x40\x35\x38\x8d\xca\xc5\x59\xe6\x2c\x35\x9b\x6f\xbf\x11\x67\x45\xbc\x8d\x8d\x97\xdc\x54\x4c\x2b\x51\x0b\x71\x0a\xb1\x9b\x4d\xc7\xe9\xd5\xaa\x69\xeb\xba\x16\x79\x65\x15\x7a\x0e\x5f\xb7\x96\x7d\xfc\x4c\xdc\xd1\xab\x43\x69\xe4\xba\x63\xae\xd7\xdf\xe7\x0e\x9b\x26\x42\x4f\x5c\x79\x0b\x97\xbc\xa2\x3a\xc6\xf4\x0a\x7c\x7a\x04\x7c\xb9\x0f\xde\xdf\x7a\x74\xaf\x1c\x80\xc7\x08\xcb\xbd\x08\x44\x57\x4e\x13\x9a\xd7\xa3\xd8\x8f\xa4\x82\x8f\xda\x18\xcc\x89\x71\xf0\x36\xf7\xae\xe8\x6a\xdd\x8c\x84\x83\x62\xfb\x02\xda\x7a\x7b\xa9\x0d\x30\x73\xce\xf4\x9f\x12\x8b\x8d\xd2\xeb\xb7\xca\xd1\x39\x5c\x12\x6b\xfe\xff\x93\xe6\xdf\xff\x46\x78\xd3\xe1\x7c\xbe\x14\x03\xb0\xaf\xa8\x31\xac\xc5\x2e\x69\x3b\x91\x3d\xe2\x13\x79\xf7\x7b\x14\x66\xe3\x91\x4b\x13\x48\xb4\x3c\xde\x54\x81\xff\x4b\x2e\x3f\xf3\xde\x11\x19\xfe\x23\x1e\x47\xfb\x3c\x96\xd2\x6a\xd5\xcb\x0b\x4e\xa6\xa5\xd7\x96\xf3\xde\x79\xd7\xb6\x3b\x08\x75\x1d\xe7\x40\xd7\xb8\xe7\xfd\x7e\x47\xee\xdf\xb7\x44\x9a\x1e\x6b\x82\x96\xca\x70\x8c\x4a\x6d\xd9\x7d\x39\x95\xff\x42\xc3\xb5\xd4\x3e\x8e\x4e\xe1\xf6\x60\x87\xb6\x03\x77\x77\xf6\xbe\x0a\x5b\x19\x67\xa9\xb7\xda\x39\xd9\x3c\xcd\xf7\x53\xbe\x1e\x0e\x86\xbf\x3a\x54\x92\x17\xff\x1a\x3b\x19\x36\x0e\xf1\xd3\xa5\x16\x7f\x05\x00\x00\xff\xff\xa7\xaa\x95\x75\x54\x09\x00\x00") + +func cmdDefinitionsTmplObjectTmplBytes() ([]byte, error) { + return bindataRead( + _cmdDefinitionsTmplObjectTmpl, + "cmd/definitions/tmpl/object.tmpl", + ) +} + +func cmdDefinitionsTmplObjectTmpl() (*asset, error) { + bytes, err := cmdDefinitionsTmplObjectTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "cmd/definitions/tmpl/object.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2d, 0x61, 0x7d, 0x5b, 0xc0, 0xc8, 0xe7, 0x81, 0xf1, 0x98, 0xf, 0xb1, 0xee, 0x37, 0x9f, 0xa2, 0xc0, 0x15, 0x45, 0xcd, 0xb, 0x28, 0xe8, 0x1b, 0xcb, 0xb2, 0x9f, 0x24, 0x62, 0x3b, 0xf4, 0x3a}} + return a, nil +} + +var _cmdDefinitionsTmplOperationTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x54\x5d\x8b\x53\x31\x10\x7d\xcf\xaf\x18\x42\x1f\xee\x85\xb5\x7d\x17\xf6\x49\x57\x58\x90\xdd\xa2\x88\x8f\x92\xe6\x4e\xdb\x60\xf3\xe1\x64\xba\x1f\x5c\xf3\xdf\x25\xb9\x69\xf7\xb6\x54\x4b\x55\xc4\xb7\x4c\x92\x39\x67\xce\x99\x4c\x82\xd2\x5f\xd5\x0a\x81\x9f\x03\x46\x21\x8c\x0d\x9e\x18\x1a\x01\x00\x20\xb5\x77\x8c\x4f\x2c\x87\xc8\xf8\xba\x70\xc8\xb3\x35\x73\xa8\x21\x1b\x8b\x52\xb4\x42\xf4\xfd\x2b\x20\xe5\x56\x08\x93\x2f\x57\x30\x31\xf0\xfa\x1a\xa6\xb7\x8e\x91\x96\x4a\x63\x84\x94\x44\xdf\xc3\xc4\x4c\xdf\x62\xd4\x64\x02\x1b\xef\xf2\x66\xe6\x86\x7a\x62\x62\xd8\xa8\xe7\x3b\x65\x11\x52\x02\xb3\x4b\x86\xbe\x70\x65\x06\xb3\x04\x4f\xd0\xe0\xb7\x7c\xbf\x5c\x94\x11\xe9\xc1\x68\x24\xd9\x1e\xed\xb3\x27\xb5\xca\xfb\x29\x95\xfc\x8f\x4c\xc6\xad\x9a\x16\x62\x59\xec\x31\xd1\x75\xb9\x90\x1a\x8f\x45\xf8\x90\x55\x4c\xcc\xf4\x3e\x14\x01\xf9\xc6\x6c\x56\xaa\xf5\x61\xa0\xf9\x0e\xec\xe7\x2a\x6a\xb5\xc9\x25\xd7\x93\x23\x89\x15\xf8\x74\x4e\x53\x4f\xde\x79\xb2\x8a\xe7\x8a\x94\xcd\x5c\x2d\x1c\x1e\x7c\xc0\xb8\xdd\x70\xfc\x6c\x78\x3d\x1f\xba\x76\xa0\x52\xe6\x94\xb1\x4b\xce\x73\xc9\x7e\xef\x07\x9a\xb3\xb5\x67\xe4\x37\x43\xcb\x7f\x47\xc6\x28\xbd\xd1\xfc\x04\xf5\xf5\x4c\xeb\xde\xd5\x5f\x57\xb9\x6b\xdb\x61\x54\x42\xbb\x8d\x7c\x63\x17\xd8\x7d\x72\xc6\x86\x0d\x5a\x74\x8c\xdd\xa9\x37\xd6\xb4\x22\x09\x31\x9b\xc1\xd9\x9b\x05\x14\x16\x08\x98\x81\x3b\xec\x80\x3d\xac\xd5\x03\xc2\xd2\xd3\xa3\xa2\x0e\xb4\xb7\x41\xb1\x59\x6c\x10\xf6\x58\x2a\x7b\x17\xa7\xc3\x23\x3f\xcf\x11\x99\xb6\x9a\xa1\x4f\x42\x2c\xb7\x4e\x43\x13\xcf\x27\xb5\x17\xc9\xbd\x14\xfb\x68\x66\xea\x24\x12\xf2\x96\x1c\xc8\xb3\x00\x32\xdb\xfb\xeb\x99\xba\xa0\x98\x7f\x32\x44\x87\x9f\xcd\xc9\x31\x42\x22\xb8\x86\x3b\x7c\xbc\x0f\x48\xa5\xc5\x77\x9e\x6f\x5f\xaa\xbf\x21\xf2\xd4\xc8\x71\xb5\x29\xc9\xf6\xf8\xc3\x79\x71\x52\x24\xf1\x33\xbe\x0b\xec\xf9\x0f\x66\xb3\x9a\xf7\x27\x06\x8d\x1c\xd9\x19\x35\x5e\xed\xdd\xfb\x11\x00\x00\xff\xff\x15\xfc\x02\xfd\xbc\x06\x00\x00") + +func cmdDefinitionsTmplOperationTmplBytes() ([]byte, error) { + return bindataRead( + _cmdDefinitionsTmplOperationTmpl, + "cmd/definitions/tmpl/operation.tmpl", + ) +} + +func cmdDefinitionsTmplOperationTmpl() (*asset, error) { + bytes, err := cmdDefinitionsTmplOperationTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "cmd/definitions/tmpl/operation.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x66, 0xcb, 0x17, 0xca, 0x91, 0xbe, 0x2d, 0x99, 0xd5, 0x6e, 0x4, 0x8e, 0xfe, 0x6b, 0xf9, 0x3c, 0x3a, 0xf4, 0xfc, 0x3e, 0x84, 0xa3, 0x15, 0x2b, 0x27, 0x74, 0xa6, 0x9f, 0xc0, 0xd2, 0xe5, 0xc5}} + return a, nil +} + +var _cmdDefinitionsTmplServiceTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\xdf\x73\xdb\xb8\xf1\x7f\xd7\x5f\xb1\xc7\xf1\x7c\x47\xca\x28\xd4\xdd\xb7\x7d\xa9\x3b\x7e\x68\x9d\x34\xf5\xdc\xe5\xe2\x39\xa7\xed\x43\xee\xc6\x03\x93\x4b\x09\x15\x09\x30\x00\x24\x47\xa3\xf2\x7f\xef\xe0\x07\x7f\x0a\xa0\x29\x27\x77\xd7\x87\xf8\xc5\x14\xb0\xd8\x5d\xec\x8f\x0f\x77\x09\xac\x56\x70\xcd\x53\x84\x35\x32\x14\x44\x61\x0a\x0f\x07\x58\xf3\xe6\x37\xec\x29\x81\xa4\x48\x57\x29\x66\x94\x51\x45\x39\x93\x7f\x86\x57\xef\xe0\xc7\x77\xef\xe1\xf5\xab\x9b\xf7\xf1\xac\x24\xc9\x96\xac\x11\x8e\x47\x88\x7f\x24\x05\x42\x55\xcd\x66\xb4\x28\xb9\x50\x30\x9f\x01\x00\x44\x09\x67\x0a\x3f\xa9\xc8\xfe\xa2\xdc\x3d\x30\x54\xab\x8d\x52\xa5\xfb\xa9\x68\x81\xd1\xcc\x3c\xc7\x10\xad\xa9\xda\xec\x1e\xe2\x84\x17\xab\x07\x3c\x70\x96\x4a\xc5\x05\x59\xe3\x6a\xcd\x5f\xd6\x8f\xfb\x3f\xae\x4a\x42\x85\x74\x0c\xa6\x2e\xd9\xae\x8d\xd8\x24\xa7\xc8\xd4\x79\x6b\x25\x8a\x3d\x4d\xd0\x49\x9c\xae\xa6\x3a\x94\x7a\xd1\x62\x36\xdb\x13\x01\xf7\x70\x67\xa7\x84\xfb\x59\xb3\x8d\xef\xec\xc3\x6b\x21\x78\x3d\xd7\xaa\x1a\xbf\x2b\x8d\x03\xdc\x84\xb6\x57\xfc\x6a\x27\x88\x1e\xec\x10\xc7\x3f\xe1\xc7\x1d\x4a\xe5\x86\x2c\xaf\xd9\x6a\x05\xef\x0f\x25\x02\x95\xa0\x36\x08\x5a\x21\xc8\xb8\xe8\xb9\x2d\xe1\x4c\x2a\x4b\x76\x05\x51\x67\x26\x32\xeb\xdf\x3d\xfc\x1b\x13\x75\x77\x90\x0a\x8b\xb7\xa8\x48\x4a\x14\x01\xbd\x49\x94\x20\xcd\x28\x14\xf5\xb0\x66\xcd\x0d\x7d\x3c\x33\xb2\x02\x8b\xc5\x2e\x51\x70\x9c\x1d\x8f\x2f\x41\x10\xb6\x46\xb8\xb8\x5f\xc2\xc5\x1e\x2e\xaf\x20\xbe\x61\x19\x97\x5a\x2f\x6d\x6b\x4d\x41\x33\xc0\x8f\x70\xb1\x8f\xef\x12\x5e\x22\x44\x56\x40\x34\x20\x61\x5c\x69\x9a\x37\x39\x7f\x20\x79\x77\xee\xa2\x64\x7a\x3b\x97\x57\x7a\xda\xec\xec\x3f\xa0\xf8\x2d\x91\x49\x9f\x8e\x66\x9a\xe0\x15\x95\x65\x4e\x0e\xb5\x6d\xc0\xfd\x75\x18\x5d\x05\xc8\x34\x09\xb2\xb4\xfd\x69\xe8\x50\x26\x82\x1a\x07\x76\x27\x2c\xa7\xaa\x72\x54\xc6\xf6\x21\x36\xcd\xcf\xce\x63\x65\x3c\xf3\x06\x95\xd7\xbe\x8f\x34\xcf\x61\x8d\xca\x6f\xfd\x4c\xf0\xc2\xcd\xc4\xb3\xd5\x4a\x33\x7a\x09\xef\x37\x54\x42\xb6\x63\x89\xd1\x54\x6e\xf8\x2e\x4f\x8d\x49\x1f\x10\x12\x92\xe7\x16\x22\x5c\xc0\x02\x2d\xca\x1c\x0b\x64\x0a\x45\x5c\xaf\x47\x10\xa8\x76\x82\x51\xb6\xae\xe5\x5a\xea\x46\x30\x95\x20\x90\xa4\xc0\x59\x7e\x00\xc2\xd2\x81\x98\x82\xa7\x34\xa3\x98\xc6\x33\xad\x47\x68\x73\x73\x0e\x2f\xec\xf8\xc2\xbf\xbd\xa3\x31\x9b\x2c\x96\xc0\xb7\xda\xe9\x3c\x7e\x83\x43\x1e\x0b\x43\x43\x33\x4d\x72\x6c\x7c\x6c\xf5\x07\x59\xc4\x73\x1f\x67\xbb\xc8\x7a\xc5\x91\xfa\xc8\x8e\xb5\x77\xe4\x98\x77\x64\xc8\x3b\x94\x29\x3e\xcd\x3b\xc6\x8c\xad\x7b\x38\x4b\x70\x09\x65\x8e\x44\x22\x14\x64\x8b\x20\x77\x02\x81\xe4\x39\x18\xc6\x1b\x22\xe1\x01\x91\xc1\xa3\xa0\x4a\x21\x83\x07\xcc\xb8\x40\xad\x89\xb3\x78\x40\xe1\xd6\xe2\x4b\x90\x85\x57\xeb\x85\xb3\x22\x8f\xef\x4e\x6c\x2d\x8b\x85\x33\x88\x43\xbf\xe9\x48\xe2\x90\xd4\x0c\x3a\x3c\x09\xf1\xf8\x2c\x40\x71\x72\xa2\x61\xc2\x87\x50\xc5\x03\x0a\xa3\xe8\x32\xe0\x19\x46\x99\x33\xd0\xa6\x4b\xda\x81\x8b\x76\x38\x80\x3e\x5d\x82\x11\x14\x3a\x1f\x89\xfc\x9e\x69\xa0\xc8\x07\x42\x6e\xc9\x5b\xe3\xde\x36\xd6\xbb\x48\xe2\xe7\x7a\x36\x92\x78\xd9\xcc\x25\xbc\xe8\xa8\xb0\x08\x08\x1b\x02\x8a\x7c\x0e\xa0\x78\x59\x7b\x10\xc5\x4b\xd7\x85\x94\x11\x33\xcb\x53\x33\x1b\x34\x09\x98\xf9\x37\x82\x94\x29\xa6\x37\xc0\xe2\x37\x51\x6d\xfe\x30\xb2\x78\x73\xfe\x56\x17\x88\x75\xa8\xfa\xf2\x78\x4a\xee\xae\x56\xf0\x2f\xaa\x36\xbd\x54\x31\x96\x26\x65\x99\x1f\x5c\xd6\xb8\xa4\x84\x3d\xc9\x77\x08\x1a\xbc\x6d\xb9\x66\x4c\xed\x4d\xc3\x1e\x04\x99\xa4\x8b\x1e\x38\xcf\x0d\xfc\x18\xab\x0d\x85\xce\x17\xa0\xf7\x73\x1a\x59\x7a\xb4\x1d\xfc\x1e\x0f\x97\xa6\x7e\x6b\xb5\x8a\x96\xcd\xec\x3f\xb5\x7e\x97\xa0\xc4\x0e\x97\x2e\xee\x5c\x22\xe7\x12\xc3\xa2\xf7\x7d\x70\xf8\x82\x9a\xec\x07\x6a\x9c\x40\x4b\xe7\xd1\x14\xb5\xba\xe8\x7f\x4b\x4a\xb8\x82\x82\x94\x1f\xa4\x12\x94\xad\x7f\xb1\xff\x9c\x42\xe3\xa1\x70\x0e\x64\x0f\x94\x6f\x76\xe3\xcc\xe0\x76\xd3\xc7\x41\xaf\x74\xcd\x41\x96\x24\xc1\x9e\x0a\x0a\x8b\x32\xd7\x8d\x56\x44\x75\x11\x95\xe9\xf9\xc8\xa4\xd8\x5d\xae\x0b\xac\x5a\xf4\xc5\x3e\xbe\x69\x08\xfc\x0c\x32\x24\x6a\x27\x82\xcb\xff\xb6\x63\x89\x34\x0f\x8e\xce\xcf\x45\xdb\xf6\x9e\xe1\x63\x97\xcb\xdc\x67\x9f\x85\x19\xc4\xc7\x1e\x4b\x13\xe3\x19\xd9\xe5\x8a\x3c\xe4\x18\x96\x30\x50\xb2\xd5\xcf\xbf\x33\x87\x4e\xe3\x5b\x1b\x04\x8a\x7e\x36\x5d\xeb\xc0\xb6\x6d\xca\x6b\xb7\x50\x96\xe2\x27\x88\xe1\xdb\x66\xdc\xd0\xca\xee\xdc\x77\x7a\x4e\xc7\xdd\x3c\x18\x5b\xf5\x2a\xa7\xfe\x7d\x17\x12\x7a\x31\x05\x57\xf0\x7f\x36\xad\xfa\xe3\xc7\x93\x57\xeb\x22\xb8\x9b\xd6\xd1\xa1\xbd\xf4\xc3\xd8\x90\x64\xec\x74\x4f\x76\xa2\x37\xfe\xff\x46\x9a\xa9\xb0\x9c\x9a\x55\xd5\x78\xb7\xa9\xae\x82\x66\xc8\xe4\xa4\xae\xc7\x6b\x19\x0d\x7d\xa7\xc9\x14\x32\x42\x1b\xa7\x4f\x39\x34\x63\x81\x8d\x67\x27\x1b\x37\xe3\x69\xd9\x1d\xff\x43\x23\xf9\x22\x63\x5b\xbb\x49\xe6\x03\x0b\xfd\x92\xd0\x4a\x35\x66\xd3\x0f\x7a\x49\x55\xd5\x4d\x77\x49\x84\xc4\xd4\x99\xd1\x1a\x79\xb0\x42\x2f\xa8\xaa\xbe\xa1\x4d\xbe\xc0\x87\x5f\x34\x7c\xd9\xcf\x23\xab\x15\xe8\x1e\x9f\x0a\x4c\xed\xac\xcf\x21\x7a\xa2\x56\xb7\xa1\x76\x3e\xf8\x3b\x91\x46\x28\xa1\xc2\xe7\x09\xe8\xfa\x62\x8c\xac\x9d\x1e\x69\x5c\x57\x2b\xf7\x26\x24\xf9\x34\x6d\x1b\xea\x2f\xad\xed\x64\x7d\x5f\x33\x03\x5f\x75\xa2\x8d\x2b\x9c\xd5\x0b\x37\x44\xda\x85\x63\x6a\x34\xba\x3e\x4d\xda\xdf\xd9\x50\x47\x87\xb3\x23\x26\x35\xf1\xad\xc3\xb9\xd5\xcf\x2d\x32\x52\x33\xf3\x42\x1c\xd5\x71\x1a\x79\x6d\x57\x47\x11\x30\x6d\x9d\x21\x42\xe2\x6d\x20\x4d\x4c\x49\x65\x28\x6c\x71\x21\x0d\xd0\x9b\xd2\xf5\x45\x20\xb5\x6c\xb1\x32\xc6\x75\xce\x4b\x55\xa7\xcf\x02\xe6\x01\x3e\x4b\x40\x21\xb8\xa8\xab\x4c\x81\x52\xdb\xf6\xf2\x2a\x94\xd2\x6d\x89\x63\xec\x7f\x09\x5a\x4a\x5d\xc7\x98\x7f\xba\x6f\xbd\x5f\x82\xc1\x45\xeb\x15\xa3\x48\xbb\x50\x3e\x52\x95\x6c\x60\x1f\x7f\x8f\x87\xce\xb0\x3f\xb9\xcf\x4c\x70\xfd\x97\xe8\x62\x3d\xea\x07\x98\xae\x60\x7a\xdd\x1f\xcd\xdc\x5e\xe3\x27\xb2\xec\x78\xd2\x9b\x26\x9c\x29\xca\x76\xd8\x9b\xe8\xf7\x96\xd3\x58\x5f\x99\x5a\xd4\xb7\x70\x7c\xd5\x3e\x36\x05\x64\x3c\x1f\x66\xf5\x22\xd4\xb9\x86\xe1\xe8\x4c\x48\xfa\x6a\xdf\x31\xfb\xfa\xe0\x73\xd4\xc0\xd9\xa9\x5d\xd1\xf0\xb8\x9f\x6c\xde\x49\xe0\xfb\x39\x46\x9e\x24\x20\x6c\xea\xb3\xd7\xfa\x4d\x7b\x8a\xfa\x3e\xc3\x0e\x91\xbf\x35\x6b\x6a\xd7\xdf\x9f\x40\xfa\xb8\x69\xa7\xbd\x08\x3e\xd3\xbc\xd3\x84\x84\x4d\x3c\x75\x7d\x3f\xae\xfb\x6f\xad\xd1\xd0\xae\xba\xf8\xfe\xec\x32\xe1\xd9\x31\x3b\xc8\xf6\x5e\x69\x3e\xb0\x4a\x37\xbf\xbb\x74\x4f\x64\x7c\xc3\xe3\xe4\xed\xfd\xfc\xaa\xe3\xb3\xe2\xa8\xdd\x72\x77\xa5\xde\x91\x6d\xe6\x3d\x39\xd3\xd1\x85\x9b\x4a\x5e\x4b\xea\x35\x97\x81\x90\x69\xb8\x1a\x23\xf1\xf2\xc4\x3a\xa4\x2c\x91\xa5\xf3\xb3\x97\x2e\xdb\x8f\x29\xc1\x3d\xfb\xb8\x06\x89\x17\xc1\x28\xf5\xfb\xed\x78\x9c\x5a\x37\xd0\x0c\xbe\x39\xf7\x7d\xe5\x3e\xfc\x84\x0a\xa5\x6a\xd9\x1e\x6f\xea\xfd\xd4\x22\xcd\xb9\xe4\x11\xbe\xc7\x83\xbc\xfc\xe0\xbe\xde\x1c\x3d\xef\x53\xa8\x60\x6c\x6f\x4e\xba\x55\x7a\x09\x8c\xe6\x4f\x34\x8d\x13\x3e\x01\x98\x6f\x9a\xc3\x9e\xb1\x5e\x62\x7b\xc0\x32\xd8\x03\xf6\xe2\x62\xdb\x44\x2a\x95\x90\x76\x73\xc7\x9e\x6b\x94\x98\xd0\x8c\x26\x40\xcc\xf7\x0d\xdb\x12\x06\x18\x8c\x1e\x6d\x58\x95\x9f\xea\xb0\x5d\x0f\xd9\x2f\xca\x3d\x79\x73\xca\x12\xbc\x5f\x71\x7a\x9f\x63\x4a\x06\x17\xfb\xd1\x13\x82\x13\x57\x3c\xab\x77\x9f\xe2\x87\xb3\xdb\xf5\xed\xf9\xfd\xfa\x60\xc9\x13\x2d\xfb\xef\xd1\x9c\x4f\x6b\x77\xff\x37\x1b\x71\x6f\xb7\xb8\x7d\x4e\xbb\xb8\xf5\xf4\x8b\x73\x09\x2f\xda\xd9\xc5\xa8\x98\x60\xff\xb8\x3d\xb7\x81\xdc\xfe\x46\x1d\xe4\xd7\x3e\xf1\xec\x3e\xc6\xab\xa7\xa7\x02\xfc\xda\x22\xfe\x6a\xa6\x75\x6f\xc7\xbe\x6d\xea\x83\xf2\x92\xe9\x1d\xb8\x2a\xf6\x07\xce\x6d\xba\x0e\x8f\xb2\x57\x2b\xc8\xf5\xdc\xbd\xf1\x8b\x2b\xcb\x35\x20\x08\x9e\xee\x12\x4c\x81\x32\x78\x73\x77\xfb\xf2\xbb\x6f\xff\x14\x0f\x17\xde\x64\xb0\x93\x28\xc0\xf6\x9d\xa0\xcc\xa9\xa8\xe5\xd0\x14\x30\xf5\xe9\x28\x5d\x33\x2e\xd0\x1c\x25\xca\x5d\x69\x6e\xba\x19\x89\x06\x01\xe2\xa1\x73\x65\x5c\x37\x08\x71\xab\xf9\xb3\x7c\x19\x38\xe2\x3f\x29\xc0\xb6\xe3\x15\xd8\x3f\x98\xd3\xba\x2e\xc2\xf4\xe0\xe5\x3e\xdc\xe7\x5c\x6f\x30\xd9\x82\xe8\x7d\x95\x8a\xcf\x7d\xad\x7d\x91\xd2\xf2\x89\x9d\xfd\x9e\xb5\x65\xe7\x90\xaa\x7f\xc4\x38\x76\x34\xd3\x90\xf9\x4b\x4e\x8f\x89\xc3\xb5\x99\xbd\x50\xf2\x03\x1f\xdc\x37\xe9\x97\x6d\xb9\x9e\xbe\xaf\x75\x0d\x16\x70\x8d\x35\xdc\x91\xb0\x9f\xd9\x74\x36\x4f\x5d\x1e\xf1\x5a\xf2\xb9\xe5\xe1\x94\xd2\xaf\x53\x46\xd8\xc7\xe1\x51\x95\xbd\x1e\xd1\xbf\x1c\x61\x0a\x8e\x44\xa0\xde\x3c\x01\x77\xab\x15\x1e\x0e\x35\x76\xc5\xdd\xea\xe2\xa2\x64\x55\xb5\xe8\x08\x9a\x9b\xe3\x9d\xf8\x96\x08\x52\xc8\xf8\xce\x04\xa5\xa6\x70\xe3\x3f\x99\x28\xeb\x4e\xd8\x3c\x48\xd4\x27\xbd\x17\x27\x2d\xfe\x2b\x49\xb6\x6b\xc1\x77\x2c\x75\x77\x4d\xea\xbb\x25\x71\x2b\x49\xb7\x9b\xd7\x96\x7e\x9e\xa8\x4f\x4b\xe8\x49\xbe\x26\x79\x8e\x42\x43\xf4\xd0\x14\x9d\x75\x01\xab\x8c\xed\x6f\x20\xb5\xd1\xd8\x8d\x0d\xb4\x98\xbc\xff\x14\x33\x14\xc6\x07\xf3\x45\xbf\xc6\xb9\x28\x89\xda\xd4\x7e\x76\x6c\x6f\x89\xda\xd8\x0d\x7a\xd2\x83\xb0\x14\xe6\xf8\xd1\x2d\x8c\xa2\x85\xfb\xc5\x20\x72\x57\x14\xa3\x85\xf7\x7a\x94\x26\xbf\x82\x68\xf9\x73\xf4\x73\x74\x72\x39\x6c\x80\xc8\x28\x04\x5c\x69\xd0\xe7\xa2\x20\xca\x20\xd1\x3c\xb2\x5b\xd4\xb1\x58\x55\x91\x29\x15\x5b\xc6\x55\x05\xee\xfe\xcf\x7c\xd1\xa6\x3c\xcd\x80\xa1\x2d\x2c\xcc\x3d\xbb\xb7\x3c\x45\x88\xfa\xd8\x52\xe8\xb1\xba\xfc\x68\xa9\x4e\x21\x46\x63\x2f\x8f\xf5\x64\x7c\x63\xa0\xd7\xac\x34\xf7\x49\x8e\x43\xc5\x6b\x3c\x6d\x19\xde\xb0\x3d\xc9\xa9\x03\xd5\xd7\x9f\x4a\x4c\x14\xa6\x97\xa0\xa7\x3a\xbc\x96\xf0\x97\x44\xed\x48\x7e\x09\x56\x52\x35\x40\xf1\x11\x9c\x2d\xdd\xb7\x1c\xf7\x81\xc5\xfc\x5c\x82\x8c\x5d\x5a\xb5\x5f\x56\x6c\xa0\xc5\x71\x6c\x0d\xb6\x27\x42\x97\xc4\xa1\x4f\x0f\x96\x39\x2f\xd5\xb2\x71\xca\xe8\x41\x91\x91\xdb\x5c\xe0\xd2\x4b\xbe\xb9\xd2\xa0\x7f\xf2\x42\xea\xbe\x1e\x07\xe9\xd7\xe2\xcd\x35\x29\xd0\x7c\xd9\x39\xcd\xc0\xf7\x82\x16\x3f\x10\xa9\x5c\x2a\xbe\x66\xa9\xae\xe4\x37\xd7\xbc\x28\x48\x55\x69\x8d\x17\x23\x2f\x9a\x21\x84\x8f\xbd\x6d\xba\x73\x3e\xb0\xac\x23\xfc\x09\xc0\x74\x75\xc0\x93\xa0\x69\xe9\x6a\xf2\x73\xc1\x53\x2f\xfb\x15\x00\xf4\x73\x22\x6c\x72\x94\xb9\x2d\xdf\xd8\xca\xd0\x14\x82\xf0\xb8\xa1\x39\xc2\x86\xb0\x34\xa7\x6c\x0d\xc6\x6f\x7a\x83\xee\x56\x58\xbd\xcc\x04\xe8\xfd\xe4\xf0\x1c\x16\x47\x46\xef\x40\xe8\x9d\x1d\x75\x36\xb0\xbb\x91\x67\x1c\x42\x19\x55\x0d\x56\x4c\xbc\xdd\xa4\xff\x1a\x30\xf9\x09\xd7\x54\x2a\x14\xa1\x4f\x53\x62\xae\xfb\x86\x25\xfc\x88\x8f\x41\x92\x85\xef\xeb\xc5\x89\x84\xbb\x64\x83\x05\x71\xec\xdc\x45\x31\x9d\x4d\xff\x0d\x00\x00\xff\xff\xf9\xfa\xc3\x3f\xea\x32\x00\x00") + +func cmdDefinitionsTmplServiceTmplBytes() ([]byte, error) { + return bindataRead( + _cmdDefinitionsTmplServiceTmpl, + "cmd/definitions/tmpl/service.tmpl", + ) +} + +func cmdDefinitionsTmplServiceTmpl() (*asset, error) { + bytes, err := cmdDefinitionsTmplServiceTmplBytes() + if err != nil { + return nil, err + } + + 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{0xf9, 0x38, 0x7, 0x48, 0xc1, 0x89, 0x2, 0x17, 0x3b, 0xe2, 0x4f, 0x8a, 0xb7, 0xb6, 0x40, 0x21, 0xac, 0x6, 0xa7, 0xc9, 0xe8, 0xee, 0x99, 0x5b, 0xe8, 0x17, 0x17, 0x19, 0x7, 0x66, 0x42, 0xed}} + return a, nil +} + +// Asset loads and returns the asset for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func Asset(name string) ([]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) + } + return a.bytes, nil + } + return nil, fmt.Errorf("Asset %s not found", name) +} + +// AssetString returns the asset contents as a string (instead of a []byte). +func AssetString(name string) (string, error) { + data, err := Asset(name) + return string(data), err +} + +// MustAsset is like Asset but panics when Asset would return an error. +// It simplifies safe initialization of global variables. +func MustAsset(name string) []byte { + a, err := Asset(name) + if err != nil { + panic("asset: Asset(" + name + "): " + err.Error()) + } + + return a +} + +// MustAssetString is like AssetString but panics when Asset would return an +// error. It simplifies safe initialization of global variables. +func MustAssetString(name string) string { + return string(MustAsset(name)) +} + +// AssetInfo loads and returns the asset info for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func AssetInfo(name string) (os.FileInfo, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) + } + return a.info, nil + } + return nil, fmt.Errorf("AssetInfo %s not found", name) +} + +// AssetDigest returns the digest of the file with the given name. It returns an +// error if the asset could not be found or the digest could not be loaded. +func AssetDigest(name string) ([sha256.Size]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) + } + return a.digest, nil + } + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) +} + +// Digests returns a map of all known files and their checksums. +func Digests() (map[string][sha256.Size]byte, error) { + mp := make(map[string][sha256.Size]byte, len(_bindata)) + for name := range _bindata { + a, err := _bindata[name]() + if err != nil { + return nil, err + } + mp[name] = a.digest + } + return mp, nil +} + +// AssetNames returns the names of the assets. +func AssetNames() []string { + names := make([]string, 0, len(_bindata)) + for name := range _bindata { + names = append(names, name) + } + return names +} + +// _bindata is a table, holding each asset generator, mapped to its name. +var _bindata = map[string]func() (*asset, error){ + "definitions/features.toml": definitionsFeaturesToml, + "definitions/fields.toml": definitionsFieldsToml, + "definitions/info_object_meta.toml": definitionsInfo_object_metaToml, + "definitions/info_storage_meta.toml": definitionsInfo_storage_metaToml, + "definitions/operations.toml": definitionsOperationsToml, + "definitions/pairs.toml": definitionsPairsToml, + "cmd/definitions/tmpl/function.tmpl": cmdDefinitionsTmplFunctionTmpl, + "cmd/definitions/tmpl/info.tmpl": cmdDefinitionsTmplInfoTmpl, + "cmd/definitions/tmpl/object.tmpl": cmdDefinitionsTmplObjectTmpl, + "cmd/definitions/tmpl/operation.tmpl": cmdDefinitionsTmplOperationTmpl, + "cmd/definitions/tmpl/service.tmpl": cmdDefinitionsTmplServiceTmpl, +} + +// AssetDebug is true if the assets were built with the debug flag enabled. +const AssetDebug = false + +// AssetDir returns the file names below a certain +// directory embedded in the file by go-bindata. +// For example if you run go-bindata on data/... and data contains the +// following hierarchy: +// data/ +// foo.txt +// img/ +// a.png +// b.png +// then AssetDir("data") would return []string{"foo.txt", "img"}, +// AssetDir("data/img") would return []string{"a.png", "b.png"}, +// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and +// AssetDir("") will return []string{"data"}. +func AssetDir(name string) ([]string, error) { + node := _bintree + if len(name) != 0 { + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") + for _, p := range pathList { + node = node.Children[p] + if node == nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + } + } + if node.Func != nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + rv := make([]string, 0, len(node.Children)) + for childName := range node.Children { + rv = append(rv, childName) + } + return rv, nil +} + +type bintree struct { + Func func() (*asset, error) + Children map[string]*bintree +} + +var _bintree = &bintree{nil, map[string]*bintree{ + "cmd": {nil, map[string]*bintree{ + "definitions": {nil, map[string]*bintree{ + "tmpl": {nil, map[string]*bintree{ + "function.tmpl": {cmdDefinitionsTmplFunctionTmpl, map[string]*bintree{}}, + "info.tmpl": {cmdDefinitionsTmplInfoTmpl, map[string]*bintree{}}, + "object.tmpl": {cmdDefinitionsTmplObjectTmpl, map[string]*bintree{}}, + "operation.tmpl": {cmdDefinitionsTmplOperationTmpl, map[string]*bintree{}}, + "service.tmpl": {cmdDefinitionsTmplServiceTmpl, map[string]*bintree{}}, + }}, + }}, + }}, + "definitions": {nil, map[string]*bintree{ + "features.toml": {definitionsFeaturesToml, map[string]*bintree{}}, + "fields.toml": {definitionsFieldsToml, map[string]*bintree{}}, + "info_object_meta.toml": {definitionsInfo_object_metaToml, map[string]*bintree{}}, + "info_storage_meta.toml": {definitionsInfo_storage_metaToml, map[string]*bintree{}}, + "operations.toml": {definitionsOperationsToml, map[string]*bintree{}}, + "pairs.toml": {definitionsPairsToml, map[string]*bintree{}}, + }}, +}} + +// RestoreAsset restores an asset under the given directory. +func RestoreAsset(dir, name string) error { + data, err := Asset(name) + if err != nil { + return err + } + info, err := AssetInfo(name) + if err != nil { + return err + } + err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) + if err != nil { + return err + } + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + if err != nil { + return err + } + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) +} + +// RestoreAssets restores an asset under the given directory recursively. +func RestoreAssets(dir, name string) error { + children, err := AssetDir(name) + // File + if err != nil { + return RestoreAsset(dir, name) + } + // Dir + for _, child := range children { + err = RestoreAssets(dir, filepath.Join(name, child)) + if err != nil { + return err + } + } + return nil +} + +func _filePath(dir, name string) string { + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) +} diff --git a/cmd/definitions/generate.go b/cmd/definitions/generate.go index 5ed02219c..fb8011629 100644 --- a/cmd/definitions/generate.go +++ b/cmd/definitions/generate.go @@ -81,6 +81,27 @@ func generatePair(data *Data, path string) { return r }), ) + if v.Defaultable { + name := "default_" + v.Name + pname := templateutils.ToPascal(name) + + xfn := f.Function("With" + pname) + + xfn.CommentF(`With%s will apply %s value to Options. + +%s %s`, pname, name, pname, v.originalDescription) + xfn.Parameter("v", v.Type()) + xfn.Result("p", "Pair") + xfn.Body( + gg.Embed(func() gg.Node { + r := gg.Return() + r.Value("Pair"). + Field("Key", gg.Lit(name).String()). + Field("Value", "v") + return r + }), + ) + } } err := f.WriteFile(path) diff --git a/cmd/definitions/tmpl/pair.tmpl b/cmd/definitions/tmpl/pair.tmpl deleted file mode 100644 index cea56125b..000000000 --- a/cmd/definitions/tmpl/pair.tmpl +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by go generate cmd/definitions; DO NOT EDIT. -package pairs - -import ( - "context" - "time" - - "github.com/beyondstorage/go-storage/v4/pkg/httpclient" - . "github.com/beyondstorage/go-storage/v4/types" - -) - -{{- range $_, $v := .Pairs }} -{{- $pname := $v.Name | toPascal }} -// With{{ $pname }} will apply {{ $v.Name }} value to Options. -// -{{ $v.Description }} -func With{{ $pname }}(v {{ $v.Type }}) Pair { - return Pair{ - Key: "{{ $v.Name }}", - Value: v, - } -} - -{{ if $v.Defaultable }} -// WithDefault{{ $pname }} will apply default_{{ $v.Name }} value to Options. -// -{{ $v.Description }} -func WithDefault{{ $pname }}(v {{ $v.Type }}) Pair { - return Pair{ - Key: "default_{{ $v.Name }}", - Value: v, - } -} -{{- end }} -{{- end }} diff --git a/cmd/definitions/type.go b/cmd/definitions/type.go index a26a2901d..8411eb94d 100644 --- a/cmd/definitions/type.go +++ b/cmd/definitions/type.go @@ -482,14 +482,6 @@ func (d *Data) FormatPairs(p specs.Pairs, global bool) map[string]*Pair { pair.Format(v, global) m[pair.Name] = pair - - if pair.Defaultable { - defaultName := fmt.Sprintf("default_%s", pair.Name) - defaultPair := &(*pair) - defaultPair.Name = defaultName - defaultPair.Defaultable = false - m[defaultName] = defaultPair - } } return m } diff --git a/pairs/generated.go b/pairs/generated.go new file mode 100644 index 000000000..f18d60191 --- /dev/null +++ b/pairs/generated.go @@ -0,0 +1,156 @@ +// Code generated by go generate cmd/definitions; DO NOT EDIT. + +package pairs + +import ( + "context" + "time" + + "github.com/beyondstorage/go-storage/v4/pkg/httpclient" + . "github.com/beyondstorage/go-storage/v4/types" +) + +// WithContentMd5 will apply content_md5 value to Options. +// +// ContentMd5 +func WithContentMd5(v string) (p Pair) { + return Pair{Key: "content_md5", Value: v} +} + +// WithContentType will apply content_type value to Options. +// +// ContentType +func WithContentType(v string) (p Pair) { + return Pair{Key: "content_type", Value: v} +} + +// WithDefaultContentType will apply default_content_type value to Options. +// +// DefaultContentType +func WithDefaultContentType(v string) (p Pair) { + return Pair{Key: "default_content_type", Value: v} +} + +// WithContext will apply context value to Options. +// +// Context +func WithContext(v context.Context) (p Pair) { + return Pair{Key: "context", Value: v} +} + +// WithContinuationToken will apply continuation_token value to Options. +// +// ContinuationToken specify the continuation token for list +func WithContinuationToken(v string) (p Pair) { + return Pair{Key: "continuation_token", Value: v} +} + +// WithCredential will apply credential value to Options. +// +// Credential specify how to provide credential for service or storage +func WithCredential(v string) (p Pair) { + return Pair{Key: "credential", Value: v} +} + +// WithEndpoint will apply endpoint value to Options. +// +// Endpoint specify how to provide endpoint for service or storage +func WithEndpoint(v string) (p Pair) { + return Pair{Key: "endpoint", Value: v} +} + +// WithExpire will apply expire value to Options. +// +// Expire specify when the url returned by reach will expire. +// +// Deprecated: Use `QuerySignHTTPRead` instead of `Reach` and `expire` is the declared argument. +func WithExpire(v time.Duration) (p Pair) { + return Pair{Key: "expire", Value: v} +} + +// WithHTTPClientOptions will apply http_client_options value to Options. +// +// HTTPClientOptions +func WithHTTPClientOptions(v *httpclient.Options) (p Pair) { + return Pair{Key: "http_client_options", Value: v} +} + +// WithInterceptor will apply interceptor value to Options. +// +// Interceptor +func WithInterceptor(v Interceptor) (p Pair) { + return Pair{Key: "interceptor", Value: v} +} + +// WithIoCallback will apply io_callback value to Options. +// +// IoCallback specify what todo every time we read data from source +func WithIoCallback(v func([]byte)) (p Pair) { + return Pair{Key: "io_callback", Value: v} +} + +// WithDefaultIoCallback will apply default_io_callback value to Options. +// +// DefaultIoCallback specify what todo every time we read data from source +func WithDefaultIoCallback(v func([]byte)) (p Pair) { + return Pair{Key: "default_io_callback", Value: v} +} + +// WithListMode will apply list_mode value to Options. +// +// ListMode +func WithListMode(v ListMode) (p Pair) { + return Pair{Key: "list_mode", Value: v} +} + +// WithLocation will apply location value to Options. +// +// Location specify the location for service or storage +func WithLocation(v string) (p Pair) { + return Pair{Key: "location", Value: v} +} + +// WithMultipartID will apply multipart_id value to Options. +// +// MultipartID +func WithMultipartID(v string) (p Pair) { + return Pair{Key: "multipart_id", Value: v} +} + +// WithName will apply name value to Options. +// +// Name specify the storage name +func WithName(v string) (p Pair) { + return Pair{Key: "name", Value: v} +} + +// WithObjectMode will apply object_mode value to Options. +// +// ObjectMode ObjectMode hint +func WithObjectMode(v ObjectMode) (p Pair) { + return Pair{Key: "object_mode", Value: v} +} + +// WithOffset will apply offset value to Options. +// +// Offset specify offset for this request, storage will seek to this offset before read +func WithOffset(v int64) (p Pair) { + return Pair{Key: "offset", Value: v} +} + +// WithSize will apply size value to Options. +// +// Size specify size for this request, storage will only read limited content data +func WithSize(v int64) (p Pair) { + return Pair{Key: "size", Value: v} +} + +// WithWorkDir will apply work_dir value to Options. +// +// WorkDir specify the work dir for service or storage, every operation will be relative to this dir. +// work_dir MUST start with / for every storage services. +// work_dir will be default to / if not set. +// For fs storage service on windows platform, the behavior is undefined. +func WithWorkDir(v string) (p Pair) { + return Pair{Key: "work_dir", Value: v} +} From 42a3ab963e21ac3e1087cd8b41b19388081b98ee Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 3 Sep 2021 10:29:59 +0800 Subject: [PATCH 6/6] Bump version about gg Signed-off-by: Xuanwo --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 76c21a819..f24ebdfe1 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/beyondstorage/go-storage/v4 go 1.15 require ( - github.com/Xuanwo/gg v0.0.0-20210903012417-03a447370afa + github.com/Xuanwo/gg v0.0.1 github.com/Xuanwo/templateutils v0.1.0 github.com/dave/dst v0.26.2 github.com/golang/mock v1.6.0 diff --git a/go.sum b/go.sum index cbbaa40bd..727a0ed3d 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Xuanwo/gg v0.0.0-20210903012417-03a447370afa h1:N5OBLTnGC2p9gJaFkn5ptgdZcwQXnsWPVFemnVnz66M= -github.com/Xuanwo/gg v0.0.0-20210903012417-03a447370afa/go.mod h1:TjGrC5F6B9H//RFhXGxv/znfrz0uRq46gZdZ0f0bvVQ= +github.com/Xuanwo/gg v0.0.1 h1:SefvV3pdOV8sovx6CSzKwNsqvUwQZbKQCtN2UOPLfyk= +github.com/Xuanwo/gg v0.0.1/go.mod h1:TjGrC5F6B9H//RFhXGxv/znfrz0uRq46gZdZ0f0bvVQ= github.com/Xuanwo/go-bufferpool v0.2.0 h1:DXzqJD9lJufXbT/03GrcEvYOs4gXYUj9/g5yi6Q9rUw= github.com/Xuanwo/go-bufferpool v0.2.0/go.mod h1:Mle++9GGouhOwGj52i9PJLNAPmW2nb8PWBP7JJzNCzk= github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY=