MCPcopy Index your code
hub / github.com/devspace-sh/devspace / Get

Method Get

pkg/devspace/plugin/plugin.go:328–350  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

326}
327
328func (c *client) Get(path string) (*Metadata, error) {
329 pluginFolder, err := c.PluginFolder()
330 if err != nil {
331 return nil, err
332 }
333
334 out, err := os.ReadFile(filepath.Join(pluginFolder, Encode(path), pluginYaml))
335 if err != nil {
336 if os.IsNotExist(err) {
337 return nil, nil
338 }
339
340 return nil, err
341 }
342
343 metadata := Metadata{}
344 err = yaml.Unmarshal(out, &metadata)
345 if err != nil {
346 return nil, err
347 }
348
349 return &metadata, nil
350}
351
352func Encode(path string) string {
353 return encoding.EncodeToString([]byte(path))

Callers 15

AddMethod · 0.95
downloadToMethod · 0.45
DownloadMetadataMethod · 0.45
downloadFileFunction · 0.45
findTargetByKindNameFunction · 0.45
ReplacePodMethod · 0.45
updatePVCFunction · 0.45
PrintPodErrorFunction · 0.45
startWithRetryMethod · 0.45
logs.goFile · 0.45
downloadFileFunction · 0.45
forwardMethod · 0.45

Calls 2

PluginFolderMethod · 0.95
EncodeFunction · 0.85

Tested by

no test coverage detected