client

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentLabel added in v0.0.18

type AgentLabel struct {
	Name string
}

type AvailablePlugin added in v0.0.18

type AvailablePlugin struct {
	Plugin

	// for the available list
	Name      string
	Installed bool
	Website   string
	Title     string
}

type AvailablePluginList added in v0.0.18

type AvailablePluginList struct {
	Data   []AvailablePlugin
	Status string
}

type Cause

type Cause struct {
	UpstreamUrl      string
	UpstreamProject  string
	UpstreamBuild    int
	ShortDescription string
}

type CauseAction

type CauseAction struct {
	Causes []Cause
}

type CenterSite

type CenterSite struct {
	ConnectionCheckURL string `json:"connectionCheckUrl"`
	HasUpdates         bool
	ID                 string `json:"id"`
	URL                string `json:"url"`
}

CenterSite represents the site of update center

type CoreClient added in v0.0.18

type CoreClient struct {
	JenkinsCore
}

func (*CoreClient) Restart added in v0.0.18

func (q *CoreClient) Restart() (err error)

Search find a set of jobs by name

type DefaultParameterValue added in v0.0.18

type DefaultParameterValue struct {
	Description string
	Value       interface{}
}

type InstallStates added in v0.0.18

type InstallStates struct {
	Data   InstallStatesData
	Status string
}

type InstallStatesData added in v0.0.18

type InstallStatesData struct {
	Jobs  InstallStatesJob
	State string
}

type InstallStatesJob added in v0.0.18

type InstallStatesJob struct {
	InstallStatus   string
	Name            string
	RequiresRestart string
	Title           string
	Version         string
}

type InstallationJob added in v0.0.18

type InstallationJob struct {
	UpdateCenterJob

	Name   string
	Status InstallationJobStatus
}

type InstallationJobStatus added in v0.0.18

type InstallationJobStatus struct {
	Success bool
	Type    string
}

type InstalledPlugin added in v0.0.18

type InstalledPlugin struct {
	Plugin

	Enable             bool
	ShortName          string
	LongName           string
	Version            string
	URL                string
	HasUpdate          bool
	Pinned             bool
	RequiredCoreVesion string
	MinimumJavaVersion string
	SupportDynamicLoad string
	BackVersion        string
}

InstalledPlugin represent the installed plugin from Jenkins

type InstalledPluginList added in v0.0.18

type InstalledPluginList struct {
	Plugins []InstalledPlugin
}

PluginList represent a list of plugins

type JenkinsCore

type JenkinsCore struct {
	JenkinsCrumb
	URL       string
	UserName  string
	Token     string
	Proxy     string
	ProxyAuth string

	Debug bool
}

func (*JenkinsCore) AuthHandle

func (j *JenkinsCore) AuthHandle(request *http.Request) (err error)

func (*JenkinsCore) CrumbHandle

func (j *JenkinsCore) CrumbHandle(request *http.Request) error

func (*JenkinsCore) GetClient added in v0.0.10

func (j *JenkinsCore) GetClient() (client *http.Client)

func (*JenkinsCore) GetCrumb

func (j *JenkinsCore) GetCrumb() (*JenkinsCrumb, error)

func (*JenkinsCore) ProxyHandle added in v0.0.18

func (j *JenkinsCore) ProxyHandle(request *http.Request)

type JenkinsCrumb

type JenkinsCrumb struct {
	CrumbRequestField string
	Crumb             string
}

type JenkinsStatus added in v0.0.18

type JenkinsStatus struct {
	AssignedLabels  []AgentLabel
	Description     string
	Jobs            []Job
	Mode            string
	NodeDescription string
	NodeName        string
	NumExecutors    int
	PrimaryView     View
	QuietingDown    bool
	SlaveAgentPort  int
	UseCrumbs       bool
	UseSecurity     bool
	Views           []View
	Version         string
}

type JenkinsStatusClient added in v0.0.18

type JenkinsStatusClient struct {
	JenkinsCore
}

func (*JenkinsStatusClient) Get added in v0.0.18

func (q *JenkinsStatusClient) Get() (status *JenkinsStatus, err error)

type Job added in v0.0.10

type Job struct {
	Type            string `json:"_class"`
	Builds          []JobBuild
	Color           string
	ConcurrentBuild bool
	Name            string
	NextBuildNumber int
	URL             string
	Buildable       bool

	Property []ParametersDefinitionProperty
}

type JobBuild added in v0.0.10

type JobBuild struct {
	SimpleJobBuild
	Building          bool
	Description       string
	DisplayName       string
	Duration          int64
	EstimatedDuration int64
	FullDisplayName   string
	ID                string
	KeepLog           bool
	QueueID           int
	Result            string
	Timestamp         int64
	PreviousBuild     SimpleJobBuild
	NextBuild         SimpleJobBuild
}

type JobCategory added in v0.0.18

type JobCategory struct {
	Description string
	ID          string
	Items       []JobCategoryItem
	MinToShow   int
	Name        string
	Order       int
}

type JobCategoryItem added in v0.0.18

type JobCategoryItem struct {
	Description string
	DisplayName string
	Order       int
	Class       string
}

type JobClient added in v0.0.10

type JobClient struct {
	JenkinsCore
}

func (*JobClient) Build added in v0.0.10

func (q *JobClient) Build(jobName string) (err error)

func (*JobClient) BuildWithParams added in v0.0.18

func (q *JobClient) BuildWithParams(jobName string, parameters []ParameterDefinition) (err error)

func (*JobClient) Create added in v0.0.18

func (q *JobClient) Create(jobName string, jobType string) (err error)

func (*JobClient) Delete added in v0.0.18

func (q *JobClient) Delete(jobName string) (err error)

func (*JobClient) GetBuild added in v0.0.18

func (q *JobClient) GetBuild(jobName string, id int) (job *JobBuild, err error)

func (*JobClient) GetHistory added in v0.0.10

func (q *JobClient) GetHistory(name string) (builds []JobBuild, err error)

func (*JobClient) GetJob added in v0.0.10

func (q *JobClient) GetJob(name string) (job *Job, err error)

func (*JobClient) GetJobTypeCategories added in v0.0.18

func (q *JobClient) GetJobTypeCategories() (jobCategories []JobCategory, err error)

func (*JobClient) GetPipeline added in v0.0.18

func (q *JobClient) GetPipeline(name string) (pipeline *Pipeline, err error)

func (*JobClient) Log added in v0.0.10

func (q *JobClient) Log(jobName string, history int, start int64) (jobLog JobLog, err error)

Log get the log of a job

func (*JobClient) Search added in v0.0.10

func (q *JobClient) Search(keyword string) (status *SearchResult, err error)

Search find a set of jobs by name

func (*JobClient) StopJob added in v0.0.18

func (q *JobClient) StopJob(jobName string, num int) (err error)

func (*JobClient) UpdatePipeline added in v0.0.18

func (q *JobClient) UpdatePipeline(name, script string) (err error)

type JobLog added in v0.0.10

type JobLog struct {
	HasMore   bool
	NextStart int64
	Text      string
}

type JobQueue

type JobQueue struct {
	Items []QueueItem
}

type ParameterDefinition added in v0.0.18

type ParameterDefinition struct {
	Description           string
	Name                  string `json:"name"`
	Type                  string
	Value                 string `json:"value"`
	DefaultParameterValue DefaultParameterValue
}

type ParametersDefinitionProperty added in v0.0.18

type ParametersDefinitionProperty struct {
	ParameterDefinitions []ParameterDefinition
}

type Pipeline added in v0.0.18

type Pipeline struct {
	Script  string
	Sandbox bool
}

type Plugin

type Plugin struct {
	Active       bool
	Enabled      bool
	Bundled      bool
	Downgradable bool
	Deleted      bool
}

type PluginAPI added in v0.0.18

type PluginAPI struct {
	// contains filtered or unexported fields
}

func (*PluginAPI) DownloadPlugins added in v0.0.18

func (d *PluginAPI) DownloadPlugins(names []string)

DownloadPlugins will download those plugins from update center

func (*PluginAPI) ShowTrend added in v0.0.18

func (a *PluginAPI) ShowTrend(name string)

type PluginDependency added in v0.0.18

type PluginDependency struct {
	Name     string `json:"name"`
	Implied  bool   `json:"implied"`
	Optional bool   `json:"optional"`
	Title    string `json:"title"`
	Version  string `json:"version"`
}

type PluginInfo added in v0.0.18

type PluginInfo struct {
	BuildDate         string             `json:"buildDate"`
	Dependencies      []PluginDependency `json:"dependencies"`
	Excerpt           string             `json:"excerpt"`
	FirstRelease      string             `json:"firstRelease"`
	Gav               string             `json:"gav"`
	Name              string             `json:"name"`
	PreviousTimestamp string             `json:"previousTimestamp"`
	PreviousVersion   string             `json:"previousVersion"`
	ReleaseTimestamp  string             `json:"releaseTimestamp"`
	RequireCore       string             `json:"RequireCore"`
	Title             string             `json:"title"`
	URL               string             `json:"url"`
	Version           string             `json:"version"`

	Stats PluginInfoStats
}

type PluginInfoStats added in v0.0.18

type PluginInfoStats struct {
	CurrentInstalls                   int
	Installations                     []PluginInstallationInfo
	InstallationsPerVersion           []PluginInstallationInfo
	InstallationsPercentage           []PluginInstallationInfo
	InstallationsPercentagePerVersion []PluginInstallationInfo
	Trend                             int
}

type PluginInstallationInfo added in v0.0.18

type PluginInstallationInfo struct {
	Timestamp  int64
	Total      int
	Version    string
	Percentage float64
}

type PluginManager

type PluginManager struct {
	JenkinsCore
}

func (*PluginManager) CheckUpdate

func (p *PluginManager) CheckUpdate(handle func(*http.Response))

CheckUpdate fetch the lastest plugins from update center site

func (*PluginManager) GetAvailablePlugins added in v0.0.18

func (p *PluginManager) GetAvailablePlugins() (pluginList *AvailablePluginList, err error)

func (*PluginManager) GetPlugins

func (p *PluginManager) GetPlugins() (pluginList *InstalledPluginList, err error)

func (*PluginManager) InstallPlugin

func (p *PluginManager) InstallPlugin(names []string) (err error)

InstallPlugin install a plugin by name

func (*PluginManager) UninstallPlugin

func (p *PluginManager) UninstallPlugin(name string) (err error)

UninstallPlugin uninstall a plugin by name

func (*PluginManager) Upload added in v0.0.18

func (p *PluginManager) Upload(pluginFile string)

Upload will upload a file from local filesystem into Jenkins

type QueueClient

type QueueClient struct {
	JenkinsCore
}

func (*QueueClient) Get

func (q *QueueClient) Get() (status *JobQueue, err error)

type QueueItem

type QueueItem struct {
	Blocked                    bool
	Buildable                  bool
	ID                         int
	Params                     string
	Pending                    bool
	Stuck                      bool
	URL                        string
	Why                        string
	BuildableStartMilliseconds int64
	InQueueSince               int64
	Actions                    []CauseAction
}

type SearchResult added in v0.0.10

type SearchResult struct {
	Suggestions []SearchResultItem
}

type SearchResultItem added in v0.0.10

type SearchResultItem struct {
	Name string
}

type SimpleJobBuild added in v0.0.18

type SimpleJobBuild struct {
	Number int
	URL    string
}

type Token added in v0.0.18

type Token struct {
	Status string
	Data   TokenData
}

type TokenData added in v0.0.18

type TokenData struct {
	TokenName  string
	TokenUuid  string
	TokenValue string
}

type UpdateCenter

type UpdateCenter struct {
	Availables                   []Plugin
	Jobs                         []InstallationJob
	RestartRequiredForCompletion bool
	Sites                        []CenterSite
}

UpdateCenter represents the update center of Jenkins

type UpdateCenterJob

type UpdateCenterJob struct {
	ErrorMessage string
	ID           int `json:"id"`
	Type         string
}

UpdateCenterJob represents the job for updateCenter which execute a task

type UpdateCenterManager

type UpdateCenterManager struct {
	JenkinsCore
}

UpdateCenterManager manages the UpdateCenter

func (*UpdateCenterManager) Status

func (u *UpdateCenterManager) Status() (status *UpdateCenter, err error)

func (*UpdateCenterManager) Upgrade added in v0.0.19

func (u *UpdateCenterManager) Upgrade() (err error)

Upgrade the Jenkins core

type User added in v0.0.18

type User struct {
	AbsoluteURL string `json:"absoluteUrl"`
	Description string
	FullName    string `json:"fullname"`
	ID          string
}

type UserClient added in v0.0.18

type UserClient struct {
	JenkinsCore
}

func (*UserClient) Create added in v0.0.18

func (q *UserClient) Create(username string) (user *UserForCreate, err error)

func (*UserClient) CreateToken added in v0.0.18

func (q *UserClient) CreateToken(newTokenName string) (status *Token, err error)

func (*UserClient) Delete added in v0.0.18

func (q *UserClient) Delete(username string) (err error)

func (*UserClient) EditDesc added in v0.0.18

func (q *UserClient) EditDesc(description string) (err error)

func (*UserClient) Get added in v0.0.18

func (q *UserClient) Get() (status *User, err error)

type UserForCreate added in v0.0.18

type UserForCreate struct {
	User      `json:inline`
	Username  string `json:"username"`
	Password1 string `json:"password1"`
	Password2 string `json:"password2"`
	Email     string `json:"email"`
}

type View added in v0.0.18

type View struct {
	Name string
	URL  string
}

Jump to

Keyboard shortcuts

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