application

package
v0.54.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 20 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoVariable when request requires specific variable in the applicatoin
	ErrNoVariable = fmt.Errorf("variable not in the application")
)
View Source
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

Insert add an application id database

func InsertKey

InsertKey a new application key in database

func InsertVariable

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

func LoadAllNames(db gorp.SqlExecutor, projID int64) (sdk.IDNames, error)

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

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

Update updates application id database

func UpdateKey

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

type ImportOptions struct {
	Force          bool
	FromRepository string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL