(ctx context.Context)
| 30 | } |
| 31 | |
| 32 | func RunXRegistry(ctx context.Context) (*registry.Registry, error) { |
| 33 | if cachedRegistry == nil { |
| 34 | var err error |
| 35 | cachedRegistry, err = registry.NewLocalRegistry(ctx, getGithubToken()) |
| 36 | if err != nil { |
| 37 | return nil, err |
| 38 | } |
| 39 | } |
| 40 | return cachedRegistry, nil |
| 41 | } |
| 42 | |
| 43 | func getGithubToken() string { |
| 44 | token := os.Getenv(githubAPITokenVarName) |
no test coverage detected