Documentation ¶
Overview ¶
Package apilib These APIs provide services for manipulating Harbor project.
HarborLogout.go ¶
HarborLogon.go
Index ¶
- type AccessLog
- type AdminJob
- type GCReq
- type HarborAPI
- func (a HarborAPI) HarborLogin(user UsrInfo) (int, error)
- func (a HarborAPI) HarborLogout() (int, error)
- func (a HarborAPI) ProjectsPost(prjUsr UsrInfo, project Project) (int, error)
- func (a HarborAPI) RepositoriesDelete(prjUsr UsrInfo, repoName string, tag string) (int, error)
- func (a HarborAPI) SearchGet(q string) (Search, error)
- type JobStatus
- type LdapConf
- type LogQuery
- type Password
- type Project
- type ProjectQuery
- type ProjectReq
- type RepPolicy
- type RepPolicyEnablementReq
- type RepPolicyPost
- type RepPolicyUpdate
- type RepTarget
- type RepTargetPost
- type Repository
- type Retag
- type Role
- type RoleParam
- type ScheduleParam
- type Search
- type SearchProject
- type SearchRepository
- type StatisticMap
- type Storage
- type SystemInfo
- type Tags
- type TopRepo
- type User
- type UserProfile
- type UsrInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLog ¶
type AccessLog struct { // The ID of the log entry. LogId int32 `json:"log_id,omitempty"` // Name of the repository in this log entry. RepoName string `json:"repo_name,omitempty"` // Tag of the repository in this log entry. RepoTag string `json:"repo_tag,omitempty"` // The operation against the repository in this log entry. Operation string `json:"operation,omitempty"` // The time when this operation is triggered. OpTime string `json:"op_time,omitempty"` }
type AdminJob ¶ added in v1.6.0
type AdminJob struct { ID int64 `json:"id,omitempty"` Name string `json:"job_name,omitempty"` Kind string `json:"job_kind,omitempty"` Status string `json:"job_status,omitempty"` UUID string `json:"uuid,omitempty"` Deleted bool `json:"deleted,omitempty"` CreationTime string `json:"creation_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` }
AdminJob ...
type GCReq ¶ added in v1.6.0
type GCReq struct { Schedule *ScheduleParam `json:"schedule,omitempty"` Status string `json:"status,omitempty"` ID int64 `json:"id,omitempty"` }
GCReq holds request information for admin job
type HarborAPI ¶
type HarborAPI struct {
// contains filtered or unexported fields
}
func NewHarborAPI ¶
func NewHarborAPI() *HarborAPI
func (HarborAPI) HarborLogout ¶
func (HarborAPI) ProjectsPost ¶
Create a new project. Implementation Notes This endpoint is for user to create a new project. @param project New created project. @return void func (a HarborAPI) ProjectsPost (prjUsr UsrInfo, project Project) (int, error) {
func (HarborAPI) RepositoriesDelete ¶
Delete a repository or a tag in a repository. Delete a repository or a tag in a repository. This endpoint let user delete repositories and tags with repo name and tag.\n @param repoName The name of repository which will be deleted. @param tag Tag of a repository. @return void func (a HarborAPI) RepositoriesDelete(prjUsr UsrInfo, repoName string, tag string) (int, error) {
func (HarborAPI) SearchGet ¶
Search for projects and repositories Implementation Notes The Search endpoint returns information about the projects and repositories offered at public status or related to the current logged in user. The response includes the project and repository list in a proper display order. @param q Search parameter for project and repository name. @return []Search func (a HarborAPI) SearchGet (q string) (Search, error) {
type JobStatus ¶
type JobStatus struct { // The job ID. Id int64 `json:"id,omitempty"` // The status of the job. Status string `json:"status,omitempty"` // The repository handled by the job. Repository string `json:"repository,omitempty"` // The ID of the policy that triggered this job. PolicyId int64 `json:"policy_id,omitempty"` // The operation of the job. Operation string `json:"operation,omitempty"` // The repository's used tag list. Tags []Tags `json:"tags,omitempty"` // The creation time of the job. CreationTime string `json:"creation_time,omitempty"` // The update time of the job. UpdateTime string `json:"update_time,omitempty"` }
type LdapConf ¶
type LdapConf struct { LdapURL string `json:"ldap_url"` LdapSearchDn string `json:"ldap_search_dn"` LdapSearchPassword string `json:"ldap_search_password"` LdapBaseDn string `json:"ldap_base_dn"` LdapFilter string `json:"ldap_filter"` LdapUID string `json:"ldap_uid"` LdapScope int `json:"ldap_scope"` LdapConnectionTimeout int `json:"ldap_connection_timeout"` }
type LogQuery ¶
type LogQuery struct { Username string `url:"username,omitempty"` Repository string `url:"repository,omitempty"` Tag string `url:"tag,omitempty"` Operation []string `url:"operation,omitempty"` BeginTimestamp int64 `url:"begin_timestamp,omitempty"` EndTimestamp int64 `url:"end_timestamp,omitempty"` Page int64 `url:"page,omitempty"` PageSize int64 `url:"page_size,omitempty"` }
type Project ¶
type Project struct { // Project ID ProjectId int32 `json:"project_id,omitempty"` // The owner ID of the project always means the creator of the project. OwnerId int32 `json:"owner_id,omitempty"` // The name of the project. ProjectName string `json:"name,omitempty"` // The creation time of the project. CreationTime string `json:"creation_time,omitempty"` // The update time of the project. UpdateTime string `json:"update_time,omitempty"` // A deletion mark of the project (1 means it's deleted, 0 is not) Deleted bool `json:"deleted,omitempty"` // The owner name of the project. OwnerName string `json:"owner_name,omitempty"` // The metadata of the project. Metadata map[string]string `json:"metadata,omitempty"` // Correspond to the UI about whether the project's publicity is updatable (for UI) Togglable bool `json:"togglable,omitempty"` // The role ID of the current user who triggered the API (for UI) CurrentUserRoleId int32 `json:"current_user_role_id,omitempty"` // The number of the repositories under this project. RepoCount int32 `json:"repo_count,omitempty"` }
type ProjectQuery ¶
type ProjectReq ¶
type RepPolicy ¶
type RepPolicy struct { // The policy ID. Id int64 `json:"id,omitempty"` // The project ID. ProjectId int64 `json:"project_id,omitempty"` // The project name. ProjectName string `json:"project_name,omitempty"` // The target ID. TargetId int64 `json:"target_id,omitempty"` // The policy name. Name string `json:"name,omitempty"` // The policy's enabled status. Enabled int32 `json:"enabled,omitempty"` // The description of the policy. Description string `json:"description,omitempty"` // The cron string for schedule job. CronStr string `json:"cron_str,omitempty"` // The start time of the policy. StartTime string `json:"start_time,omitempty"` // The create time of the policy. CreationTime string `json:"creation_time,omitempty"` // The update time of the policy. UpdateTime string `json:"update_time,omitempty"` Deleted int32 `json:"deleted,omitempty"` }
type RepPolicyEnablementReq ¶
type RepPolicyEnablementReq struct { // The policy enablement flag. Enabled int32 `json:"enabled,omitempty"` }
type RepPolicyPost ¶
type RepPolicyUpdate ¶
type RepPolicyUpdate struct { // The target ID. TargetId int64 `json:"target_id,omitempty"` // The policy name. Name string `json:"name,omitempty"` // The policy's enabled status. Enabled int32 `json:"enabled,omitempty"` // The description of the policy. Description string `json:"description,omitempty"` // The cron string for schedule job. CronStr string `json:"cron_str,omitempty"` }
type RepTarget ¶
type RepTarget struct { // The target ID. Id int64 `json:"id,omitempty"` // The target address URL string. Endpoint string `json:"endpoint,omitempty"` // The target name. Name string `json:"name,omitempty"` // The target server username. Username string `json:"username,omitempty"` // The target server password. Password string `json:"password,omitempty"` // Reserved field. Type_ int32 `json:"type,omitempty"` // The create time of the policy. CreationTime string `json:"creation_time,omitempty"` // The update time of the policy. UpdateTime string `json:"update_time,omitempty"` }
type RepTargetPost ¶
type RepTargetPost struct { // The target address URL string. Endpoint string `json:"endpoint,omitempty"` // The target name. Name string `json:"name,omitempty"` // The target server username. Username string `json:"username,omitempty"` // The target server password. Password string `json:"password,omitempty"` }
type Repository ¶
type Repository struct { // Repository ID Id string `json:"id,omitempty"` // Parent of the image. Parent string `json:"parent,omitempty"` // Repository create time. Created string `json:"created,omitempty"` // Duration days of the image. DurationDays string `json:"duration_days,omitempty"` // Author of the image. Author string `json:"author,omitempty"` // Architecture of the image. Architecture string `json:"architecture,omitempty"` // Docker version of the image. DockerVersion string `json:"docker_version,omitempty"` // OS of the image. Os string `json:"os,omitempty"` }
type Retag ¶ added in v1.7.0
type Retag struct { // The new tag Tag string `json:"tag"` // Source images in format <project>/<repo>:<reference> SrcImage string `json:"src_image"` // If target tag exists, whether override it Override bool `json:"override"` }
Retag describes a retag request
type ScheduleParam ¶ added in v1.6.0
type ScheduleParam struct { Type string `json:"type,omitempty"` Weekday int8 `json:"Weekday,omitempty"` Offtime int64 `json:"Offtime,omitempty"` }
ScheduleParam ...
type Search ¶
type Search struct { // Search results of the projects that matched the filter keywords. Projects []models.Project `json:"project,omitempty"` // Search results of the repositories that matched the filter keywords. Repositories []SearchRepository `json:"repository,omitempty"` }
type SearchProject ¶
type SearchRepository ¶
type SearchRepository struct { // The ID of the project that the repository belongs to ProjectId int32 `json:"project_id,omitempty"` // The name of the project that the repository belongs to ProjectName string `json:"project_name,omitempty"` // The flag to indicate the publicity of the project that the repository belongs to ProjectPublic bool `json:"project_public,omitempty"` // The name of the repository RepositoryName string `json:"repository_name,omitempty"` }
type StatisticMap ¶
type StatisticMap struct { // The count of the private projects which the user is a member of. PrivateProjectCount int32 `json:"private_project_count,omitempty"` // The count of the private repositories belonging to the projects which the user is a member of. PrivateRepoCount int32 `json:"private_repo_count,omitempty"` // The count of the public projects. PublicProjectCount int32 `json:"public_project_count,omitempty"` // The count of the public repositories belonging to the public projects which the user is a member of. PublicRepoCount int32 `json:"public_repo_count,omitempty"` // The count of the total projects, only be seen when the is admin. TotalProjectCount int32 `json:"total_project_count,omitempty"` // The count of the total repositories, only be seen when the user is admin. TotalRepoCount int32 `json:"total_repo_count,omitempty"` }
type SystemInfo ¶
type SystemInfo struct {
HarborStorage Storage `json:"storage"`
}
type User ¶
type User struct { // The ID of the user. UserId int `json:"user_id,omitempty"` Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` Password string `json:"password,omitempty"` Realname string `json:"realname,omitempty"` Comment string `json:"comment,omitempty"` Deleted bool `json:"deleted,omitempty"` RoleName string `json:"role_name,omitempty"` RoleId int32 `json:"role_id,omitempty"` HasAdminRole bool `json:"has_admin_role,omitempty"` ResetUuid string `json:"reset_uuid,omitempty"` Salt string `json:"Salt,omitempty"` CreationTime string `json:"creation_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` }
type UserProfile ¶
Source Files ¶
- access_log.go
- access_log_filter.go
- admin_job.go
- admin_job_req.go
- harborapi.go
- harborlogout.go
- harlogin.go
- job_status.go
- ldap.go
- password.go
- project.go
- project_req.go
- rep_policy.go
- rep_policy_enablement_req.go
- rep_policy_post.go
- rep_policy_update.go
- rep_target.go
- rep_target_post.go
- repository.go
- role.go
- role_param.go
- search.go
- search_project.go
- search_repository.go
- statistic_map.go
- system_info.go
- tags.go
- top_repo.go
- user.go
- user_profile.go