MCPcopy Create free account
hub / github.com/coder/coder / Parse

Method Parse

provisioner/echo/serve.go:190–206  ·  view source on GitHub ↗

Parse reads requests from the provided directory to stream responses.

(sess *provisionersdk.Session, _ *proto.ParseRequest, _ <-chan struct{})

Source from the content-addressed store, hash-verified

188
189// Parse reads requests from the provided directory to stream responses.
190func (*echo) Parse(sess *provisionersdk.Session, _ *proto.ParseRequest, _ <-chan struct{}) *proto.ParseComplete {
191 responses, err := readResponses(sess, "unspecified", "parse.protobuf")
192 if err != nil {
193 return &proto.ParseComplete{Error: err.Error()}
194 }
195 for _, response := range responses {
196 if log := response.GetLog(); log != nil {
197 sess.ProvisionLog(log.Level, log.Output)
198 }
199 if complete := response.GetParse(); complete != nil {
200 return complete
201 }
202 }
203
204 // if we didn't get a complete from the filesystem, that's an error
205 return provisionersdk.ParseErrorf("complete response missing")
206}
207
208func (*echo) Init(sess *provisionersdk.Session, req *provisionersdk.InitRequest, canceledOrComplete <-chan struct{}) *proto.InitComplete {
209 err := sess.Files.ExtractArchive(sess.Context(), sess.Logger, afero.NewOsFs(), req.TemplateSourceArchive, nil)

Callers

nothing calls this directly

Calls 6

ParseErrorfFunction · 0.92
readResponsesFunction · 0.85
ProvisionLogMethod · 0.65
ErrorMethod · 0.45
GetLogMethod · 0.45
GetParseMethod · 0.45

Tested by

no test coverage detected