github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/creds/dummy/secrets_factory.go (about)

     1  package dummy
     2  
     3  import (
     4  	"github.com/pf-qiu/concourse/v6/atc/creds"
     5  	"github.com/pf-qiu/concourse/v6/vars"
     6  )
     7  
     8  type SecretsFactory struct {
     9  	vars vars.StaticVariables
    10  }
    11  
    12  func NewSecretsFactory(flags []VarFlag) *SecretsFactory {
    13  	vars := vars.StaticVariables{}
    14  	for _, flag := range flags {
    15  		vars[flag.Name] = flag.Value
    16  	}
    17  
    18  	return &SecretsFactory{
    19  		vars: vars,
    20  	}
    21  }
    22  
    23  func (factory *SecretsFactory) NewSecrets() creds.Secrets {
    24  	return &Secrets{
    25  		StaticVariables: factory.vars,
    26  	}
    27  }