MCPcopy Create free account
hub / github.com/easyp-tech/server / buildV1GetGraphRequest

Function buildV1GetGraphRequest

internal/connect/api_test.go:193–210  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

191// v1 GetGraphRequest: field 1 = repeated ResourceRef { name = 2; Name { owner=1; module=2 } }
192// (no GetGraphRequest_ResourceRef wrapper)
193func 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.
213func buildDownloadRequest(commitID string) []byte {

Calls

no outgoing calls

Tested by

no test coverage detected