Documentation ¶
Index ¶
- Constants
- Variables
- func GetPipelineRoleName(projectId, role string) string
- func GetPipelineRolePattern(projectId string) string
- func GetProjectRoleName(projectId, role string) string
- func GetProjectRolePattern(projectId string) string
- type AddProjectMemberRequest
- type CopySshCredentialRequest
- type CreateProjectRequest
- type CredentialRequest
- type CredentialResponse
- type DeleteCredentialRequest
- type DiscarderProperty
- type GitCloneOption
- type GitSource
- type GithubDiscoverPRFromForks
- type GithubSource
- type JenkinsJobRequest
- type KubeconfigCredentialRequest
- type MultiBranchPipeline
- type Parameter
- type Pipeline
- type ProjectRoleResponse
- type ProjectService
- func (s *ProjectService) AddProjectMemberHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) CreateCredentialHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) CreatePipelineHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) CreateProjectHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) DeleteCredentialHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) DeleteMemberHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) DeletePipelineHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) DeleteProjectHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetCredentialHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetCredentialsHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetMemberHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetMembersHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetMultiBranchPipelineSonarHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetPipelineHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetPipelineScmHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetPipelineSonarHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetProjectDefaultRolesHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetProjectHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) GetProjectsHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) UpdateCredentialHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) UpdateMemberHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) UpdatePipelineHandler(w rest.ResponseWriter, r *rest.Request)
- func (s *ProjectService) UpdateProjectHandler(w rest.ResponseWriter, r *rest.Request)
- type RemoteTrigger
- type Role
- type ScmInfo
- type SecretTextCredentialRequest
- type SingleSvnSource
- type SonarStatus
- type Source
- type SshCredentialRequest
- type SvnSource
- type TimerTrigger
- type UpdateProjectMemberRequest
- type UpdateProjectRequest
- type UsernamePasswordCredentialRequest
Constants ¶
View Source
const ( SonarAnalysisActionClass = "hudson.plugins.sonar.action.SonarAnalysisAction" SonarMetricKeys = "" /* 432-byte string literal not displayed */ SonarAdditionalFields = "metrics,periods" )
View Source
const ( CredentialTypeUsernamePassword = "username_password" CredentialTypeSsh = "ssh" CredentialTypeSecretText = "secret_text" CredentialTypeKubeConfig = "kubeconfig" )
View Source
const ( JenkinsJobPipeline = "pipeline" JenkinsJobMultiBranchPipeline = "multi-branch-pipeline" )
View Source
const ( ProjectOwner = "owner" ProjectMaintainer = "maintainer" ProjectDeveloper = "developer" ProjectReporter = "reporter" )
Variables ¶
View Source
var AllRoleSlice = []string{ProjectDeveloper, ProjectReporter, ProjectMaintainer, ProjectOwner}
View Source
var CredentialTypeMap = map[string]string{ "SSH Username with private key": CredentialTypeSsh, "Username with password": CredentialTypeUsernamePassword, "Secret text": CredentialTypeSecretText, "Kubernetes configuration (kubeconfig)": CredentialTypeKubeConfig, }
View Source
var DefaultRoles = []*Role{ { Name: ProjectOwner, Description: "Owner have access to do all the operations of a DevOps project and own the highest permissions as well.", }, { Name: ProjectMaintainer, Description: "Maintainer have access to manage pipeline and credential configuration in a DevOps project.", }, { Name: ProjectDeveloper, Description: "Developer is able to view and trigger the pipeline.", }, { Name: ProjectReporter, Description: "Reporter is only allowed to view the status of the pipeline.", }, }
View Source
var JenkinsOwnerProjectPermissionIds = &gojenkins.ProjectPermissionIds{ CredentialCreate: true, CredentialDelete: true, CredentialManageDomains: true, CredentialUpdate: true, CredentialView: true, ItemBuild: true, ItemCancel: true, ItemConfigure: true, ItemCreate: true, ItemDelete: true, ItemDiscover: true, ItemMove: true, ItemRead: true, ItemWorkspace: true, RunDelete: true, RunReplay: true, RunUpdate: true, SCMTag: true, }
View Source
var JenkinsPipelinePermissionMap = map[string]gojenkins.ProjectPermissionIds{ ProjectOwner: gojenkins.ProjectPermissionIds{ CredentialCreate: true, CredentialDelete: true, CredentialManageDomains: true, CredentialUpdate: true, CredentialView: true, ItemBuild: true, ItemCancel: true, ItemConfigure: true, ItemCreate: true, ItemDelete: true, ItemDiscover: true, ItemMove: true, ItemRead: true, ItemWorkspace: true, RunDelete: true, RunReplay: true, RunUpdate: true, SCMTag: true, }, ProjectMaintainer: gojenkins.ProjectPermissionIds{ CredentialCreate: true, CredentialDelete: true, CredentialManageDomains: true, CredentialUpdate: true, CredentialView: true, ItemBuild: true, ItemCancel: true, ItemConfigure: true, ItemCreate: true, ItemDelete: true, ItemDiscover: true, ItemMove: true, ItemRead: true, ItemWorkspace: true, RunDelete: true, RunReplay: true, RunUpdate: true, SCMTag: true, }, ProjectDeveloper: gojenkins.ProjectPermissionIds{ CredentialCreate: false, CredentialDelete: false, CredentialManageDomains: false, CredentialUpdate: false, CredentialView: false, ItemBuild: true, ItemCancel: true, ItemConfigure: false, ItemCreate: false, ItemDelete: false, ItemDiscover: true, ItemMove: false, ItemRead: true, ItemWorkspace: true, RunDelete: true, RunReplay: true, RunUpdate: true, SCMTag: false, }, ProjectReporter: gojenkins.ProjectPermissionIds{ CredentialCreate: false, CredentialDelete: false, CredentialManageDomains: false, CredentialUpdate: false, CredentialView: false, ItemBuild: false, ItemCancel: false, ItemConfigure: false, ItemCreate: false, ItemDelete: false, ItemDiscover: true, ItemMove: false, ItemRead: true, ItemWorkspace: false, RunDelete: false, RunReplay: false, RunUpdate: false, SCMTag: false, }, }
View Source
var JenkinsProjectPermissionMap = map[string]gojenkins.ProjectPermissionIds{ ProjectOwner: gojenkins.ProjectPermissionIds{ CredentialCreate: true, CredentialDelete: true, CredentialManageDomains: true, CredentialUpdate: true, CredentialView: true, ItemBuild: true, ItemCancel: true, ItemConfigure: true, ItemCreate: true, ItemDelete: true, ItemDiscover: true, ItemMove: true, ItemRead: true, ItemWorkspace: true, RunDelete: true, RunReplay: true, RunUpdate: true, SCMTag: true, }, ProjectMaintainer: gojenkins.ProjectPermissionIds{ CredentialCreate: true, CredentialDelete: true, CredentialManageDomains: true, CredentialUpdate: true, CredentialView: true, ItemBuild: true, ItemCancel: true, ItemConfigure: false, ItemCreate: true, ItemDelete: false, ItemDiscover: true, ItemMove: false, ItemRead: true, ItemWorkspace: true, RunDelete: true, RunReplay: true, RunUpdate: true, SCMTag: true, }, ProjectDeveloper: gojenkins.ProjectPermissionIds{ CredentialCreate: false, CredentialDelete: false, CredentialManageDomains: false, CredentialUpdate: false, CredentialView: false, ItemBuild: true, ItemCancel: true, ItemConfigure: false, ItemCreate: false, ItemDelete: false, ItemDiscover: true, ItemMove: false, ItemRead: true, ItemWorkspace: true, RunDelete: true, RunReplay: true, RunUpdate: true, SCMTag: false, }, ProjectReporter: gojenkins.ProjectPermissionIds{ CredentialCreate: false, CredentialDelete: false, CredentialManageDomains: false, CredentialUpdate: false, CredentialView: false, ItemBuild: false, ItemCancel: false, ItemConfigure: false, ItemCreate: false, ItemDelete: false, ItemDiscover: true, ItemMove: false, ItemRead: true, ItemWorkspace: false, RunDelete: false, RunReplay: false, RunUpdate: false, SCMTag: false, }, }
View Source
var ParameterTypeMap = map[string]string{
"hudson.model.StringParameterDefinition": "string",
"hudson.model.ChoiceParameterDefinition": "choice",
"hudson.model.TextParameterDefinition": "text",
"hudson.model.BooleanParameterDefinition": "boolean",
"hudson.model.FileParameterDefinition": "file",
"hudson.model.PasswordParameterDefinition": "password",
}
Functions ¶
func GetPipelineRoleName ¶
func GetPipelineRolePattern ¶
func GetProjectRoleName ¶
func GetProjectRolePattern ¶
Types ¶
type AddProjectMemberRequest ¶
type CopySshCredentialRequest ¶
type CopySshCredentialRequest struct {
Id string `json:"id"`
}
type CreateProjectRequest ¶
type CredentialRequest ¶
type CredentialResponse ¶
type CredentialResponse struct { Id string `json:"id"` Type string `json:"type"` DisplayName string `json:"display_name"` Fingerprint *struct { FileName string `json:"file_name,omitempty"` Hash string `json:"hash,omitempty"` Usage []*struct { Name string `json:"name,omitempty"` Ranges struct { Ranges []*struct { Start int `json:"start"` End int `json:"end"` } `json:"ranges"` } `json:"ranges"` } `json:"usage,omitempty"` } `json:"fingerprint,omitempty"` Description string `json:"description"` Domain string `json:"domain"` CreateTime *time.Time `json:"create_time,omitempty"` Creator string `json:"creator,omitempty"` Content map[string]interface{} `json:"content"` }
type DeleteCredentialRequest ¶
type DeleteCredentialRequest struct {
Domain string `json:"domain"`
}
type DiscarderProperty ¶
type GitCloneOption ¶
type GitSource ¶
type GitSource struct { Url string `json:"url,omitempty" mapstructure:"url"` CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id"` DiscoverBranches bool `json:"discover_branches,omitempty" mapstructure:"discover_branches"` CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option"` RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter"` }
type GithubSource ¶
type GithubSource struct { Owner string `json:"owner,omitempty" mapstructure:"owner"` Repo string `json:"repo,omitempty" mapstructure:"repo"` CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id"` ApiUri string `json:"api_uri,omitempty" mapstructure:"api_uri"` DiscoverBranches int `json:"discover_branches,omitempty" mapstructure:"discover_branches"` DiscoverPRFromOrigin int `json:"discover_pr_from_origin,omitempty" mapstructure:"discover_pr_from_origin"` DiscoverPRFromForks *GithubDiscoverPRFromForks `json:"discover_pr_from_forks,omitempty" mapstructure:"discover_pr_from_forks"` CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option"` RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter"` }
type JenkinsJobRequest ¶
type MultiBranchPipeline ¶
type MultiBranchPipeline struct { Name string `json:"name"` Description string `json:"description"` Discarder *DiscarderProperty `json:"discarder"` TimerTrigger *TimerTrigger `json:"timer_trigger" mapstructure:"timer_trigger"` Source *Source `json:"source"` ScriptPath string `json:"script_path" mapstructure:"script_path"` }
type Pipeline ¶
type Pipeline struct { Name string `json:"name"` Description string `json:"description"` Discarder *DiscarderProperty `json:"discarder"` Parameters []*Parameter `json:"parameters"` DisableConcurrent bool `json:"disable_concurrent" mapstructure:"disable_concurrent"` TimerTrigger *TimerTrigger `json:"timer_trigger" mapstructure:"timer_trigger"` RemoteTrigger *RemoteTrigger `json:"remote_trigger" mapstructure:"remote_trigger"` Jenkinsfile string `json:"jenkinsfile"` }
type ProjectRoleResponse ¶
type ProjectRoleResponse struct { ProjectRole *gojenkins.ProjectRole Err error }
type ProjectService ¶
func (*ProjectService) AddProjectMemberHandler ¶
func (s *ProjectService) AddProjectMemberHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) CreateCredentialHandler ¶
func (s *ProjectService) CreateCredentialHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) CreatePipelineHandler ¶
func (s *ProjectService) CreatePipelineHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) CreateProjectHandler ¶
func (s *ProjectService) CreateProjectHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) DeleteCredentialHandler ¶
func (s *ProjectService) DeleteCredentialHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) DeleteMemberHandler ¶
func (s *ProjectService) DeleteMemberHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) DeletePipelineHandler ¶
func (s *ProjectService) DeletePipelineHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) DeleteProjectHandler ¶
func (s *ProjectService) DeleteProjectHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetCredentialHandler ¶
func (s *ProjectService) GetCredentialHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetCredentialsHandler ¶
func (s *ProjectService) GetCredentialsHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetMemberHandler ¶
func (s *ProjectService) GetMemberHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetMembersHandler ¶
func (s *ProjectService) GetMembersHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetMultiBranchPipelineSonarHandler ¶
func (s *ProjectService) GetMultiBranchPipelineSonarHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetPipelineHandler ¶
func (s *ProjectService) GetPipelineHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetPipelineScmHandler ¶
func (s *ProjectService) GetPipelineScmHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetPipelineSonarHandler ¶
func (s *ProjectService) GetPipelineSonarHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetProjectDefaultRolesHandler ¶
func (s *ProjectService) GetProjectDefaultRolesHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetProjectHandler ¶
func (s *ProjectService) GetProjectHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) GetProjectsHandler ¶
func (s *ProjectService) GetProjectsHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) UpdateCredentialHandler ¶
func (s *ProjectService) UpdateCredentialHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) UpdateMemberHandler ¶
func (s *ProjectService) UpdateMemberHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) UpdatePipelineHandler ¶
func (s *ProjectService) UpdatePipelineHandler(w rest.ResponseWriter, r *rest.Request)
func (*ProjectService) UpdateProjectHandler ¶
func (s *ProjectService) UpdateProjectHandler(w rest.ResponseWriter, r *rest.Request)
type RemoteTrigger ¶
type RemoteTrigger struct {
Token string `json:"token"`
}
type SingleSvnSource ¶
type SonarStatus ¶
type SonarStatus struct { Measures *sonargo.MeasuresComponentObject `json:"measures,omitempty"` Issues *sonargo.IssuesSearchObject `json:"issues,omitempty"` JenkinsAction *gojenkins.GeneralObj `json:"jenkinsAction,omitempty"` Task *sonargo.CeTaskObject `json:"task,omitempty"` }
type SshCredentialRequest ¶
type TimerTrigger ¶
type UpdateProjectMemberRequest ¶
type UpdateProjectMemberRequest struct {
Role string `json:"role"`
}
type UpdateProjectRequest ¶
Click to show internal directories.
Click to hide internal directories.