Documentation
¶
Overview ¶
Example ¶
package main import ( "context" "fmt" "log" "github.com/crhntr/globalentry" ) func main() { concourse := globalentry.Client{} ctx := context.Background() const teamName = "main" teams, err := concourse.Teams(ctx) if err != nil { log.Fatal(err) } for _, team := range teams { pipelines, err := concourse.Pipelines(ctx, team.Name) if err != nil { log.Fatal(err) } for _, p := range pipelines { jobs, err := concourse.Jobs(ctx, teamName, p.Name) if err != nil { log.Fatal(err) } fmt.Printf("%#v\n", p) for _, j := range jobs { fmt.Printf("\t%#v\n", j) } } } }
Output:
Index ¶
- type Build
- type BuildEvent
- type BuildEventData
- type BuildInput
- type Client
- func (client *Client) APIPath(segments ...string) string
- func (client *Client) BuildEvents(ctx context.Context, buildID int) (<-chan BuildEvent, error)
- func (client *Client) Do(req *http.Request) (*http.Response, error)
- func (client *Client) JobBuilds(ctx context.Context, team, pipeline, job string) ([]Build, error)
- func (client *Client) JobBuildsWithResourceVersion(ctx context.Context, team, pipeline, resource string, versionID int) ([]Build, error)
- func (client *Client) Jobs(ctx context.Context, team, pipeline string) ([]Job, error)
- func (client *Client) Pipelines(ctx context.Context, team string) ([]Pipeline, error)
- func (client *Client) ResourceVersions(ctx context.Context, team, pipeline, resource string) ([]ResourceVersion, error)
- func (client *Client) Resources(ctx context.Context, team, pipeline string) ([]Resource, error)
- func (client *Client) Teams(ctx context.Context) ([]Team, error)
- func (client *Client) Token() (*oauth2.Token, error)
- type Job
- type Pipeline
- type Resource
- type ResourceVersion
- type Team
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct { ID int `json:"id"` Name string `json:"name"` Status string `json:"status"` StartTime int64 `json:"start_time"` EndTime int64 `json:"end_time"` TeamName string `json:"team_name"` PipelineID int `json:"pipeline_id"` PipelineName string `json:"pipeline_name"` JobName string `json:"job_name"` Inputs []BuildInput `bson:"inputs"` URL string `json:"api_url"` CreatedBy string `json:"created_by,omitempty"` }
type BuildEvent ¶
type BuildEvent struct { Data BuildEventData `json:"data"` Event string `json:"event"` }
type BuildEventData ¶
type BuildEventData struct { Payload string `json:"payload"` Time int64 `json:"time"` Origin json.RawMessage `json:"origin"` Message string `json:"message"` }
type BuildInput ¶
type Client ¶
type Client struct { Client http.Client URL string Username string Password string // contains filtered or unexported fields }
func (*Client) BuildEvents ¶
func (*Client) JobBuildsWithResourceVersion ¶
func (*Client) ResourceVersions ¶
type Job ¶
type Job struct { ID int `json:"id"` Name string `json:"name"` TeamName string `json:"team_name"` PipelineID int `json:"pipeline_id"` PipelineName string `json:"pipeline_name"` FinishedBuild Build `json:"finished_build"` TransitionBuild Build `json:"transition_build"` Groups []string `json:"groups"` HasNewInputs bool `json:"has_new_inputs"` }
type Pipeline ¶
type Pipeline struct { ID int `json:"id"` Name string `json:"name"` Paused bool `json:"paused"` Public bool `json:"public"` Archived bool `json:"archived"` TeamName string `json:"team_name"` LastUpdated int64 `json:"last_updated"` }
func (Pipeline) LastUpdatedTime ¶
type Resource ¶
type Resource struct { Name string `json:"name"` Type string `json:"type"` PipelineID int `json:"pipeline_id"` PipelineName string `json:"pipeline_name"` TeamName string `json:"team_name"` LastChecked int `json:"last_checked"` Build struct { ID int `json:"id"` Name string `json:"name"` Status string `json:"status"` StartTime int `json:"start_time"` EndTime int `json:"end_time"` TeamName string `json:"team_name"` PipelineId int `json:"pipeline_id"` PipelineName string `json:"pipeline_name"` Plan struct { ID string `json:"id"` Check struct { Name string `json:"name"` Type string `json:"type"` } `json:"check"` } `json:"plan"` } `json:"build"` }
type ResourceVersion ¶
type ResourceVersion struct { ID int `json:"id"` Version json.RawMessage `json:"version"` Enabled bool `json:"enabled"` }
Click to show internal directories.
Click to hide internal directories.