Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (30 sloc) 881 Bytes
package main
import (
func newStorageBackend(log *zap.Logger, storage config.Store, cfg config.Config, md config.BuildMeta) (s store.Store, err error) {
ctx := context.Background()
log.Info(fmt.Sprintf("configuring '%s' storage backend", storage))
switch storage {
case config.StoreGitHub:
s, err = store.NewGitHubStore(ctx, log, store.GitHubStoreOpts{
Auth: cfg.GitHubAPITokenSource(), Repo: cfg.GitHubStoreRepo,
case config.StoreBigQuery:
s, err = store.NewBigQueryStore(ctx, log, store.BigQueryOpts{
ServiceVersion: md.Version,
ProjectID: cfg.GCPProjectID,
ConnOpts: cfg.GCPConnOpts(),
DataOpts: cfg.BigQuery,
log.Error(fmt.Sprintf("unsupported storage backend '%s'", storage))
You can’t perform that action at this time.