project

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: 30 Imported by: 42

Documentation

Index

Constants

View Source
const BuiltinGPGKey = "builtin"

BuiltinGPGKey is a const

Variables

View Source
var LoadOptions = struct {
	Default                                 LoadOptionFunc
	WithIcon                                LoadOptionFunc
	WithApplications                        LoadOptionFunc
	WithApplicationNames                    LoadOptionFunc
	WithVariables                           LoadOptionFunc
	WithVariablesWithClearPassword          LoadOptionFunc
	WithPipelines                           LoadOptionFunc
	WithPipelineNames                       LoadOptionFunc
	WithEnvironments                        LoadOptionFunc
	WithEnvironmentNames                    LoadOptionFunc
	WithGroups                              LoadOptionFunc
	WithApplicationVariables                LoadOptionFunc
	WithApplicationKeys                     LoadOptionFunc
	WithApplicationWithDeploymentStrategies LoadOptionFunc
	WithKeys                                LoadOptionFunc
	WithWorkflows                           LoadOptionFunc
	WithWorkflowNames                       LoadOptionFunc
	WithClearKeys                           LoadOptionFunc
	WithIntegrations                        LoadOptionFunc
	WithClearIntegrations                   LoadOptionFunc
	WithFavorites                           func(uID string) LoadOptionFunc
	WithLabels                              LoadOptionFunc
}{
	Default:                                 loadDefault,
	WithIcon:                                loadIcon,
	WithPipelines:                           loadPipelines,
	WithPipelineNames:                       loadPipelineNames,
	WithEnvironments:                        loadEnvironments,
	WithEnvironmentNames:                    loadEnvironmentNames,
	WithGroups:                              loadGroups,
	WithApplications:                        loadApplications,
	WithApplicationNames:                    loadApplicationNames,
	WithVariables:                           loadVariables,
	WithVariablesWithClearPassword:          loadVariablesWithClearPassword,
	WithApplicationVariables:                loadApplicationVariables,
	WithApplicationKeys:                     loadApplicationKeys,
	WithKeys:                                loadKeys,
	WithWorkflows:                           loadWorkflows,
	WithWorkflowNames:                       loadWorkflowNames,
	WithClearKeys:                           loadClearKeys,
	WithIntegrations:                        loadIntegrations,
	WithClearIntegrations:                   loadClearIntegrations,
	WithFavorites:                           loadFavorites,
	WithApplicationWithDeploymentStrategies: loadApplicationWithDeploymentStrategies,
	WithLabels:                              loadLabels,
}

LoadOptions provides all options on project loads functions

Functions

func DecryptWithBuiltinKey

func DecryptWithBuiltinKey(ctx context.Context, db gorp.SqlExecutor, projectID int64, token string) (string, error)

DecryptWithBuiltinKey decrypt a base64-ed, gzipped, content

func Delete

func Delete(db gorp.SqlExecutor, key string) error

Delete delete one or more projects given the key

func DeleteAllVariables

func DeleteAllVariables(db gorp.SqlExecutor, projectID int64) error

DeleteAllVariables Delete all variables from the given project.

func DeleteByID

func DeleteByID(db gorp.SqlExecutor, id int64) error

DeleteByID removes given project from database (project and project_group table) DeleteByID also removes all pipelines inside project (pipeline and pipeline_group table).

func DeleteEncryptedVariable

func DeleteEncryptedVariable(db gorp.SqlExecutor, projectID int64, name string) error

func DeleteLabel

func DeleteLabel(db gorp.SqlExecutor, labelID int64) error

DeleteLabel delete a label given a label ID

func DeleteProjectKey

func DeleteProjectKey(db gorp.SqlExecutor, projectID int64, keyName string) error

DeleteProjectKey Delete the given key from the given project

func DeleteVariable

func DeleteVariable(db gorp.SqlExecutor, projID int64, variable *sdk.ProjectVariable, u sdk.Identifiable) error

DeleteVariable Delete a variable from the given pipeline

func DeleteVariableSet added in v0.53.1

func DeleteVariableSet(ctx context.Context, db gorpmapper.SqlExecutorWithTx, varSet sdk.ProjectVariableSet) error

func DeleteVariableSetItemSecret added in v0.53.1

func DeleteVariableSetItemSecret(ctx context.Context, db gorpmapper.SqlExecutorWithTx, varSetSecret sdk.ProjectVariableSetItem) error

func DeleteVariableSetItemText added in v0.53.1

func DeleteVariableSetItemText(ctx context.Context, db gorpmapper.SqlExecutorWithTx, varSetText sdk.ProjectVariableSetItem) error

func DisableProjectKey added in v0.53.0

func DisableProjectKey(db gorp.SqlExecutor, projectID int64, keyName string) error

DisableProjectKey Disable the given key from the given project

func EnableProjectKey added in v0.53.0

func EnableProjectKey(db gorp.SqlExecutor, projectID int64, keyName string) error

EnableProjectKey Enable the given key from the given project

func EncryptWithBuiltinKey

func EncryptWithBuiltinKey(ctx context.Context, db gorp.SqlExecutor, projectID int64, name, content string) (string, error)

EncryptWithBuiltinKey encrypt a content with the builtin gpg key encode, compress it and encode with base64

func Exist

func Exist(db gorp.SqlExecutor, projectKey string) (bool, error)

Exist checks whether a project exists or not

func GetVariableAudit

func GetVariableAudit(db gorp.SqlExecutor, key string) ([]sdk.VariableAudit, error)

GetVariableAudit Get variable audit for the given project. DEPRECATED

func Insert

func Insert(db gorpmapper.SqlExecutorWithTx, proj *sdk.Project) error

Insert a new project in database

func InsertKey

func InsertKey(db gorpmapper.SqlExecutorWithTx, key *sdk.ProjectKey) error

InsertKey a new project key in database

func InsertLabel

func InsertLabel(db gorp.SqlExecutor, label *sdk.Label) error

InsertLabel insert a label

func InsertVariable

func InsertVariable(db gorpmapper.SqlExecutorWithTx, projID int64, v *sdk.ProjectVariable, u sdk.Identifiable) error

InsertVariable Insert a new variable in the given project

func InsertVariableSet added in v0.53.1

func InsertVariableSet(ctx context.Context, db gorpmapper.SqlExecutorWithTx, varSet *sdk.ProjectVariableSet) error

func InsertVariableSetItemSecret added in v0.53.1

func InsertVariableSetItemSecret(ctx context.Context, db gorpmapper.SqlExecutorWithTx, varSetSecret *sdk.ProjectVariableSetItem) error

func InsertVariableSetItemText added in v0.53.1

func InsertVariableSetItemText(ctx context.Context, db gorpmapper.SqlExecutorWithTx, varSetText *sdk.ProjectVariableSetItem) error

func LabelByName

func LabelByName(ctx context.Context, db gorp.SqlExecutor, projectID int64, labelName string) (*sdk.Label, error)

LabelByName return a label given his name and project id.

func Labels

func Labels(db gorp.SqlExecutor, projectID int64) ([]sdk.Label, error)

Labels return list of labels given a project ID

func ListEncryptedData

func ListEncryptedData(ctx context.Context, db gorp.SqlExecutor, projectID int64) ([]sdk.Secret, error)

func Load

func Load(ctx context.Context, db gorp.SqlExecutor, key string, opts ...LoadOptionFunc) (*sdk.Project, error)

Load returns a project with all its variables and applications given a user. It can also returns pipelines, environments, groups, permission, and repositorires manager. See LoadOptions

func LoadAll

func LoadAll(ctx context.Context, db gorp.SqlExecutor, store cache.Store, opts ...LoadOptionFunc) (sdk.Projects, error)

LoadAll returns all projects

func LoadAllByGroupIDs

func LoadAllByGroupIDs(ctx context.Context, db gorp.SqlExecutor, store cache.Store, IDs []int64, opts ...LoadOptionFunc) (sdk.Projects, error)

LoadAllByGroupIDs returns all projects given groups

func LoadAllByRepo

func LoadAllByRepo(ctx context.Context, db gorp.SqlExecutor, store cache.Store, repo string, opts ...LoadOptionFunc) (sdk.Projects, error)

LoadAllByRepo returns all projects with an application linked to the repo

func LoadAllByRepoAndGroupIDs

func LoadAllByRepoAndGroupIDs(ctx context.Context, db gorp.SqlExecutor, groupIDs []int64, repo string, opts ...LoadOptionFunc) (sdk.Projects, error)

LoadAllByRepoAndGroupIDs returns all projects with an application linked to the repo against the groups

func LoadAllKeys

func LoadAllKeys(ctx context.Context, db gorp.SqlExecutor, projectID int64) ([]sdk.ProjectKey, error)

LoadAllKeys load all keys for the given project

func LoadAllKeysForProjectsWithDecryption

func LoadAllKeysForProjectsWithDecryption(ctx context.Context, db gorp.SqlExecutor, projIDs []int64) (map[int64][]sdk.ProjectKey, error)

func LoadAllKeysWithPrivateContent

func LoadAllKeysWithPrivateContent(ctx context.Context, db gorp.SqlExecutor, projID int64) ([]sdk.ProjectKey, error)

LoadAllKeysWithPrivateContent load all keys for the given project

func LoadAllVariables

func LoadAllVariables(ctx context.Context, db gorp.SqlExecutor, projID int64) ([]sdk.ProjectVariable, error)

LoadAllVariables Get all variable for the given project

func LoadAllVariablesForProjectsWithDecryption

func LoadAllVariablesForProjectsWithDecryption(ctx context.Context, db gorp.SqlExecutor, projIDs []int64) (map[int64][]sdk.ProjectVariable, error)

LoadAllVariablesForProjectsWithDecryption loads all variables for all givent projects

func LoadAllVariablesWithDecrytion

func LoadAllVariablesWithDecrytion(ctx context.Context, db gorp.SqlExecutor, projID int64) ([]sdk.ProjectVariable, error)

LoadAllVariablesWithDecrytion Get all variable for the given project, it also decrypt all the secure content

func LoadByID

func LoadByID(db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.Project, error)

LoadByID returns a project with all its variables and applications given a user. It can also returns pipelines, environments, groups, permission, and repositorires manager. See LoadOptions

func LoadKey

func LoadKey(ctx context.Context, db gorp.SqlExecutor, id int64, keyName string) (*sdk.ProjectKey, error)

func LoadPermissions

func LoadPermissions(ctx context.Context, db gorp.SqlExecutor, groupID int64) ([]sdk.ProjectGroup, error)

LoadPermissions loads all projects where group has access

func LoadProjectByNodeJobRunID

func LoadProjectByNodeJobRunID(ctx context.Context, db gorp.SqlExecutor, store cache.Store, nodeJobRunID int64, opts ...LoadOptionFunc) (*sdk.Project, error)

LoadProjectByNodeJobRunID return a project from node job run id

func LoadProjectByWorkflowID

func LoadProjectByWorkflowID(db gorp.SqlExecutor, workflowID int64, opts ...LoadOptionFunc) (*sdk.Project, error)

LoadProjectByWorkflowID loads a project from workflow iD

func LoadVariable

func LoadVariable(db gorp.SqlExecutor, projID int64, varName string) (*sdk.ProjectVariable, error)

LoadVariable retrieve a specific variable

func LoadVariableAudits

func LoadVariableAudits(db gorp.SqlExecutor, projectID, varID int64) ([]sdk.ProjectVariableAudit, error)

LoadVariableAudits Load audits for the given variable

func LoadVariableSetAllItem added in v0.53.1

func LoadVariableSetAllItem(ctx context.Context, db gorp.SqlExecutor, variableSetID string, opts ...gorpmapper.GetOptionFunc) ([]sdk.ProjectVariableSetItem, error)

func LoadVariableSetByName added in v0.53.1

func LoadVariableSetByName(ctx context.Context, db gorp.SqlExecutor, projectKey string, name string, opts ...gorpmapper.GetOptionFunc) (*sdk.ProjectVariableSet, error)

func LoadVariableSetItem added in v0.53.1

func LoadVariableSetItem(ctx context.Context, db gorp.SqlExecutor, variableSetID string, itemName string, opts ...gorpmapping.GetOptionFunc) (*sdk.ProjectVariableSetItem, error)

func LoadVariableSetItemWithType added in v0.53.1

func LoadVariableSetItemWithType(ctx context.Context, db gorp.SqlExecutor, variableSetID string, itemName string, itemType string, opts ...gorpmapping.GetOptionFunc) (*sdk.ProjectVariableSetItem, error)

func LoadVariableSetsByProject added in v0.53.1

func LoadVariableSetsByProject(ctx context.Context, db gorp.SqlExecutor, projectKey string) ([]sdk.ProjectVariableSet, error)

func LoadVariableWithDecryption

func LoadVariableWithDecryption(db gorp.SqlExecutor, projID int64, varID int64, varName string) (*sdk.ProjectVariable, error)

LoadVariableWithDecryption retrieve a specific variable with decrypted content

func Update

func Update(db gorp.SqlExecutor, proj *sdk.Project) error

Update a new project in database

func UpdateFavorite

func UpdateFavorite(db gorp.SqlExecutor, projectID int64, userID string, add bool) error

UpdateFavorite add or delete project from user favorites

func UpdateLabel

func UpdateLabel(db gorp.SqlExecutor, label *sdk.Label) error

UpdateLabel update a label

func UpdateVariable

func UpdateVariable(db gorpmapper.SqlExecutorWithTx, projID int64, variable *sdk.ProjectVariable, variableBefore *sdk.ProjectVariable, u sdk.Identifiable) error

UpdateVariable Update a variable in the given project

func UpdateVariableSetItemSecret added in v0.53.1

func UpdateVariableSetItemSecret(ctx context.Context, db gorpmapper.SqlExecutorWithTx, varSetSecret *sdk.ProjectVariableSetItem) error

func UpdateVariableSetItemText added in v0.53.1

func UpdateVariableSetItemText(ctx context.Context, db gorpmapper.SqlExecutorWithTx, varSetText *sdk.ProjectVariableSetItem) error

func WithVariableSetItems added in v0.53.1

func WithVariableSetItems(ctx context.Context, _ *gorpmapper.Mapper, db gorp.SqlExecutor, i interface{}) error

Types

type LoadOptionFunc

type LoadOptionFunc func(context.Context, gorp.SqlExecutor, *sdk.Project) error

LoadOptionFunc is used as options to loadProject functions

Jump to

Keyboard shortcuts

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