buildV1GetGraphRequest builds a v1-format GetGraph request with ResourceRef directly. v1 GetGraphRequest: field 1 = repeated ResourceRef { name = 2; Name { owner=1; module=2 } } (no GetGraphRequest_ResourceRef wrapper)
(owner, module string)
| 191 | // v1 GetGraphRequest: field 1 = repeated ResourceRef { name = 2; Name { owner=1; module=2 } } |
| 192 | // (no GetGraphRequest_ResourceRef wrapper) |
| 193 | func buildV1GetGraphRequest(owner, module string) []byte { |
| 194 | var name []byte |
| 195 | name = protowire.AppendTag(name, 1, protowire.BytesType) |
| 196 | name = protowire.AppendString(name, owner) |
| 197 | name = protowire.AppendTag(name, 2, protowire.BytesType) |
| 198 | name = protowire.AppendString(name, module) |
| 199 | |
| 200 | var resRef []byte |
| 201 | resRef = protowire.AppendTag(resRef, 2, protowire.BytesType) |
| 202 | resRef = append(resRef, protowire.AppendVarint(nil, uint64(len(name)))...) |
| 203 | resRef = append(resRef, name...) |
| 204 | |
| 205 | var req []byte |
| 206 | req = protowire.AppendTag(req, 1, protowire.BytesType) |
| 207 | req = append(req, protowire.AppendVarint(nil, uint64(len(resRef)))...) |
| 208 | req = append(req, resRef...) |
| 209 | return req |
| 210 | } |
| 211 | |
| 212 | // buildDownloadRequest builds a protobuf-encoded Download request using a commit ID. |
| 213 | func buildDownloadRequest(commitID string) []byte { |
no outgoing calls
no test coverage detected