(ctx context.Context, dbcfg *csconfig.DatabaseCfg)
| 81 | } |
| 82 | |
| 83 | func DBClient(ctx context.Context, dbcfg *csconfig.DatabaseCfg) (*database.Client, error) { |
| 84 | if dbcfg == nil { |
| 85 | return nil, errors.New("no database configuration provided") |
| 86 | } |
| 87 | |
| 88 | db, err := database.NewClient(ctx, dbcfg, dbcfg.NewLogger()) |
| 89 | if err != nil { |
| 90 | return nil, fmt.Errorf("failed to connect to database: %w", err) |
| 91 | } |
| 92 | |
| 93 | return db, nil |
| 94 | } |
| 95 | |
| 96 | func HubDownloader(ctx context.Context, c *csconfig.Config) (*cwhub.Downloader, error) { |
| 97 | // set branch in config, and log if necessary |
no test coverage detected
searching dependent graphs…