ListConfigWithContext is the proxy function for the method defined in the tars file, with the context
(tarsCtx context.Context, app string, server string, vf *[]string, opts ...map[string]string)
| 85 | |
| 86 | // ListConfigWithContext is the proxy function for the method defined in the tars file, with the context |
| 87 | func (obj *Config) ListConfigWithContext(tarsCtx context.Context, app string, server string, vf *[]string, opts ...map[string]string) (ret int32, err error) { |
| 88 | var ( |
| 89 | length int32 |
| 90 | have bool |
| 91 | ty byte |
| 92 | ) |
| 93 | buf := codec.NewBuffer() |
| 94 | err = buf.WriteString(app, 1) |
| 95 | if err != nil { |
| 96 | return ret, err |
| 97 | } |
| 98 | |
| 99 | err = buf.WriteString(server, 2) |
| 100 | if err != nil { |
| 101 | return ret, err |
| 102 | } |
| 103 | |
| 104 | err = buf.WriteHead(codec.LIST, 3) |
| 105 | if err != nil { |
| 106 | return ret, err |
| 107 | } |
| 108 | err = buf.WriteInt32(int32(len(*vf)), 0) |
| 109 | if err != nil { |
| 110 | return ret, err |
| 111 | } |
| 112 | for _, v := range *vf { |
| 113 | err = buf.WriteString(v, 0) |
| 114 | if err != nil { |
| 115 | return ret, err |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | var statusMap map[string]string |
| 120 | var contextMap map[string]string |
| 121 | if len(opts) == 1 { |
| 122 | contextMap = opts[0] |
| 123 | } else if len(opts) == 2 { |
| 124 | contextMap = opts[0] |
| 125 | statusMap = opts[1] |
| 126 | } |
| 127 | |
| 128 | tarsResp := new(requestf.ResponsePacket) |
| 129 | err = obj.servant.TarsInvoke(tarsCtx, 0, "ListConfig", buf.ToBytes(), statusMap, contextMap, tarsResp) |
| 130 | if err != nil { |
| 131 | return ret, err |
| 132 | } |
| 133 | readBuf := codec.NewReader(tools.Int8ToByte(tarsResp.SBuffer)) |
| 134 | err = readBuf.ReadInt32(&ret, 0, true) |
| 135 | if err != nil { |
| 136 | return ret, err |
| 137 | } |
| 138 | |
| 139 | _, ty, err = readBuf.SkipToNoCheck(3, true) |
| 140 | if err != nil { |
| 141 | return ret, err |
| 142 | } |
| 143 | if ty == codec.LIST { |
| 144 | err = readBuf.ReadInt32(&length, 0, true) |
no test coverage detected