Documentation ¶
Index ¶
- Constants
- Variables
- type Aggregation
- type Dashboard
- type Jenkins
- type JenkinsAggregation
- type JenkinsAggregations
- type JenkinsClient
- func (j *JenkinsClient) GetBusyExecutors() (int, error)
- func (j *JenkinsClient) GetExecutors() (*JenkinsExecutors, error)
- func (j *JenkinsClient) GetJobsFromView(viewName string) ([]JenkinsJob, error)
- func (j *JenkinsClient) GetJobsFromViewByPath(path string) ([]JenkinsJob, error)
- func (j *JenkinsClient) GetJobsFromViewWithTree(viewName string, tree string) ([]JenkinsJob, error)
- func (j *JenkinsClient) GetJobsFromViewWithTreeByPath(path string, tree string) ([]JenkinsJob, error)
- func (j *JenkinsClient) GetOverallLoad() (*JenkinsOverallLoad, error)
- func (j *JenkinsClient) GetQueue() (*JenkinsQueue, error)
- type JenkinsExecutors
- type JenkinsInstance
- type JenkinsJob
- type JenkinsOverallLoad
- type JenkinsQueue
- type JenkinsView
- type Status
- type Travis
- type TravisAggregation
- type TravisBuildStatus
- type TravisClient
- type TravisInstance
- type TravisJob
- type TravisRepository
Constants ¶
const (
TravisApiUrl = travis.ApiOrgUrl
)
Variables ¶
var ( // Debug set to true enable request debugging Debug = false )
Functions ¶
This section is empty.
Types ¶
type Aggregation ¶
type Dashboard ¶
type Dashboard struct {
// contains filtered or unexported fields
}
Dashboard is a container for all configured JenkinsInstance's.
func Init ¶
func Init(jenkinsInstances []*JenkinsInstance, travisInstances []*TravisInstance, jenkinsUsername string, jenkinsPassword string) *Dashboard
Init initializes the Dashboard with the given JenkinsInstance's and how to access them.
func (*Dashboard) GetBrokenJenkinsBuilds ¶
func (d *Dashboard) GetBrokenJenkinsBuilds() []*JenkinsAggregation
GetBrokenJenkinsBuilds retrieves the failed builds displayed on the Broken page from all configured JenkinsInstance's.
func (*Dashboard) GetBrokenTravisBuilds ¶
func (d *Dashboard) GetBrokenTravisBuilds() []*TravisAggregation
type Jenkins ¶
type Jenkins interface { GetQueue() (*JenkinsQueue, error) GetJobsFromView(viewName string) ([]JenkinsJob, error) GetJobsFromViewWithTree(viewName string, tree string) ([]JenkinsJob, error) GetJobsFromViewByPath(path string) ([]JenkinsJob, error) GetJobsFromViewWithTreeByPath(path string, tree string) ([]JenkinsJob, error) GetOverallLoad() (*JenkinsOverallLoad, error) GetExecutors() (*JenkinsExecutors, error) GetBusyExecutors() (int, error) }
Jenkins is high-level API for accessing the underlying Jenkins instance.
type JenkinsAggregation ¶
type JenkinsAggregation struct { Aggregation BrokenJobsUrl string `json:"brokenJobsUrl"` PublicUrl string `json:"publicUrl"` BusyExecutors int `json:"busyExecutors"` BuildQueueSize int `json:"buildQueueSize"` Jobs []JenkinsJob `json:"jobs"` }
Holds all dashboard relevant informations for a Jenkins instance
type JenkinsAggregations ¶
type JenkinsAggregations struct {
// contains filtered or unexported fields
}
JenkinsAggregations is a container for all retrieved JenkinsAggregation
type JenkinsClient ¶
type JenkinsClient struct {
// contains filtered or unexported fields
}
JenkinsClient implements the Jenkins interface and holds the client connected to the underlying Jenkins instance.
func (*JenkinsClient) GetBusyExecutors ¶
func (j *JenkinsClient) GetBusyExecutors() (int, error)
GetBusyExecutors returns the number of currently occupied JenkinsExecutors of the underlying Jenkins instance. It will return an error, if the connection or the JSON un-marshalling breaks.
func (*JenkinsClient) GetExecutors ¶
func (j *JenkinsClient) GetExecutors() (*JenkinsExecutors, error)
GetExecutors returns the currently configured JenkinsExecutors of the underlying Jenkins instance. It will return an error, if the connection or the JSON un-marshalling breaks.
func (*JenkinsClient) GetJobsFromView ¶
func (j *JenkinsClient) GetJobsFromView(viewName string) ([]JenkinsJob, error)
GetJobsFromView returns a slice with all Jobs from a given JenkinsView name from the underlying Jenkins instance. It will return an error, if the connection or the JSON un-marshalling breaks.
func (*JenkinsClient) GetJobsFromViewByPath ¶
func (j *JenkinsClient) GetJobsFromViewByPath(path string) ([]JenkinsJob, error)
GetJobsFromViewByPath returns a slice with all Jobs from a given JenkinsView name from the underlying Jenkins instance. It will return an error, if the connection or the JSON un-marshalling breaks.
func (*JenkinsClient) GetJobsFromViewWithTree ¶
func (j *JenkinsClient) GetJobsFromViewWithTree(viewName string, tree string) ([]JenkinsJob, error)
GetJobsFromViewWithTree returns a slice with all Jobs from a given JenkinsView name, restricting the returned attributes by the given tree string. It will return an error, if the connection or the JSON un-marshalling breaks.
func (*JenkinsClient) GetJobsFromViewWithTreeByPath ¶
func (j *JenkinsClient) GetJobsFromViewWithTreeByPath(path string, tree string) ([]JenkinsJob, error)
GetJobsFromViewWithTreeByPath returns a slice with all Jobs from a given JenkinsView name, restricting the returned attributes by the given tree string. It will return an error, if the connection or the JSON un-marshalling breaks.
func (*JenkinsClient) GetOverallLoad ¶
func (j *JenkinsClient) GetOverallLoad() (*JenkinsOverallLoad, error)
GetOverallLoad returns the JenkinsOverallLoad of the underlying Jenkins instance. It will return an error, if the connection or the JSON un-marshalling breaks.
func (*JenkinsClient) GetQueue ¶
func (j *JenkinsClient) GetQueue() (*JenkinsQueue, error)
GetQueue retrieves the JenkinsQueue of the underlying Jenkins instance. It will return an error, if the connection or the JSON un-marshalling breaks.
type JenkinsExecutors ¶
type JenkinsExecutors struct { BusyExecutors int `json:"busyExecutors"` Computer []struct { Actions []struct { } `json:"actions"` DisplayName string `json:"displayName"` Executors []struct { } `json:"executors"` Icon string `json:"icon"` IconClassName string `json:"iconClassName"` Idle bool `json:"idle"` JnlpAgent bool `json:"jnlpAgent"` LaunchSupported bool `json:"launchSupported"` LoadStatistics struct { } `json:"loadStatistics"` ManualLaunchAllowed bool `json:"manualLaunchAllowed"` MonitorData struct { HudsonNodeMonitorsSwapSpaceMonitor struct { AvailablePhysicalMemory int64 `json:"availablePhysicalMemory"` AvailableSwapSpace int64 `json:"availableSwapSpace"` TotalPhysicalMemory int64 `json:"totalPhysicalMemory"` TotalSwapSpace int64 `json:"totalSwapSpace"` } `json:"hudson.node_monitors.SwapSpaceMonitor"` HudsonNodeMonitorsArchitectureMonitor string `json:"hudson.node_monitors.ArchitectureMonitor"` HudsonNodeMonitorsResponseTimeMonitor struct { Average int `json:"average"` } `json:"hudson.node_monitors.ResponseTimeMonitor"` HudsonNodeMonitorsTemporarySpaceMonitor struct { Path string `json:"path"` Size int64 `json:"size"` } `json:"hudson.node_monitors.TemporarySpaceMonitor"` HudsonNodeMonitorsDiskSpaceMonitor struct { Path string `json:"path"` Size int64 `json:"size"` } `json:"hudson.node_monitors.DiskSpaceMonitor"` HudsonNodeMonitorsClockMonitor struct { Diff int `json:"diff"` } `json:"hudson.node_monitors.ClockMonitor"` } `json:"monitorData"` NumExecutors int `json:"numExecutors"` Offline bool `json:"offline"` OfflineCause interface{} `json:"offlineCause"` OfflineCauseReason string `json:"offlineCauseReason"` OneOffExecutors []interface{} `json:"oneOffExecutors"` TemporarilyOffline bool `json:"temporarilyOffline"` } `json:"computer"` DisplayName string `json:"displayName"` TotalExecutors int `json:"totalExecutors"` }
represents the configured executors of the underlying Jenkins instance.
func (*JenkinsExecutors) String ¶
func (e *JenkinsExecutors) String() string
type JenkinsInstance ¶
type JenkinsInstance struct { Name string Url string BrokenJobsUrl string PublicUrl string Client Jenkins }
JenkinsInstance holds basic informations about a Jenkins instance and the client connected to it.
type JenkinsJob ¶
type JenkinsJob struct { Name string `json:"name"` URL string `json:"url"` Color string `json:"color"` LastBuild struct { Actions []struct { FailCount int `json:"failCount,omitempty"` SkipCount int `json:"skipCount,omitempty"` TotalCount int `json:"totalCount,omitempty"` FoundFailureCauses []interface{} `json:"foundFailureCauses,omitempty"` } `json:"actions"` } `json:"lastBuild"` }
func (*JenkinsJob) String ¶
func (j *JenkinsJob) String() string
type JenkinsOverallLoad ¶
type JenkinsOverallLoad struct { AvailableExecutors struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"availableExecutors"` BusyExecutors struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"busyExecutors"` ConnectingExecutors struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"connectingExecutors"` DefinedExecutors struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"definedExecutors"` IdleExecutors struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"idleExecutors"` OnlineExecutors struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"onlineExecutors"` QueueLength struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"queueLength"` TotalExecutors struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"totalExecutors"` TotalQueueLength struct { Hour struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"hour"` Min struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"min"` Sec10 struct { History []float64 `json:"history"` Latest float64 `json:"latest"` } `json:"sec10"` } `json:"totalQueueLength"` }
represents the overall load of the underlying Jenkins instance.
func (*JenkinsOverallLoad) String ¶
func (o *JenkinsOverallLoad) String() string
type JenkinsQueue ¶
type JenkinsQueue struct { Items []struct { Actions []struct { Causes []struct { ShortDescription string `json:"shortDescription"` UpstreamBuild int `json:"upstreamBuild"` UpstreamProject string `json:"upstreamProject"` UpstreamURL string `json:"upstreamUrl"` } `json:"causes"` } `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 string `json:"why"` BuildableStartMilliseconds int64 `json:"buildableStartMilliseconds"` Pending bool `json:"pending"` } `json:"items"` }
JenkinsQueue represents the Jenkins Build queue.
func (*JenkinsQueue) String ¶
func (q *JenkinsQueue) String() string
type JenkinsView ¶
type JenkinsView struct {
Jobs []JenkinsJob `json:"jobs"`
}
JenkinsView represents a view inside Jenkins including all jobs on it.
func (*JenkinsView) String ¶
func (v *JenkinsView) String() string
type Status ¶
type Status bool
status describes the current state of the instance. 'ok', when the client was able to connect to it, or 'not available', when the connection was unsuccessful.
type Travis ¶
type Travis interface {
Job(r TravisRepository) (TravisJob, error)
}
func NewTravisClient ¶
type TravisAggregation ¶
type TravisAggregation struct { Aggregation Jobs []TravisJob `json:"jobs"` }
Holds all dashboard relevant informations for a Travis instance
type TravisBuildStatus ¶
type TravisBuildStatus bool
type TravisClient ¶
type TravisClient struct {
// contains filtered or unexported fields
}
func (*TravisClient) Job ¶
func (c *TravisClient) Job(r TravisRepository) (TravisJob, error)
type TravisInstance ¶
type TravisInstance struct { Name string Repos []TravisRepository Client Travis }
func (*TravisInstance) Url ¶
func (t *TravisInstance) Url() string
type TravisJob ¶
type TravisJob struct { Name string `json:"name"` URL string `json:"url"` Color string `json:"color"` }