MCPcopy Index your code
hub / github.com/commitdev/zero / GetRegistry

Function GetRegistry

internal/registry/registry.go:19–44  ·  view source on GitHub ↗
(localModulePath, registryFilePath string)

Source from the content-addressed store, hash-verified

17}
18
19func GetRegistry(localModulePath, registryFilePath string) (Registry, error) {
20 registry := Registry{}
21
22 err := getter.GetFile(constants.TmpRegistryYml, registryFilePath)
23 if err != nil {
24 return nil, err
25 }
26
27 data, err := ioutil.ReadFile(constants.TmpRegistryYml)
28 if err != nil {
29 return nil, err
30 }
31
32 err = yaml.Unmarshal(data, &registry)
33 if err != nil {
34 return nil, err
35 }
36
37 for i := 0; i < len(registry); i++ {
38 for j := 0; j < len(registry[i].ModuleSources); j++ {
39 registry[i].ModuleSources[j] = localModulePath + registry[i].ModuleSources[j]
40 }
41 }
42
43 return registry, nil
44}
45
46func GetModulesByName(registry Registry, name string) []string {
47 for _, v := range registry {

Callers 1

InitFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected