MCPcopy Index your code
hub / github.com/jetify-com/devbox / LoadConfigFromURL

Function LoadConfigFromURL

internal/devconfig/config.go:198–214  ·  view source on GitHub ↗
(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

196}
197
198func LoadConfigFromURL(ctx context.Context, url string) (*Config, error) {
199 req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
200 if err != nil {
201 return nil, errors.WithStack(err)
202 }
203 res, err := http.DefaultClient.Do(req)
204 if err != nil {
205 return nil, err
206 }
207 defer res.Body.Close()
208
209 data, err := io.ReadAll(res.Body)
210 if err != nil {
211 return nil, errors.WithStack(err)
212 }
213 return loadBytes(data)
214}
215
216func loadBytes(b []byte) (*Config, error) {
217 root, err := configfile.LoadBytes(b)

Callers 1

pullTextDevboxConfigMethod · 0.92

Calls 2

loadBytesFunction · 0.85
DoMethod · 0.45

Tested by

no test coverage detected