MCPcopy
hub / github.com/git-lfs/git-lfs / sendMessage

Method sendMessage

tq/custom.go:179–189  ·  view source on GitHub ↗

sendMessage sends a JSON message to the custom adapter process

(ctx *customAdapterWorkerContext, req interface{})

Source from the content-addressed store, hash-verified

177
178// sendMessage sends a JSON message to the custom adapter process
179func (a *customAdapter) sendMessage(ctx *customAdapterWorkerContext, req interface{}) error {
180 b, err := json.Marshal(req)
181 if err != nil {
182 return err
183 }
184 a.Trace("xfer: Custom adapter worker %d sending message: %v", ctx.workerNum, string(b))
185 // Line oriented JSON
186 b = append(b, '\n')
187 _, err = ctx.stdin.Write(b)
188 return err
189}
190
191func (a *customAdapter) readResponse(ctx *customAdapterWorkerContext) (*customAdapterResponseMessage, error) {
192 line, err := ctx.bufferedOut.ReadString('\n')

Callers 3

exchangeMessageMethod · 0.95
shutdownWorkerProcessMethod · 0.95
DoTransferMethod · 0.95

Calls 2

TraceMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected