client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGitScmBranchNotFound = errors.New("Could not find git scm branch")

ErrGitScmBranchNotFound git scm branch not found

View Source
var ErrGitScmExtensionNotFound = errors.New("Could not find git scm extension")

ErrGitScmExtensionNotFound git scm extension not found

View Source
var ErrGitScmUserRemoteConfigNotFound = errors.New("Could not find git scm scm user remote config")

ErrGitScmUserRemoteConfigNotFound git scm user remote config not found

View Source
var ErrInvalidDecodeResponseParameter = errors.New("nil interface provided to decodeResponse")

ErrInvalidDecodeResponseParameter invalid parameter for decodeResponse

View Source
var ErrJobActionNotFound = errors.New("Could not find job action")

ErrJobActionNotFound job action not found

View Source
var ErrJobGerritTriggerBranchNotFound = errors.New("Could not find job trigger gerrit branch")

ErrJobGerritTriggerBranchNotFound job trigger gerrit branch not found

View Source
var ErrJobGerritTriggerEventNotFound = errors.New("Could not find job gerrit trigger event")

ErrJobGerritTriggerEventNotFound job gerrit trigger event not found

View Source
var ErrJobGerritTriggerFilePathNotFound = errors.New("Could not find job trigger gerrit file path")

ErrJobGerritTriggerFilePathNotFound job trigger gerrit file path not found

View Source
var ErrJobGerritTriggerProjectNotFound = errors.New("Could not find job gerrit trigger project")

ErrJobGerritTriggerProjectNotFound job gerrit trigger project not found

View Source
var ErrJobNameRequired = errors.New("Cannot create a job without a name")
View Source
var ErrJobParameterDefinitionNotFound = errors.New("Could not find job parameter definition")

ErrJobParameterDefinitionNotFound job parameter definition not found

View Source
var ErrJobPropertyNotFound = errors.New("Could not find job property")

ErrJobPropertyNotFound job property not found

View Source
var ErrJobTriggerNotFound = errors.New("Could not find job pipeline trigger")

ErrJobTriggerNotFound job property not found

Functions

func JobConfigFromJob

func JobConfigFromJob(job *Job) *jobConfig

Types

type Client

type Client struct {
	Config Config
	// contains filtered or unexported fields
}

Client to talk to Jenkins

func NewClient

func NewClient(config Config) *Client

NewClient Return a new client with loaded configuration

func (*Client) Do

func (client *Client) Do(req *http.Request) (*http.Response, error)

Do send http request

func (*Client) DoWithResponse

func (client *Client) DoWithResponse(req *http.Request, v interface{}) (*http.Response, error)

DoWithResponse send http request and parse response body

func (*Client) NewRequest

func (client *Client) NewRequest(method string, path string) (*http.Request, error)

NewRequest create http request

func (*Client) NewRequestWithBody

func (client *Client) NewRequestWithBody(method string, path string, data interface{}) (*http.Request, error)

NewRequestWithBody create http request with data as body

type CompareType

type CompareType int
const (
	CompareTypeUnknown CompareType = iota
	CompareTypePlain
	CompareTypeRegExp
	CompareTypeAnt
)

func ParseCompareType

func ParseCompareType(s string) (CompareType, error)

func (CompareType) MarshalXML

func (t CompareType) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (CompareType) String

func (t CompareType) String() string

func (*CompareType) UnmarshalXML

func (t *CompareType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Config

type Config struct {
	Address  string
	Username string
	Token    string
}

Config for Client

type CpsScmFlowDefinition

type CpsScmFlowDefinition struct {
	Class  string `xml:"class,attr"`
	Id     string `xml:"id,attr,omitempty"`
	Plugin string `xml:"plugin,attr,omitempty"`

	SCM         *GitSCM `xml:"scm"`
	ScriptPath  string  `xml:"scriptPath"`
	Lightweight bool    `xml:"lightweight"`
}

func NewCpsScmFlowDefinition

func NewCpsScmFlowDefinition() *CpsScmFlowDefinition

func (*CpsScmFlowDefinition) GetId added in v0.1.0

func (d *CpsScmFlowDefinition) GetId() string

func (*CpsScmFlowDefinition) SetId added in v0.1.0

func (d *CpsScmFlowDefinition) SetId(id string)

type DynamicGerritProjects added in v0.1.0

type DynamicGerritProjects struct {
	XMLName xml.Name `xml:"dynamicGerritProjects"`
	Class   string   `xml:"class,attr"`
}

func NewDynamicGerritProjects added in v0.1.0

func NewDynamicGerritProjects() *DynamicGerritProjects

type GitSCM

type GitSCM struct {
	XMLName xml.Name `xml:"scm"`
	Class   string   `xml:"class,attr"`
	Plugin  string   `xml:"plugin,attr,omitempty"`

	ConfigVersion     string                `xml:"configVersion"`
	UserRemoteConfigs *GitUserRemoteConfigs `xml:"userRemoteConfigs"`
	Branches          *GitScmBranches       `xml:"branches"`

	DoGenerateSubmoduleConfigurations bool                    `xml:"doGenerateSubmoduleConfigurations"`
	SubmoduleCfg                      *GitScmSubmodulesConfig `xml:"submoduleCfg"`
	Extensions                        *GitScmExtensions       `xml:"extensions"`
}

func NewGitScm

func NewGitScm() *GitSCM

func (*GitSCM) DeleteBranch

func (scm *GitSCM) DeleteBranch(branchId string) error

func (*GitSCM) DeleteExtension

func (scm *GitSCM) DeleteExtension(extensionId string) error

func (*GitSCM) DeleteUserRemoteConfig

func (scm *GitSCM) DeleteUserRemoteConfig(configId string) error

func (*GitSCM) GetBranch

func (scm *GitSCM) GetBranch(branchId string) (*GitScmBranchSpec, error)

func (*GitSCM) GetExtension

func (scm *GitSCM) GetExtension(extensionId string) (GitScmExtension, error)

func (*GitSCM) GetUserRemoteConfig

func (scm *GitSCM) GetUserRemoteConfig(configId string) (*GitUserRemoteConfig, error)

func (*GitSCM) UpdateBranch

func (scm *GitSCM) UpdateBranch(branch *GitScmBranchSpec) error

func (*GitSCM) UpdateExtension

func (scm *GitSCM) UpdateExtension(extension GitScmExtension) error

func (*GitSCM) UpdateUserRemoteConfig

func (scm *GitSCM) UpdateUserRemoteConfig(config *GitUserRemoteConfig) error

type GitScmBranchSpec

type GitScmBranchSpec struct {
	Id string `xml:"id,attr,omitempty"`

	Name string `xml:"name"`
}

func NewGitScmBranchSpec

func NewGitScmBranchSpec() *GitScmBranchSpec

type GitScmBranches

type GitScmBranches struct {
	XMLName xml.Name             `xml:"branches"`
	Items   *[]*GitScmBranchSpec `xml:"hudson.plugins.git.BranchSpec"`
}

func NewGitScmBranches

func NewGitScmBranches() *GitScmBranches

func (*GitScmBranches) Append

func (branches *GitScmBranches) Append(branch *GitScmBranchSpec) *GitScmBranches

type GitScmCleanBeforeCheckoutExtension

type GitScmCleanBeforeCheckoutExtension struct {
	XMLName xml.Name `xml:"hudson.plugins.git.extensions.impl.CleanBeforeCheckout"`
	Id      string   `xml:"id,attr,omitempty"`
}

func NewGitScmCleanBeforeCheckoutExtension

func NewGitScmCleanBeforeCheckoutExtension() *GitScmCleanBeforeCheckoutExtension

func (*GitScmCleanBeforeCheckoutExtension) GetId

func (*GitScmCleanBeforeCheckoutExtension) SetId added in v0.1.0

type GitScmExtension

type GitScmExtension interface {
	GetId() string
	SetId(string)
}

type GitScmExtensions

type GitScmExtensions struct {
	Items *[]GitScmExtension
}

func NewGitScmExtensions

func NewGitScmExtensions() *GitScmExtensions

func (*GitScmExtensions) Append

func (extensions *GitScmExtensions) Append(extension GitScmExtension) *GitScmExtensions

func (*GitScmExtensions) UnmarshalXML

func (extensions *GitScmExtensions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type GitScmSubmodulesConfig added in v0.1.0

type GitScmSubmodulesConfig struct {
	Class string `xml:"class,attr"`
}

func NewGitScmSubmodulesConfig added in v0.1.0

func NewGitScmSubmodulesConfig() *GitScmSubmodulesConfig

type GitUserRemoteConfig

type GitUserRemoteConfig struct {
	Id            string `xml:"id,attr,omitempty"`
	Refspec       string `xml:"refspec"`
	Url           string `xml:"url"`
	CredentialsId string `xml:"credentialsId"`
}

func NewGitUserRemoteConfig

func NewGitUserRemoteConfig() *GitUserRemoteConfig

type GitUserRemoteConfigs

type GitUserRemoteConfigs struct {
	XMLName xml.Name                `xml:"userRemoteConfigs"`
	Items   *[]*GitUserRemoteConfig `xml:"hudson.plugins.git.UserRemoteConfig"`
}

func NewGitUserRemoteConfigs

func NewGitUserRemoteConfigs() *GitUserRemoteConfigs

func (*GitUserRemoteConfigs) Append

type JenkinsError

type JenkinsError struct {
	XMLName xml.Name `xml:"html"`
	Title   string
	Message string
}

JenkinsError Error response from jenkins

func (*JenkinsError) Error

func (r *JenkinsError) Error() string

For error interface

func (*JenkinsError) UnmarshalXML

func (jenkinsError *JenkinsError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Job

type Job struct {
	Id               string
	Plugin           string
	Name             string
	Disabled         bool
	Actions          *JobActions `xml:"actions"`
	Description      string
	KeepDependencies bool
	Properties       *JobProperties
	Definition       JobDefinition
}

Job

func NewJob

func NewJob() *Job

NewJob return Job object with default values

func (*Job) DeleteAction added in v0.1.0

func (job *Job) DeleteAction(actionId string) error

func (*Job) DeleteProperty

func (job *Job) DeleteProperty(propertyId string) error

func (*Job) Folder

func (job *Job) Folder() string

func (*Job) GetAction added in v0.1.0

func (job *Job) GetAction(actionId string) (JobAction, error)

func (*Job) GetProperty

func (job *Job) GetProperty(propertyId string) (JobProperty, error)

func (*Job) NameOnly

func (job *Job) NameOnly() string

func (*Job) UpdateAction added in v0.1.0

func (job *Job) UpdateAction(action JobAction) error

func (*Job) UpdateProperty added in v0.1.0

func (job *Job) UpdateProperty(property JobProperty) error

type JobAction added in v0.1.0

type JobAction interface {
	GetId() string
	SetId(string)
}

type JobActions added in v0.1.0

type JobActions struct {
	XMLName xml.Name     `xml:"actions"`
	Items   *[]JobAction `xml:",any"`
}

func NewJobActions added in v0.1.0

func NewJobActions() *JobActions

func (*JobActions) Append added in v0.1.0

func (actions *JobActions) Append(action JobAction) *JobActions

func (*JobActions) UnmarshalXML added in v0.1.0

func (actions *JobActions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobBuildDiscarderProperty

type JobBuildDiscarderProperty struct {
	XMLName xml.Name `xml:"jenkins.model.BuildDiscarderProperty"`
	Id      string   `xml:"id,attr"`

	Strategy *JobBuildDiscarderPropertyStrategyXml `xml:"strategy"`
}

func NewJobBuildDiscarderProperty

func NewJobBuildDiscarderProperty() *JobBuildDiscarderProperty

func (*JobBuildDiscarderProperty) GetId

func (p *JobBuildDiscarderProperty) GetId() string

func (*JobBuildDiscarderProperty) SetId added in v0.1.0

func (p *JobBuildDiscarderProperty) SetId(id string)

type JobBuildDiscarderPropertyStrategy

type JobBuildDiscarderPropertyStrategy interface {
	GetId() string
	SetId(string)
}

type JobBuildDiscarderPropertyStrategyLogRotator

type JobBuildDiscarderPropertyStrategyLogRotator struct {
	Id    string `xml:"id,attr,omitempty"`
	Class string `xml:"class,attr"`

	DaysToKeep         int `xml:"daysToKeep"`
	NumToKeep          int `xml:"numToKeep"`
	ArtifactDaysToKeep int `xml:"artifactDaysToKeep"`
	ArtifactNumToKeep  int `xml:"artifactNumToKeep"`
}

func NewJobBuildDiscarderPropertyStrategyLogRotator

func NewJobBuildDiscarderPropertyStrategyLogRotator() *JobBuildDiscarderPropertyStrategyLogRotator

func (*JobBuildDiscarderPropertyStrategyLogRotator) GetId added in v0.1.0

func (*JobBuildDiscarderPropertyStrategyLogRotator) SetId added in v0.1.0

type JobBuildDiscarderPropertyStrategyXml

type JobBuildDiscarderPropertyStrategyXml struct {
	Item JobBuildDiscarderPropertyStrategy `xml:",any"`
}

func NewJobBuildDiscarderPropertyStrategyXml

func NewJobBuildDiscarderPropertyStrategyXml() *JobBuildDiscarderPropertyStrategyXml

func (*JobBuildDiscarderPropertyStrategyXml) MarshalXML

func (strategy *JobBuildDiscarderPropertyStrategyXml) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*JobBuildDiscarderPropertyStrategyXml) UnmarshalXML

func (strategy *JobBuildDiscarderPropertyStrategyXml) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobDatadogJobProperty added in v0.1.0

type JobDatadogJobProperty struct {
	XMLName xml.Name `xml:"org.datadog.jenkins.plugins.datadog.DatadogJobProperty"`
	Id      string   `xml:"id,attr,omitempty"`
	Plugin  string   `xml:"plugin,attr,omitempty"`

	EmitOnCheckout bool `xml:"emitOnCheckout"`
}

func NewJobDatadogJobProperty added in v0.1.0

func NewJobDatadogJobProperty() *JobDatadogJobProperty

func (*JobDatadogJobProperty) GetId added in v0.1.0

func (property *JobDatadogJobProperty) GetId() string

func (*JobDatadogJobProperty) SetId added in v0.1.0

func (p *JobDatadogJobProperty) SetId(id string)

type JobDeclarativeJobAction added in v0.1.0

type JobDeclarativeJobAction struct {
	XMLName xml.Name `xml:"org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobAction"`
	Id      string   `xml:"id,attr,omitempty"`
	Plugin  string   `xml:"plugin,attr,omitempty"`
}

func NewJobDeclarativeJobAction added in v0.1.0

func NewJobDeclarativeJobAction() *JobDeclarativeJobAction

func (*JobDeclarativeJobAction) GetId added in v0.1.0

func (action *JobDeclarativeJobAction) GetId() string

func (*JobDeclarativeJobAction) SetId added in v0.1.0

func (a *JobDeclarativeJobAction) SetId(id string)

type JobDeclarativeJobPropertyTrackerAction added in v0.1.0

type JobDeclarativeJobPropertyTrackerAction struct {
	XMLName xml.Name `xml:"org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction"`
	Id      string   `xml:"id,attr,omitempty"`
	Plugin  string   `xml:"plugin,attr,omitempty"`

	JobProperties string `xml:"jobProperties"`
	Triggers      string `xml:"triggers"`
	Parameters    string `xml:"parameters"`
	Options       string `xml:"options"`
}

func NewJobDeclarativeJobPropertyTrackerAction added in v0.1.0

func NewJobDeclarativeJobPropertyTrackerAction() *JobDeclarativeJobPropertyTrackerAction

func (*JobDeclarativeJobPropertyTrackerAction) GetId added in v0.1.0

func (*JobDeclarativeJobPropertyTrackerAction) SetId added in v0.1.0

type JobDefinition

type JobDefinition interface {
	GetId() string
	SetId(string)
}

type JobDefinitionXml

type JobDefinitionXml struct {
	Item JobDefinition
}

func (*JobDefinitionXml) MarshalXML

func (jobDefinition *JobDefinitionXml) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*JobDefinitionXml) UnmarshalXML

func (jobDefinition *JobDefinitionXml) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobDisableConcurrentBuildsJobProperty added in v0.3.0

type JobDisableConcurrentBuildsJobProperty struct {
	XMLName xml.Name `xml:"org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty"`
	Id      string   `xml:"id,attr,omitempty"`
	Plugin  string   `xml:"plugin,attr,omitempty"`
}

func NewJobDisableConcurrentBuildsJobProperty added in v0.3.0

func NewJobDisableConcurrentBuildsJobProperty() *JobDisableConcurrentBuildsJobProperty

func (*JobDisableConcurrentBuildsJobProperty) GetId added in v0.3.0

func (*JobDisableConcurrentBuildsJobProperty) SetId added in v0.3.0

type JobGerritTrigger

type JobGerritTrigger struct {
	XMLName xml.Name `xml:"com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger"`
	Id      string   `xml:"id,attr,omitempty"`
	Plugin  string   `xml:"plugin,attr,omitempty"`

	Spec                        string                    `xml:"spec"`
	Projects                    *JobGerritTriggerProjects `xml:"gerritProjects"`
	DynamicGerritProjects       *DynamicGerritProjects    `xml:"dynamicGerritProjects"`
	SkipVote                    *JobGerritTriggerSkipVote `xml:"skipVote"`
	SilentMode                  bool                      `xml:"silentMode"`
	NotificationLevel           string                    `xml:"notificationLevel"`
	SilentStartMode             bool                      `xml:"silentStartMode"`
	EscapeQuotes                bool                      `xml:"escapeQuotes"`
	NameAndEmailParameterMode   ParameterMode             `xml:"nameAndEmailParameterMode"`
	DependencyJobsNames         string                    `xml:"dependencyJobsNames"`
	CommitMessageParameterMode  ParameterMode             `xml:"commitMessageParameterMode"`
	ChangeSubjectParameterMode  ParameterMode             `xml:"changeSubjectParameterMode"`
	CommentTextParameterMode    ParameterMode             `xml:"commentTextParameterMode"`
	BuildStartMessage           string                    `xml:"buildStartMessage"`
	BuildFailureMessage         string                    `xml:"buildFailureMessage"`
	BuildSuccessfulMessage      string                    `xml:"buildSuccessfulMessage"`
	BuildUnstableMessage        string                    `xml:"buildUnstableMessage"`
	BuildNotBuiltMessage        string                    `xml:"buildNotBuiltMessage"`
	BuildUnsuccessfulFilepath   string                    `xml:"buildUnsuccessfulFilepath"`
	CustomUrl                   string                    `xml:"customUrl"`
	ServerName                  string                    `xml:"serverName"`
	TriggerOnEvents             *JobGerritTriggerOnEvents `xml:"triggerOnEvents"`
	DynamicTriggerConfiguration bool                      `xml:"dynamicTriggerConfiguration"`
	TriggerConfigURL            string                    `xml:"triggerConfigURL"`
	TriggerInformationAction    string                    `xml:"triggerInformationAction"`
}

func NewJobGerritTrigger

func NewJobGerritTrigger() *JobGerritTrigger

func (*JobGerritTrigger) DeleteEvent

func (trigger *JobGerritTrigger) DeleteEvent(eventId string) error

func (*JobGerritTrigger) DeleteProject

func (trigger *JobGerritTrigger) DeleteProject(projectId string) error

func (*JobGerritTrigger) GetEvent

func (trigger *JobGerritTrigger) GetEvent(eventId string) (JobGerritTriggerOnEvent, error)

func (*JobGerritTrigger) GetId

func (trigger *JobGerritTrigger) GetId() string

func (*JobGerritTrigger) GetProject

func (trigger *JobGerritTrigger) GetProject(projectId string) (*JobGerritTriggerProject, error)

func (*JobGerritTrigger) SetId added in v0.1.0

func (t *JobGerritTrigger) SetId(id string)

func (*JobGerritTrigger) UpdateEvent

func (trigger *JobGerritTrigger) UpdateEvent(event JobGerritTriggerOnEvent) error

func (*JobGerritTrigger) UpdateProject

func (trigger *JobGerritTrigger) UpdateProject(project *JobGerritTriggerProject) error

type JobGerritTriggerBranch

type JobGerritTriggerBranch struct {
	Id          string      `xml:"id,attr,omitempty"`
	CompareType CompareType `xml:"compareType"`
	Pattern     string      `xml:"pattern"`
}

func NewJobGerritTriggerBranch

func NewJobGerritTriggerBranch() *JobGerritTriggerBranch

type JobGerritTriggerBranches

type JobGerritTriggerBranches struct {
	Items *[]*JobGerritTriggerBranch `xml:"com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch"`
}

func NewJobGerritTriggerBranches

func NewJobGerritTriggerBranches() *JobGerritTriggerBranches

func (*JobGerritTriggerBranches) Append

type JobGerritTriggerFilePath added in v0.2.0

type JobGerritTriggerFilePath struct {
	Id          string      `xml:"id,attr,omitempty"`
	CompareType CompareType `xml:"compareType"`
	Pattern     string      `xml:"pattern"`
}

func NewJobGerritTriggerFilePath added in v0.2.0

func NewJobGerritTriggerFilePath() *JobGerritTriggerFilePath

type JobGerritTriggerFilePaths added in v0.2.0

type JobGerritTriggerFilePaths struct {
	Items *[]*JobGerritTriggerFilePath `xml:"com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath"`
}

func NewJobGerritTriggerFilePaths added in v0.2.0

func NewJobGerritTriggerFilePaths() *JobGerritTriggerFilePaths

func (*JobGerritTriggerFilePaths) Append added in v0.2.0

type JobGerritTriggerOnEvent

type JobGerritTriggerOnEvent interface {
	GetId() string
	SetId(string)
}

type JobGerritTriggerOnEvents

type JobGerritTriggerOnEvents struct {
	XMLName xml.Name `xml:"triggerOnEvents"`
	Class   string   `xml:"class,attr"`
	Items   *[]JobGerritTriggerOnEvent
}

func NewJobGerritTriggerOnEvents

func NewJobGerritTriggerOnEvents() *JobGerritTriggerOnEvents

func (*JobGerritTriggerOnEvents) Append

func (*JobGerritTriggerOnEvents) UnmarshalXML

func (events *JobGerritTriggerOnEvents) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobGerritTriggerPluginChangeMergedEvent added in v0.2.0

type JobGerritTriggerPluginChangeMergedEvent struct {
	XMLName xml.Name `xml:"com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent"`
	Id      string   `xml:"id,attr,omitempty"`
}

func NewJobGerritTriggerPluginChangeMergedEvent added in v0.2.0

func NewJobGerritTriggerPluginChangeMergedEvent() *JobGerritTriggerPluginChangeMergedEvent

func (*JobGerritTriggerPluginChangeMergedEvent) GetId added in v0.2.0

func (*JobGerritTriggerPluginChangeMergedEvent) SetId added in v0.2.0

type JobGerritTriggerPluginDraftPublishedEvent

type JobGerritTriggerPluginDraftPublishedEvent struct {
	XMLName xml.Name `xml:"com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent"`
	Id      string   `xml:"id,attr,omitempty"`
}

func NewJobGerritTriggerPluginDraftPublishedEvent

func NewJobGerritTriggerPluginDraftPublishedEvent() *JobGerritTriggerPluginDraftPublishedEvent

func (*JobGerritTriggerPluginDraftPublishedEvent) GetId

func (*JobGerritTriggerPluginDraftPublishedEvent) SetId added in v0.1.0

type JobGerritTriggerPluginPatchsetCreatedEvent

type JobGerritTriggerPluginPatchsetCreatedEvent struct {
	XMLName xml.Name `xml:"com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent"`
	Id      string   `xml:"id,attr,omitempty"`

	ExcludeDrafts        bool `xml:"excludeDrafts"`
	ExcludeTrivialRebase bool `xml:"excludeTrivialRebase"`
	ExcludeNoCodeChange  bool `xml:"excludeNoCodeChange"`
	ExcludePrivateState  bool `xml:"excludePrivateState"`
	ExcludeWipState      bool `xml:"excludeWipState"`
}

func NewJobGerritTriggerPluginPatchsetCreatedEvent

func NewJobGerritTriggerPluginPatchsetCreatedEvent() *JobGerritTriggerPluginPatchsetCreatedEvent

func (*JobGerritTriggerPluginPatchsetCreatedEvent) GetId

func (*JobGerritTriggerPluginPatchsetCreatedEvent) SetId added in v0.1.0

type JobGerritTriggerProject

type JobGerritTriggerProject struct {
	XMLName xml.Name `xml:"com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject"`
	Id      string   `xml:"id,attr,omitempty"`

	CompareType CompareType                `xml:"compareType"`
	Pattern     string                     `xml:"pattern"`
	Branches    *JobGerritTriggerBranches  `xml:"branches"`
	FilePaths   *JobGerritTriggerFilePaths `xml:"filePaths"`

	DisableStrictForbiddenFileVerification bool `xml:"disableStrictForbiddenFileVerification"`
}

func NewJobGerritTriggerProject

func NewJobGerritTriggerProject() *JobGerritTriggerProject

func (*JobGerritTriggerProject) DeleteBranch

func (project *JobGerritTriggerProject) DeleteBranch(branchId string) error

func (*JobGerritTriggerProject) DeleteFilePath added in v0.2.0

func (project *JobGerritTriggerProject) DeleteFilePath(filePathId string) error

func (*JobGerritTriggerProject) GetBranch

func (project *JobGerritTriggerProject) GetBranch(branchId string) (*JobGerritTriggerBranch, error)

func (*JobGerritTriggerProject) GetFilePath added in v0.2.0

func (project *JobGerritTriggerProject) GetFilePath(filePathId string) (*JobGerritTriggerFilePath, error)

func (*JobGerritTriggerProject) UpdateBranch

func (project *JobGerritTriggerProject) UpdateBranch(branch *JobGerritTriggerBranch) error

func (*JobGerritTriggerProject) UpdateFilePath added in v0.2.0

func (project *JobGerritTriggerProject) UpdateFilePath(filePath *JobGerritTriggerFilePath) error

type JobGerritTriggerProjects

type JobGerritTriggerProjects struct {
	Items *[]*JobGerritTriggerProject `xml:",any"`
}

func NewJobGerritTriggerProjects

func NewJobGerritTriggerProjects() *JobGerritTriggerProjects

func (*JobGerritTriggerProjects) Append

type JobGerritTriggerSkipVote

type JobGerritTriggerSkipVote struct {
	OnSuccessful bool `xml:"onSuccessful"`
	OnFailed     bool `xml:"onFailed"`
	OnUnstable   bool `xml:"onUnstable"`
	OnNotBuilt   bool `xml:"onNotBuilt"`
}

func NewJobGerritTriggerSkipVote

func NewJobGerritTriggerSkipVote() *JobGerritTriggerSkipVote

type JobJiraProjectProperty added in v0.1.0

type JobJiraProjectProperty struct {
	XMLName xml.Name `xml:"hudson.plugins.jira.JiraProjectProperty"`
	Id      string   `xml:"id,attr,omitempty"`
	Plugin  string   `xml:"plugin,attr,omitempty"`
}

func NewJobJiraProjectProperty added in v0.1.0

func NewJobJiraProjectProperty() *JobJiraProjectProperty

func (*JobJiraProjectProperty) GetId added in v0.1.0

func (property *JobJiraProjectProperty) GetId() string

func (*JobJiraProjectProperty) SetId added in v0.1.0

func (p *JobJiraProjectProperty) SetId(id string)

type JobParameterDefinition added in v0.3.0

type JobParameterDefinition interface {
	GetId() string
	SetId(string)
}

type JobParameterDefinitionChoice added in v0.3.0

type JobParameterDefinitionChoice struct {
	Id      string   `xml:"id,attr,omitempty"`
	XMLName xml.Name `xml:"hudson.model.ChoiceParameterDefinition"`

	Name        string `xml:"name"`
	Description string `xml:"description"`

	Choices *JobParameterDefinitionChoiceList `xml:"choices"`
}

func NewJobParameterDefinitionChoice added in v0.3.0

func NewJobParameterDefinitionChoice() *JobParameterDefinitionChoice

func (*JobParameterDefinitionChoice) GetId added in v0.3.0

func (*JobParameterDefinitionChoice) SetId added in v0.3.0

func (d *JobParameterDefinitionChoice) SetId(id string)

type JobParameterDefinitionChoiceList added in v0.3.0

type JobParameterDefinitionChoiceList struct {
	XMLName xml.Name                               `xml:"choices"`
	Class   string                                 `xml:"class,attr,omitempty"`
	Items   *JobParameterDefinitionChoiceListArray `xml:"a"`
}

func NewJobParameterDefinitionChoiceList added in v0.3.0

func NewJobParameterDefinitionChoiceList() *JobParameterDefinitionChoiceList

func (*JobParameterDefinitionChoiceList) Append added in v0.3.0

type JobParameterDefinitionChoiceListArray added in v0.3.0

type JobParameterDefinitionChoiceListArray struct {
	XMLName xml.Name  `xml:"a"`
	Class   string    `xml:"class,attr,omitempty"`
	Items   *[]string `xml:"string"`
}

func NewJobParameterDefinitionChoiceListArray added in v0.3.0

func NewJobParameterDefinitionChoiceListArray() *JobParameterDefinitionChoiceListArray

func (*JobParameterDefinitionChoiceListArray) Append added in v0.3.0

type JobParameterDefinitions added in v0.3.0

type JobParameterDefinitions struct {
	XMLName xml.Name `xml:"parameterDefinitions"`
	Items   *[]JobParameterDefinition
}

func NewJobParameterDefinitions added in v0.3.0

func NewJobParameterDefinitions() *JobParameterDefinitions

func (*JobParameterDefinitions) Append added in v0.3.0

func (*JobParameterDefinitions) UnmarshalXML added in v0.3.0

func (defs *JobParameterDefinitions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobParametersDefinitionProperty added in v0.3.0

type JobParametersDefinitionProperty struct {
	XMLName xml.Name `xml:"hudson.model.ParametersDefinitionProperty"`
	Id      string   `xml:"id,attr,omitempty"`
	Plugin  string   `xml:"plugin,attr,omitempty"`

	ParameterDefinitions *JobParameterDefinitions `xml:"parameterDefinitions"`
}

func NewJobParametersDefinitionProperty added in v0.3.0

func NewJobParametersDefinitionProperty() *JobParametersDefinitionProperty

func (*JobParametersDefinitionProperty) DeleteParameterDefinition added in v0.3.0

func (property *JobParametersDefinitionProperty) DeleteParameterDefinition(definitionId string) error

func (*JobParametersDefinitionProperty) GetId added in v0.3.0

func (property *JobParametersDefinitionProperty) GetId() string

func (*JobParametersDefinitionProperty) GetParameterDefinition added in v0.3.0

func (property *JobParametersDefinitionProperty) GetParameterDefinition(
	definitionId string,
) (JobParameterDefinition, error)

func (*JobParametersDefinitionProperty) SetId added in v0.3.0

func (*JobParametersDefinitionProperty) UpdateParameterDefinition added in v0.3.0

func (property *JobParametersDefinitionProperty) UpdateParameterDefinition(
	newDefinition JobParameterDefinition,
) error

type JobPipelineTriggersProperty

type JobPipelineTriggersProperty struct {
	XMLName  xml.Name     `xml:"org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty"`
	Id       string       `xml:"id,attr,omitempty"`
	Triggers *JobTriggers `xml:"triggers"`
}

func NewJobPipelineTriggersProperty

func NewJobPipelineTriggersProperty() *JobPipelineTriggersProperty

func (*JobPipelineTriggersProperty) DeleteTrigger

func (property *JobPipelineTriggersProperty) DeleteTrigger(triggerId string) error

func (*JobPipelineTriggersProperty) GetId

func (property *JobPipelineTriggersProperty) GetId() string

func (*JobPipelineTriggersProperty) GetTrigger

func (property *JobPipelineTriggersProperty) GetTrigger(triggerId string) (JobTrigger, error)

func (*JobPipelineTriggersProperty) SetId added in v0.1.0

func (p *JobPipelineTriggersProperty) SetId(id string)

func (*JobPipelineTriggersProperty) UpdateTrigger

func (property *JobPipelineTriggersProperty) UpdateTrigger(newTrigger JobTrigger) error

type JobProperties

type JobProperties struct {
	XMLName xml.Name       `xml:"properties"`
	Items   *[]JobProperty `xml:",any"`
}

func NewJobProperties

func NewJobProperties() *JobProperties

func (*JobProperties) Append

func (properties *JobProperties) Append(property JobProperty) *JobProperties

func (*JobProperties) UnmarshalXML

func (properties *JobProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobProperty

type JobProperty interface {
	GetId() string
	SetId(string)
}

type JobService

type JobService struct {
	*Client
}

JobService for interacting with jenkins jobs

func (*JobService) CreateJob

func (service *JobService) CreateJob(job *Job) error

func (*JobService) DeleteJob

func (service *JobService) DeleteJob(jobFullName string) error

func (*JobService) GetJob

func (service *JobService) GetJob(jobFullName string) (*Job, error)

func (*JobService) GetJobs

func (service *JobService) GetJobs(folder string) (*[]*Job, error)

GetJobs get all jobs

func (*JobService) UpdateJob

func (service *JobService) UpdateJob(job *Job) error

type JobTrigger

type JobTrigger interface {
	GetId() string
	SetId(string)
}

type JobTriggers

type JobTriggers struct {
	XMLName xml.Name `xml:"triggers"`
	Items   *[]JobTrigger
}

func NewJobTriggers

func NewJobTriggers() *JobTriggers

func (*JobTriggers) Append

func (triggers *JobTriggers) Append(trigger JobTrigger) *JobTriggers

func (*JobTriggers) UnmarshalXML

func (triggers *JobTriggers) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobsResponse

type JobsResponse struct {
	Jobs *[]*jobDetails `xml:"job"`
}

type ParameterMode

type ParameterMode int
const (
	ParameterModeUnknown ParameterMode = iota
	ParameterModePlain
	ParameterModeBase64
)

func ParseParameterMode

func ParseParameterMode(s string) (ParameterMode, error)

func (ParameterMode) MarshalXML

func (t ParameterMode) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (ParameterMode) String

func (t ParameterMode) String() string

func (*ParameterMode) UnmarshalXML

func (t *ParameterMode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Source Files

Jump to

Keyboard shortcuts

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