Documentation ¶
Index ¶
- Variables
- func DeleteAllApplicationKeys(db gorp.SqlExecutor, applicationID int64) error
- func DeleteAllDeploymentStrategies(db gorp.SqlExecutor, appID int64) error
- func DeleteAllVariables(db gorp.SqlExecutor, applicationID int64) error
- func DeleteApplication(db gorp.SqlExecutor, applicationID int64) error
- func DeleteDeploymentStrategy(db gorp.SqlExecutor, projID, appID, pfID int64) error
- func DeleteKey(db gorp.SqlExecutor, appID int64, keyName string) error
- func DeleteVariable(db gorp.SqlExecutor, appID int64, variable *sdk.ApplicationVariable, ...) error
- func Exists(db gorp.SqlExecutor, projectKey, appName string) (bool, error)
- func Export(ctx context.Context, db gorp.SqlExecutor, key string, appName string, ...) (exportentities.Application, error)
- func ExportApplication(ctx context.Context, db gorp.SqlExecutor, app sdk.Application, ...) (exportentities.Application, error)
- func GetVariableAudit(db gorp.SqlExecutor, key, appName string) ([]sdk.VariableAudit, error)
- func Import(ctx context.Context, db gorpmapper.SqlExecutorWithTx, proj sdk.Project, ...) error
- func Insert(db gorpmapper.SqlExecutorWithTx, proj sdk.Project, app *sdk.Application) error
- func InsertKey(db gorpmapper.SqlExecutorWithTx, key *sdk.ApplicationKey) error
- func InsertVariable(db gorpmapper.SqlExecutorWithTx, appID int64, v *sdk.ApplicationVariable, ...) error
- func LoadAll(ctx context.Context, db gorp.SqlExecutor, key string, opts ...LoadOptionFunc) ([]sdk.Application, error)
- func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []int64, opts ...LoadOptionFunc) ([]sdk.Application, error)
- func LoadAllByIDsWithDecryption(ctx context.Context, db gorp.SqlExecutor, ids []int64, opts ...LoadOptionFunc) ([]sdk.Application, error)
- func LoadAllDeploymnentForAppsWithDecryption(ctx context.Context, db gorp.SqlExecutor, appIDs []int64) (map[int64]map[int64]sdk.IntegrationConfig, error)
- func LoadAllKeys(ctx context.Context, db gorp.SqlExecutor, appID int64) ([]sdk.ApplicationKey, error)
- func LoadAllKeysForAppsWithDecryption(ctx context.Context, db gorp.SqlExecutor, appIDs []int64) (map[int64][]sdk.ApplicationKey, error)
- func LoadAllKeysWithPrivateContent(ctx context.Context, db gorp.SqlExecutor, appID int64) ([]sdk.ApplicationKey, error)
- func LoadAllNames(db gorp.SqlExecutor, projID int64) (sdk.IDNames, error)
- func LoadAllNamesByFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) (sdk.IDNames, error)
- func LoadAllVariables(ctx context.Context, db gorp.SqlExecutor, appID int64) ([]sdk.ApplicationVariable, error)
- func LoadAllVariablesForAppsWithDecryption(ctx context.Context, db gorp.SqlExecutor, appIDs []int64) (map[int64][]sdk.ApplicationVariable, error)
- func LoadAllVariablesWithDecrytion(ctx context.Context, db gorp.SqlExecutor, appID int64) ([]sdk.ApplicationVariable, error)
- func LoadByID(ctx context.Context, db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.Application, error)
- func LoadByIDWithClearVCSStrategyPassword(ctx context.Context, db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.Application, error)
- func LoadByName(ctx context.Context, db gorp.SqlExecutor, projectKey, appName string, ...) (*sdk.Application, error)
- func LoadByNameWithClearVCSStrategyPassword(ctx context.Context, db gorp.SqlExecutor, projectKey, appName string, ...) (*sdk.Application, error)
- func LoadByWorkflowID(ctx context.Context, db gorp.SqlExecutor, workflowID int64) ([]sdk.Application, error)
- func LoadDeploymentStrategies(ctx context.Context, db gorp.SqlExecutor, appID int64, withClearPassword bool) (map[string]sdk.IntegrationConfig, error)
- func LoadIcon(db gorp.SqlExecutor, appID int64) (string, error)
- func LoadVariable(ctx context.Context, db gorp.SqlExecutor, appID int64, varName string) (*sdk.ApplicationVariable, error)
- func LoadVariableAudits(db gorp.SqlExecutor, appID, varID int64) ([]sdk.ApplicationVariableAudit, error)
- func LoadVariableWithDecryption(ctx context.Context, db gorp.SqlExecutor, appID int64, varID int64, ...) (*sdk.ApplicationVariable, error)
- func ParseAndImport(ctx context.Context, db gorpmapper.SqlExecutorWithTx, cache cache.Store, ...) (*sdk.Application, []sdk.Variable, []sdk.Message, error)
- func ResetFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) error
- func SetDeploymentStrategy(db gorpmapper.SqlExecutorWithTx, projID, appID, pfModelID int64, ...) error
- func Update(ctx context.Context, db gorpmapper.SqlExecutorWithTx, app *sdk.Application) error
- func UpdateKey(ctx context.Context, db gorpmapper.SqlExecutorWithTx, key *sdk.ApplicationKey) error
- func UpdateVariable(db gorpmapper.SqlExecutorWithTx, appID int64, ...) error
- type ImportOptions
- type LoadOptionFunc
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoVariable when request requires specific variable in the applicatoin ErrNoVariable = fmt.Errorf("variable not in the application") )
var LoadOptions = struct { Default LoadOptionFunc WithVariables LoadOptionFunc WithVariablesWithClearPassword LoadOptionFunc WithKeys LoadOptionFunc WithClearKeys LoadOptionFunc WithDeploymentStrategies LoadOptionFunc WithClearDeploymentStrategies LoadOptionFunc WithIcon LoadOptionFunc }{ Default: loadDefaultDependencies, WithVariables: loadVariables, WithVariablesWithClearPassword: loadVariablesWithClearPassword, WithKeys: loadKeys, WithClearKeys: loadClearKeys, WithDeploymentStrategies: loadDeploymentStrategies, WithClearDeploymentStrategies: loadDeploymentStrategiesWithClearPassword, WithIcon: loadIcon, }
LoadOptions provides all options on project loads functions
Functions ¶
func DeleteAllApplicationKeys ¶
func DeleteAllApplicationKeys(db gorp.SqlExecutor, applicationID int64) error
DeleteAllApplicationKeys deletes all application keys
func DeleteAllDeploymentStrategies ¶
func DeleteAllDeploymentStrategies(db gorp.SqlExecutor, appID int64) error
DeleteAllDeploymentStrategies delete all lines in table application_deployment_strategy for one application
func DeleteAllVariables ¶
func DeleteAllVariables(db gorp.SqlExecutor, applicationID int64) error
DeleteAllVariables Delete all variables from the given application.
func DeleteApplication ¶
func DeleteApplication(db gorp.SqlExecutor, applicationID int64) error
DeleteApplication Delete the given application
func DeleteDeploymentStrategy ¶
func DeleteDeploymentStrategy(db gorp.SqlExecutor, projID, appID, pfID int64) error
DeleteDeploymentStrategy delete a line in table application_deployment_strategy
func DeleteKey ¶
func DeleteKey(db gorp.SqlExecutor, appID int64, keyName string) error
DeleteKey Delete the given key from the given application
func DeleteVariable ¶
func DeleteVariable(db gorp.SqlExecutor, appID int64, variable *sdk.ApplicationVariable, u sdk.Identifiable) error
DeleteVariable Delete a variable from the given pipeline
func Exists ¶
func Exists(db gorp.SqlExecutor, projectKey, appName string) (bool, error)
Exists checks if an application given its name exists
func Export ¶
func Export(ctx context.Context, db gorp.SqlExecutor, key string, appName string, encryptFunc sdk.EncryptFunc) (exportentities.Application, error)
Export an application
func ExportApplication ¶
func ExportApplication(ctx context.Context, db gorp.SqlExecutor, app sdk.Application, encryptFunc sdk.EncryptFunc, encryptPrefix string) (exportentities.Application, error)
ExportApplication encrypt and export
func GetVariableAudit ¶
func GetVariableAudit(db gorp.SqlExecutor, key, appName string) ([]sdk.VariableAudit, error)
GetVariableAudit Get variable audit for the given application Deprecated
func Import ¶
func Import(ctx context.Context, db gorpmapper.SqlExecutorWithTx, proj sdk.Project, app *sdk.Application, repomanager string, u sdk.Identifiable, msgChan chan<- sdk.Message) error
Import is able to create a new application and all its components
func Insert ¶
func Insert(db gorpmapper.SqlExecutorWithTx, proj sdk.Project, app *sdk.Application) error
Insert add an application id database
func InsertKey ¶
func InsertKey(db gorpmapper.SqlExecutorWithTx, key *sdk.ApplicationKey) error
InsertKey a new application key in database
func InsertVariable ¶
func InsertVariable(db gorpmapper.SqlExecutorWithTx, appID int64, v *sdk.ApplicationVariable, u sdk.Identifiable) error
InsertVariable Insert a new variable in the given application
func LoadAll ¶
func LoadAll(ctx context.Context, db gorp.SqlExecutor, key string, opts ...LoadOptionFunc) ([]sdk.Application, error)
LoadAll returns all applications
func LoadAllByIDs ¶
func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []int64, opts ...LoadOptionFunc) ([]sdk.Application, error)
LoadAllByIDs returns all applications
func LoadAllByIDsWithDecryption ¶
func LoadAllByIDsWithDecryption(ctx context.Context, db gorp.SqlExecutor, ids []int64, opts ...LoadOptionFunc) ([]sdk.Application, error)
LoadAllByIDsWithDecryption returns all applications with clear vcs strategy
func LoadAllDeploymnentForAppsWithDecryption ¶
func LoadAllDeploymnentForAppsWithDecryption(ctx context.Context, db gorp.SqlExecutor, appIDs []int64) (map[int64]map[int64]sdk.IntegrationConfig, error)
LoadAllDeploymnentForAppsWithDecryption load all deployments for all given applications, with decryption
func LoadAllKeys ¶
func LoadAllKeys(ctx context.Context, db gorp.SqlExecutor, appID int64) ([]sdk.ApplicationKey, error)
LoadAllKeys load all keys for the given application
func LoadAllKeysForAppsWithDecryption ¶
func LoadAllKeysForAppsWithDecryption(ctx context.Context, db gorp.SqlExecutor, appIDs []int64) (map[int64][]sdk.ApplicationKey, error)
LoadAllKeysForAppsWithDecryption load all keys for all given applications, with decryption
func LoadAllKeysWithPrivateContent ¶
func LoadAllKeysWithPrivateContent(ctx context.Context, db gorp.SqlExecutor, appID int64) ([]sdk.ApplicationKey, error)
LoadAllKeysWithPrivateContent load all keys for the given application
func LoadAllNames ¶
LoadAllNames returns all application names
func LoadAllNamesByFromRepository ¶
func LoadAllNamesByFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) (sdk.IDNames, error)
LoadAllNamesByFromRepository returns all application names for a repository
func LoadAllVariables ¶
func LoadAllVariables(ctx context.Context, db gorp.SqlExecutor, appID int64) ([]sdk.ApplicationVariable, error)
func LoadAllVariablesForAppsWithDecryption ¶
func LoadAllVariablesForAppsWithDecryption(ctx context.Context, db gorp.SqlExecutor, appIDs []int64) (map[int64][]sdk.ApplicationVariable, error)
LoadAllVariablesForAppsWithDecryption load all variables from all given applications, with decryption
func LoadAllVariablesWithDecrytion ¶
func LoadAllVariablesWithDecrytion(ctx context.Context, db gorp.SqlExecutor, appID int64) ([]sdk.ApplicationVariable, error)
LoadAllVariablesWithDecrytion Get all variable for the given application, it also decrypt all the secure content
func LoadByID ¶
func LoadByID(ctx context.Context, db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.Application, error)
LoadByID load an application from DB
func LoadByIDWithClearVCSStrategyPassword ¶
func LoadByIDWithClearVCSStrategyPassword(ctx context.Context, db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.Application, error)
func LoadByName ¶
func LoadByName(ctx context.Context, db gorp.SqlExecutor, projectKey, appName string, opts ...LoadOptionFunc) (*sdk.Application, error)
LoadByName load an application from DB
func LoadByNameWithClearVCSStrategyPassword ¶
func LoadByNameWithClearVCSStrategyPassword(ctx context.Context, db gorp.SqlExecutor, projectKey, appName string, opts ...LoadOptionFunc) (*sdk.Application, error)
LoadByNameWithClearVCSStrategyPassword load an application from DB
func LoadByWorkflowID ¶
func LoadByWorkflowID(ctx context.Context, db gorp.SqlExecutor, workflowID int64) ([]sdk.Application, error)
LoadByWorkflowID loads applications from database for a given workflow id
func LoadDeploymentStrategies ¶
func LoadDeploymentStrategies(ctx context.Context, db gorp.SqlExecutor, appID int64, withClearPassword bool) (map[string]sdk.IntegrationConfig, error)
LoadDeploymentStrategies loads the deployment strategies for an application
func LoadIcon ¶
func LoadIcon(db gorp.SqlExecutor, appID int64) (string, error)
LoadIcon return application icon given his application id
func LoadVariable ¶
func LoadVariable(ctx context.Context, db gorp.SqlExecutor, appID int64, varName string) (*sdk.ApplicationVariable, error)
LoadVariable retrieve a specific variable
func LoadVariableAudits ¶
func LoadVariableAudits(db gorp.SqlExecutor, appID, varID int64) ([]sdk.ApplicationVariableAudit, error)
LoadVariableAudits Load audits for the given variable
func LoadVariableWithDecryption ¶
func LoadVariableWithDecryption(ctx context.Context, db gorp.SqlExecutor, appID int64, varID int64, varName string) (*sdk.ApplicationVariable, error)
LoadVariableWithDecryption retrieve a specific variable with decrypted content
func ParseAndImport ¶
func ParseAndImport(ctx context.Context, db gorpmapper.SqlExecutorWithTx, cache cache.Store, proj sdk.Project, eapp *exportentities.Application, opts ImportOptions, decryptFunc keys.DecryptFunc, u sdk.Identifiable, emailFunc keys.EmailFunc) (*sdk.Application, []sdk.Variable, []sdk.Message, error)
ParseAndImport parse an exportentities.Application and insert or update the application in database
func ResetFromRepository ¶
func ResetFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) error
ResetFromRepository reset fromRepository for all applications using the same fromRepository in a given project
func SetDeploymentStrategy ¶
func SetDeploymentStrategy(db gorpmapper.SqlExecutorWithTx, projID, appID, pfModelID int64, ppfName string, cfg sdk.IntegrationConfig) error
SetDeploymentStrategy update the application_deployment_strategy table
func Update ¶
func Update(ctx context.Context, db gorpmapper.SqlExecutorWithTx, app *sdk.Application) error
Update updates application id database
func UpdateKey ¶
func UpdateKey(ctx context.Context, db gorpmapper.SqlExecutorWithTx, key *sdk.ApplicationKey) error
UpdateKey a new application key in database. This function should be use only for migration purpose and should be removed
func UpdateVariable ¶
func UpdateVariable(db gorpmapper.SqlExecutorWithTx, appID int64, variable *sdk.ApplicationVariable, variableBefore *sdk.ApplicationVariable, u sdk.Identifiable) error
UpdateVariable Update a variable in the given application
Types ¶
type ImportOptions ¶
ImportOptions are options to import application
type LoadOptionFunc ¶
type LoadOptionFunc func(context.Context, gorp.SqlExecutor, *sdk.Application) error
LoadOptionFunc is a type for all options in LoadOptions