Documentation ¶
Index ¶
- Variables
- func Build(env Env, job string, query string) (error, string)
- func CancelJob(env Env, job string, id int) (string, error)
- func CancelQueue(env Env, id int)
- func Check(env Env) error
- func Console(env Env, job string, id int, start string) (string, string, error)
- func DelEnv(name EName) error
- func SetConf()
- func SetDef(eName string)
- func SetEnv(env Env)
- type BuildInfo
- type Bundle
- type Config
- type EName
- type EType
- type Env
- type Job
- type JobInfo
- type ParameterDefinitions
- type QueueInfo
- type Queues
- type View
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
View Source
var ErrNoEnv = errors.New("no env")
View Source
var ErrNoJob = errors.New("no job")
Functions ¶
func CancelQueue ¶
Types ¶
type BuildInfo ¶
type BuildInfo struct { Id string `json:"id"` Actions []struct { Parameters []struct { Name string `json:"name"` Value string `json:"value"` } `json:"parameters,omitempty"` Causes []struct { ShortDescription string `json:"shortDescription"` UpstreamBuild int `json:"upstreamBuild"` UpstreamProject string `json:"upstreamProject"` UpstreamURL string `json:"upstreamUrl"` } `json:"causes,omitempty"` } `json:"actions"` Duration int `json:"duration"` Building bool `json:"building"` Result string `json:"result"` QueueId int `json:"queueId"` }
type Bundle ¶
type Env ¶
type JobInfo ¶
type JobInfo struct { Name string `json:"name"` NextBuildNumber int `json:"nextBuildNumber"` DownstreamProjects []struct { Name string `json:"name"` URL string `json:"url"` } `json:"downstreamProjects"` LastBuild struct { Number int `json:"number"` URL string `json:"url"` } `json:"lastBuild"` LastCompletedBuild struct { Number int `json:"number"` URL string `json:"url"` } InQueue bool `json:"inQueue"` Property []struct { ParameterDefinitions []ParameterDefinitions `json:"parameterDefinitions,omitempty"` } `json:"property"` }
func GetJobInfo ¶
func GetJobInfo(env Env, jobName string) JobInfo{ var jobinfo JobInfo code, rsp, _, err := req(env,"job/"+jobName+"/api/json", []byte{}) if err != nil { panic(err) } if code != 200 { panic("failed to get job details,code" + strconv.Itoa(code) + ", " + string(rsp)) } err = json.Unmarshal(rsp, &jobinfo) if err!=nil{ panic("failed to get Job information") } return jobinfo }
func (*JobInfo) GetParameterDefinitions ¶
func (ji *JobInfo) GetParameterDefinitions() []ParameterDefinitions
type ParameterDefinitions ¶
type QueueInfo ¶
type QueueInfo struct { Actions []struct { Parameters []struct { Name string `json:"name"` Value string `json:"value"` } `json:"parameters,omitempty"` Causes []struct { ShortDescription string `json:"shortDescription"` UserID interface{} `json:"userId"` UserName string `json:"userName"` } `json:"causes,omitempty"` } `json:"actions"` Blocked bool `json:"blocked"` Buildable bool `json:"buildable"` ID int `json:"id"` InQueueSince int64 `json:"inQueueSince"` Params string `json:"params"` Stuck bool `json:"stuck"` Task struct { Name string `json:"name"` URL string `json:"url"` Color string `json:"color"` } `json:"task"` URL string `json:"url"` Why interface{} `json:"why"` Cancelled bool `json:"cancelled"` Executable struct { Number int `json:"number"` URL string `json:"url"` } `json:"executable"` }
type Queues ¶
type Queues struct { DiscoverableItems []interface{} `json:"discoverableItems"` Items []struct { Actions []struct { Parameters []struct { Name string `json:"name"` Value string `json:"value"` } `json:"parameters,omitempty"` Causes []struct { ShortDescription string `json:"shortDescription"` UpstreamBuild int `json:"upstreamBuild"` UpstreamProject string `json:"upstreamProject"` UpstreamURL string `json:"upstreamUrl"` } `json:"causes,omitempty"` } `json:"actions"` Blocked bool `json:"blocked"` Buildable bool `json:"buildable"` BuildableStartMilliseconds int64 `json:"buildableStartMilliseconds"` ID int `json:"id"` InQueueSince int64 `json:"inQueueSince"` Params string `json:"params"` Stuck bool `json:"stuck"` Task struct { Color string `json:"color"` Name string `json:"name"` URL string `json:"url"` } `json:"task"` URL string `json:"url"` Why string `json:"why"` } `json:"items"` }
Click to show internal directories.
Click to hide internal directories.