client

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 JenkinsCore

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

func (*JenkinsCore) AuthHandle

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

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)

type JenkinsCrumb

type JenkinsCrumb struct {
	CrumbRequestField string
	Crumb             string
}

type Job added in v0.0.10

type Job struct {
	Builds          []JobBuild
	Color           string
	ConcurrentBuild bool
	Name            string
	NextBuildNumber int
	URL             string
	Buildable       bool
}

type JobBuild added in v0.0.10

type JobBuild struct {
	Number int
	URL    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) 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) 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

type JobLog added in v0.0.10

type JobLog struct {
	HasMore   bool
	NextStart int64
	Text      string
}

type JobQueue

type JobQueue struct {
	Items []QueueItem
}

type Plugin

type Plugin struct {
	Active             bool
	ShortName          string
	LongName           string
	Version            string
	URL                string
	HasUpdate          bool
	Enable             bool
	Downgradable       bool
	Pinned             bool
	RequiredCoreVesion string
	MinimumJavaVersion string
	SupportDynamicLoad string
	Deleted            bool
	Bundled            bool
	BackVersion        string
}

Plugin represent the plugin from Jenkins

type PluginList

type PluginList struct {
	Plugins []Plugin
}

PluginList represent a list of plugins

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) GetPlugins

func (p *PluginManager) GetPlugins() (pluginList *PluginList, 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

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 UpdateCenter

type UpdateCenter struct {
	Availables                   []Plugin
	Jobs                         []UpdateCenterJob
	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)

Jump to

Keyboard shortcuts

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