package
2.2.1+incompatible
Repository: https://github.com/goharbor/harbor.git
Documentation: pkg.go.dev

# Packages

# Functions

AddLabel creates a label.
AddProject adds a project to the database along with project roles information and access log records.
AddProjectMetadata adds metadata for a project.
AddRepository adds a repo to the database.
AddResourceLabel add a label to a resource.
ArrayEqual ...
AuthModeCanBeModified determines whether auth mode can be modified or not.
ChangeUserPassword ...
ChangeUserProfile - Update user in local db, cols to specify the columns need to update, Email, and RealName, Comment are updated by default.
CleanUser - Clean this user information from DB.
ClearHTTPAuthProxyUsers remove the records from harbor_users to delete all user imported via HTTP Auth Proxy.
ClearTable is the shortcut for test cases, it should be called only in test cases.
CreateCVEAllowlist creates the CVE allowlist.
CreateOrUpdateJobLog ...
CreatePagination ...
DeleteJobLogsBefore ...
DeleteLabel ...
DeleteLabelsOfResource removes all labels of the resource.
DeleteOIDCUser ...
DeleteProject ...
DeleteProjectMetadata deleted metadata of a project.
DeleteRepository ...
DeleteResourceLabel ...
DeleteResourceLabelByLabel delete the mapping relationship by label ID.
DeleteUser ...
Escape ..
ExecuteBatchSQL ...
GetConfigEntries Get configuration from database.
GetCVEAllowlist Gets the CVE allowlist of the project based on the project ID in parameter.
GetGroupProjects - Get user's all projects, including user is the user member of this project and the user is in the group which is a group member of this project.
GetJobLog ...
GetLabel specified by ID.
GetLabelsOfResource returns the label list of the resource Get the labels by ResourceID if rIDOrName is int, or get the labels by ResourceName.
GetOIDCUserByID ...
GetOIDCUserByUserID ...
GetOrmer :set ormer singleton.
GetProjectByID ...
GetProjectByName ...
GetProjectMetadata returns the metadata of a project.
GetProjects returns a project list according to the query conditions.
GetRepositories ...
GetRepositoryByName ...
GetResourceLabel specified by resource ID or name Get the ResourceLabel by ResourceID if rIDOrName is int Get the ResourceLabel by ResourceName if rIDOrName is string.
GetSchemaVersion return the version of database schema.
GetTotalGroupProjects - Get the total count of projects, including user is the member of this project and the user is in the group, which is the group member of this project.
GetTotalOfLabels returns the total count of labels.
GetTotalOfProjects returns the total count of projects according to the query conditions.
GetTotalOfRepositories ...
GetTotalOfUsers ...
GetUser ...
GetUserBySubIss ...
InitDatabase registers the database.
IsDupRecErr checks if the error is due to a duplication of record, currently this works only for pgSQL.
IsSuperUser checks if the user is super user(conventionally id == 1) of Harbor.
JoinNumberConditions - To join number condition into string,used in sql query.
ListLabels list labels according to the query conditions.
ListProjectMetadata ...
ListResourceLabels lists ResourceLabel according to the query conditions.
ListUsers lists all users according to different conditions.
LoginByDb is used for user to login with database auth mode.
NewMigrator creates a migrator base on the information.
NewMySQL returns an instance of mysql.
NewPGSQL returns an instance of postgres.
NewSQLite returns an instance of sqlite.
OnBoardOIDCUser onboard OIDC user For the api caller, should only care about the ErrDupUser.
OnBoardUser will check if a user exists in user table, if not insert the user and put the id in the pointer of user model, if it does exist, return the user's profile.
PaginateForQuerySetter ...
PaginateForRawSQL ...
ParamPlaceholderForIn returns a string that contains placeholders for sql keyword "in" e.g.
PrepareTestData -- Clean and Create data.
PrepareTestForMySQL is for test only.
PrepareTestForPostgresSQL is for test only.
PrepareTestForSQLite is for test only.
ProjectExistsByName returns whether the project exists according to its name.
Register is used for user to register, the password is encrypted before the record is inserted into database.
RepositoryExists returns whether the repository exists according to its name.
ResetUserPassword ...
SaveConfigEntries Save configuration to database.
ToggleUserAdminRole gives a user admin role.
UpdateCVEAllowlist Updates the vulnerability white list to DB.
UpdateLabel ...
UpdateOIDCUser updates the OIDCUser based on the input parm, only the column "secret" and "token" can be updated.
UpdateOIDCUserSecret updates the secret of the OIDC User.
UpdateProjectMetadata updates metadata of a project.
UpdateUserResetUUID ...
UpgradeSchema will call the internal migrator to upgrade schema based on the setting of database.
UserExists returns whether a user exists according username or Email.

# Constants

NonExistUserID : if a user does not exist, the ID of the user will be 0.
SchemaVersion is the version of database schema.

# Variables

ErrDupOIDCUser ...
ErrDupRows is returned by DAO when inserting failed with error "duplicate key value violates unique constraint".
ErrDupUser ...
ErrRollBackOIDCUser ...
ErrRollBackUser ...

# Interfaces

Database is an interface of different databases.