Documentation ¶
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func String(v string) *string
- func Time(v time.Time) *time.Time
- type Actor
- type Artifact
- type ArtifactList
- type CheckoutKeyTypeType
- type Client
- type Collaboration
- type Commit
- type Config
- type Context
- type ContextAddOrUpdateVariableOptions
- type ContextCreateOptions
- type ContextList
- type ContextListOptions
- type ContextListVariablesOptions
- type ContextVariable
- type ContextVariableList
- type Contexts
- type DurationMetrics
- type ErrorResponse
- type Event
- type Executor
- type Insights
- type InsightsGetTestMetricsOptions
- type InsightsListSummaryMetricsOptions
- type InsightsListWorkflowRunsOptions
- type Job
- type JobContext
- type JobMessage
- type JobPipeline
- type JobProject
- type Jobs
- type LatestWorkflow
- type Metrics
- type MostFailedTest
- type Organization
- type OwnerOptions
- type OwnerTypeType
- type ParallelRuns
- type Pipeline
- type PipelineConfig
- type PipelineContinueOptions
- type PipelineError
- type PipelineList
- type PipelineListOptions
- type PipelineListWorkflowsOptions
- type Pipelines
- type Project
- type ProjectCheckoutKey
- type ProjectCheckoutKeyList
- type ProjectCreateCheckoutKeyOptions
- type ProjectCreateVariableOptions
- type ProjectListCheckoutKeysOptions
- type ProjectListMyPipelinesOptions
- type ProjectListPipelinesOptions
- type ProjectListVariablesOptions
- type ProjectTriggerPipelineOptions
- type ProjectVariable
- type ProjectVariableList
- type Projects
- type ReportingWindowType
- type Scope
- type SlowestTest
- type SummaryMetrics
- type SummaryMetricsList
- type TestCounts
- type TestMetadata
- type TestMetadataList
- type TestMetrics
- type TestRun
- type Trigger
- type User
- type Users
- type VCS
- type VCSInfo
- type Webhook
- type WebhookCreateOptions
- type WebhookList
- type WebhookListOptions
- type Webhooks
- type Workflow
- type WorkflowJob
- type WorkflowJobList
- type WorkflowList
- type WorkflowRerunOptions
- type WorkflowRun
- type WorkflowRunList
- type Workflows
Constants ¶
View Source
const ( DefaultAddress = "https://circleci.com" DefaultBasePath = "/api/v2/" )
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrRequiredEitherOrganizationIDOrSlug = errors.New("either organization ID or slug is required") ErrRequiredContextID = errors.New("context ID is required") ErrRequiredEnvironmentVariableName = errors.New("environment variable name is required") ErrRequiredEnvironmentVariableValue = errors.New("missing environment variable value") ErrRequiredProjectSlug = errors.New("project slug is required") ErrRequiredProjectCheckoutKeyType = errors.New("project checkout key type is required") ErrRequiredProjectCheckoutKeyFingerprint = errors.New("project checkout key fingerprint is required") ErrRequiredProjectVariableName = errors.New("project variable name is required") ErrRequiredProjectVariableValue = errors.New("project variable value is required") ErrRequiredUserID = errors.New("user id is required") ErrRequiredWorkflowID = errors.New("workflow id is required") ErrRequiredApprovalRequestID = errors.New("approval request id (the id of the job being approved) is required") ErrRequiredPipelineContinuationKey = errors.New("pipeline continuation key is required") ErrRequiredPipelineConfiguration = errors.New("pipeline configuration is required") ErrRequiredPipelinePipelineID = errors.New("pipeline ID is required") ErrRequiredPipelineNumber = errors.New("pipeline number is required") ErrRequiredJobNumber = errors.New("job number is required") ErrRequiredWorkflowName = errors.New("workflow name is required") ErrRequiredJobName = errors.New("job name is required") ErrRequiredWebhookEvents = errors.New("webhook events is required") ErrRequiredWebhookName = errors.New("webhook name is required") ErrRequiredWebhookID = errors.New("webhook ID is required") ErrRequiredWebhookURL = errors.New("webhook URL is required") ErrRequiredWebhookVerifyTLS = errors.New("webhook verifyTLS is required") ErrRequiredWebhookSigningSecret = errors.New("webhook signingSecret is required") ErrRequiredWebhookScopeID = errors.New("webhook scopeID is required") ErrRequiredWebhookScopeType = errors.New("webhook scopeType is required") )
Functions ¶
Types ¶
type ArtifactList ¶
type CheckoutKeyTypeType ¶ added in v0.3.0
type CheckoutKeyTypeType string
const ( CheckoutKeyTypeUserKey CheckoutKeyTypeType = "user-key" CheckoutKeyTypeDeployKey CheckoutKeyTypeType = "deploy-key" )
func CheckoutKeyType ¶ added in v0.2.0
func CheckoutKeyType(v CheckoutKeyTypeType) *CheckoutKeyTypeType
CheckoutKeyType return a pointer to the given CheckoutKeyTypeType
type Client ¶
type Collaboration ¶
type Config ¶
type Config struct { Address string BasePath string Token string Headers http.Header HTTPClient *http.Client }
func DefaultConfig ¶
func DefaultConfig() *Config
type ContextAddOrUpdateVariableOptions ¶ added in v0.4.0
type ContextAddOrUpdateVariableOptions struct {
Value *string `json:"value"`
}
type ContextCreateOptions ¶
type ContextCreateOptions struct { Name *string `json:"name"` Owner *OwnerOptions `json:"owner"` }
type ContextList ¶
type ContextListOptions ¶
type ContextListOptions struct { OwnerID *string `url:"owner-id,omitempty"` OwnerSlug *string `url:"owner-slug,omitempty"` OwnerType *OwnerTypeType `url:"owner-type,omitempty"` PageToken *string `url:"page-token,omitempty"` }
type ContextListVariablesOptions ¶ added in v0.9.0
type ContextListVariablesOptions struct {
PageToken *string `url:"page-token,omitempty"`
}
type ContextVariable ¶
type ContextVariableList ¶
type ContextVariableList struct { Items []*ContextVariable NextPageToken string `json:"next_page_token"` }
type Contexts ¶
type Contexts interface { List(ctx context.Context, options ContextListOptions) (*ContextList, error) Get(ctx context.Context, contextID string) (*Context, error) Create(ctx context.Context, options ContextCreateOptions) (*Context, error) Delete(ctx context.Context, contextID string) error ListVariables(ctx context.Context, contextID string, options ContextListVariablesOptions) (*ContextVariableList, error) RemoveVariable(ctx context.Context, contextID string, variableName string) error AddOrUpdateVariable(ctx context.Context, contextID string, variableName string, options ContextAddOrUpdateVariableOptions) (*ContextVariable, error) }
type DurationMetrics ¶
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type Insights ¶
type Insights interface { ListSummaryMetricsForWorkflows(ctx context.Context, projectSlug string, options InsightsListSummaryMetricsOptions) (*SummaryMetricsList, error) ListSummaryMetricsForWorkflowJobs(ctx context.Context, projectSlug, workflowName string, options InsightsListSummaryMetricsOptions) (*SummaryMetricsList, error) GetTestMetricsForWorkflows(ctx context.Context, projectSlug, workflowName string, options InsightsGetTestMetricsOptions) (*TestMetrics, error) ListWorkflowRuns(ctx context.Context, projectSlug, workflowName string, options InsightsListWorkflowRunsOptions) (*WorkflowRunList, error) ListWorkflowJobRuns(ctx context.Context, projectSlug, workflowName, jobName string, options InsightsListWorkflowRunsOptions) (*WorkflowRunList, error) }
type InsightsListSummaryMetricsOptions ¶
type InsightsListSummaryMetricsOptions struct { ReportingWindow *ReportingWindowType `url:"reporting-window,omitempty"` AllBranches *bool `url:"all-branches,omitempty"` Branch *string `url:"branch,omitempty"` PageToken *string `url:"page-token,omitempty"` }
type Job ¶
type Job struct { WebURL string `json:"web_url"` Project *JobProject `json:"project"` ParallelRuns []*ParallelRuns `json:"parallel_runs"` StartedAt time.Time `json:"started_at"` LatestWorkflow *LatestWorkflow `json:"latest_workflow"` Name string `json:"name"` Executor *Executor `json:"executor"` Parallelism int `json:"parallelism"` Status interface{} `json:"status"` Number int `json:"number"` Pipeline *JobPipeline `json:"pipeline"` Duration int `json:"duration"` CreatedAt time.Time `json:"created_at"` Messages []*JobMessage `json:"messages"` Contexts []*Context `json:"contexts"` Organization Organization `json:"organization"` QueuedAt time.Time `json:"queued_at"` StoppedAt time.Time `json:"stopped_at"` }
type JobContext ¶
type JobContext struct {
Name string `json:"name"`
}
type JobMessage ¶
type JobPipeline ¶
type JobPipeline struct {
ID string `json:"id"`
}
type JobProject ¶
type Jobs ¶
type Jobs interface { Get(ctx context.Context, projectSlug string, jobNumber string) (*Job, error) Cancel(ctx context.Context, projectSlug string, jobNumber string) error ListArtifacts(ctx context.Context, projectSlug string, jobNumber string) (*ArtifactList, error) ListTestMetadata(ctx context.Context, projectSlug string, jobNumber string) (*TestMetadataList, error) }
type LatestWorkflow ¶
type Metrics ¶
type Metrics struct { TotalRuns int `json:"total_runs"` SuccessfulRuns int `json:"successful_runs"` Mttr int `json:"mttr"` TotalCreditsUsed int `json:"total_credits_used"` FailedRuns int `json:"failed_runs"` SuccessRate int `json:"success_rate"` DurationMetrics *DurationMetrics `json:"duration_metrics"` TotalRecoveries int `json:"total_recoveries"` Throughput int `json:"throughput"` }
type MostFailedTest ¶
type Organization ¶
type Organization struct {
Name string `json:"name"`
}
type OwnerOptions ¶
type OwnerOptions struct { ID *string `json:"id,omitempty"` Slug *string `json:"slug,omitempty"` Type *OwnerTypeType `json:"type,omitempty"` }
type OwnerTypeType ¶ added in v0.3.0
type OwnerTypeType string
const ( OwnerTypeOrganization OwnerTypeType = "organization" OwnerTypeAccount OwnerTypeType = "account" )
func OwnerType ¶
func OwnerType(v OwnerTypeType) *OwnerTypeType
OwnerType returs a pointer to the given OwnerTypeType.
type ParallelRuns ¶
type Pipeline ¶
type Pipeline struct { ID string `json:"id"` ProjectSlug string `json:"project_slug"` State string `json:"state"` Number int64 `json:"number"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at,omitempty"` Trigger *Trigger `json:"trigger"` Vcs *VCS `json:"vcs"` Errors []*PipelineError `json:"errors"` }
type PipelineConfig ¶
type PipelineContinueOptions ¶
type PipelineError ¶
type PipelineList ¶
type PipelineListOptions ¶
type PipelineListWorkflowsOptions ¶
type PipelineListWorkflowsOptions struct {
PageToken *string `url:"page-token,omitempty"`
}
type Pipelines ¶
type Pipelines interface { List(ctx context.Context, options PipelineListOptions) (*PipelineList, error) Continue(ctx context.Context, options PipelineContinueOptions) error Get(ctx context.Context, pipelineID string) (*Pipeline, error) GetConfig(ctx context.Context, pipelineID string) (*PipelineConfig, error) ListWorkflows(ctx context.Context, pipelineID string, options PipelineListWorkflowsOptions) (*WorkflowList, error) }
type ProjectCheckoutKey ¶
type ProjectCheckoutKey struct { // seems like public documentation says public-key should be the key but // actually returned one is public_key PublicKey string `json:"public_key"` Type CheckoutKeyTypeType `json:"type"` Fingerprint string `json:"fingerprint"` Preferred bool `json:"preferred"` // seems like public documentation says created-at should be the key but // actually returned one is created_at CreatedAt time.Time `json:"created_at"` }
type ProjectCheckoutKeyList ¶
type ProjectCheckoutKeyList struct { Items []*ProjectCheckoutKey `json:"items"` NextPageToken string `json:"next_page_token"` }
type ProjectCreateCheckoutKeyOptions ¶
type ProjectCreateCheckoutKeyOptions struct {
Type *CheckoutKeyTypeType `json:"type"`
}
type ProjectListCheckoutKeysOptions ¶ added in v0.9.0
type ProjectListCheckoutKeysOptions struct {
PageToken *string `url:"page-token,omitempty"`
}
type ProjectListMyPipelinesOptions ¶
type ProjectListMyPipelinesOptions struct {
PageToken *string `url:"page-token,omitempty"`
}
type ProjectListVariablesOptions ¶ added in v0.9.0
type ProjectListVariablesOptions struct {
PageToken *string `url:"page-token,omitempty"`
}
type ProjectVariable ¶
type ProjectVariableList ¶
type ProjectVariableList struct { Items []*ProjectVariable `json:"items"` NextPageToken string `json:"next_page_token"` }
type Projects ¶
type Projects interface { Get(ctx context.Context, projectSlug string) (*Project, error) CreateCheckoutKey(ctx context.Context, projectSlug string, options ProjectCreateCheckoutKeyOptions) (*ProjectCheckoutKey, error) ListCheckoutKeys(ctx context.Context, projectSlug string, options ProjectListCheckoutKeysOptions) (*ProjectCheckoutKeyList, error) GetCheckoutKey(ctx context.Context, projectSlug, fingerprint string) (*ProjectCheckoutKey, error) DeleteCheckoutKey(ctx context.Context, projectSlug, fingerprint string) error CreateVariable(ctx context.Context, projectSlug string, options ProjectCreateVariableOptions) (*ProjectVariable, error) ListVariables(ctx context.Context, projectSlug string, options ProjectListVariablesOptions) (*ProjectVariableList, error) DeleteVariable(ctx context.Context, projectSlug, name string) error GetVariable(ctx context.Context, projectSlug, name string) (*ProjectVariable, error) TriggerPipeline(ctx context.Context, projectSlug string, options ProjectTriggerPipelineOptions) (*Pipeline, error) ListPipelines(ctx context.Context, projectSlug string, options ProjectListPipelinesOptions) (*PipelineList, error) ListMyPipelines(ctx context.Context, projectSlug string, options ProjectListMyPipelinesOptions) (*PipelineList, error) GetPipeline(ctx context.Context, projectSlug string, pipelineNumber string) (*Pipeline, error) }
type ReportingWindowType ¶ added in v0.3.0
type ReportingWindowType string
const ( Last7Days ReportingWindowType = "last-7-days" Last30Days ReportingWindowType = "last-30-days" Last60Days ReportingWindowType = "last-60-days" Last90Days ReportingWindowType = "last-90-days" Last24Hours ReportingWindowType = "last-24-hours" )
func ReportingWindow ¶
func ReportingWindow(v ReportingWindowType) *ReportingWindowType
ReportingWindow returns a pointer to the given ReportingWindowType.
type SlowestTest ¶
type SummaryMetrics ¶
type SummaryMetricsList ¶
type SummaryMetricsList struct { Items []*SummaryMetrics `json:"items"` NextPageToken string `json:"next_page_token"` }
type TestCounts ¶
type TestMetadata ¶
type TestMetadataList ¶
type TestMetadataList struct { Items []*TestMetadata `json:"items"` NextPageToken string `json:"next_page_token"` }
type TestMetrics ¶
type TestMetrics struct { AverageTestCount int `json:"average_test_count"` MostFailedTests []*MostFailedTest `json:"most_failed_tests"` MostFailedTestsExtra int `json:"most_failed_tests_extra"` SlowestTests []*SlowestTest `json:"slowest_tests"` SlowestTestsExtra int `json:"slowest_tests_extra"` TotalTestRuns int `json:"total_test_runs"` TestRuns []*TestRun `json:"test_runs"` }
type TestRun ¶
type TestRun struct { PipelineNumber int `json:"pipeline_number"` WorkflowID interface{} `json:"workflow_id"` SuccessRate int `json:"success_rate"` TestCounts TestCounts `json:"test_counts"` }
type VCS ¶
type VCS struct { ProviderName string `json:"provider_name"` TargetRepositoryURL string `json:"target_repository_url"` Branch string `json:"branch,omitempty"` ReviewID string `json:"review_id,omitempty"` ReviewURL string `json:"review_url,omitempty"` Revision string `json:"revision"` Tag string `json:"tag,omitempty"` OriginRepositoryURL string `json:"origin_repository_url"` Commit *Commit `json:"commit"` }
type WebhookCreateOptions ¶ added in v0.7.0
type WebhookList ¶ added in v0.7.0
type WebhookListOptions ¶ added in v0.7.0
type Webhooks ¶ added in v0.7.0
type Webhooks interface { Get(ctx context.Context, id string) (*Webhook, error) List(ctx context.Context, options WebhookListOptions) (*WebhookList, error) Create(ctx context.Context, options WebhookCreateOptions) (*Webhook, error) }
type Workflow ¶
type Workflow struct { PipelineID string `json:"pipeline_id"` CanceledBy string `json:"canceled_by"` ID string `json:"id"` Name string `json:"name"` ProjectSlug string `json:"project_slug"` ErroredBy string `json:"errored_by"` Tag string `json:"tag"` Status interface{} `json:"status"` StartedBy string `json:"started_by"` PipelineNumber int64 `json:"pipeline_number"` CreatedAt time.Time `json:"created_at"` StoppedAt time.Time `json:"stopped_at"` }
type WorkflowJob ¶
type WorkflowJob struct { ID string `json:"id"` CanceledBy string `json:"canceled_by"` Dependencies []*string `json:"dependencies"` JobNumber int64 `json:"job_number"` Name string `json:"name"` ApprovedBy string `json:"approved_by"` ProjectSlug string `json:"project_slug"` Status string `json:"status"` Type string `json:"type"` StartedAt time.Time `json:"started_at"` StoppedAt time.Time `json:"stopped_at"` ApprovalRequestID string `json:"approval_request_id"` }
type WorkflowJobList ¶
type WorkflowJobList struct { Items []*WorkflowJob `json:"items"` NextPageToken string `json:"next_page_token"` }
type WorkflowList ¶
type WorkflowRerunOptions ¶
type WorkflowRun ¶
type WorkflowRunList ¶
type WorkflowRunList struct { Items []*WorkflowRun `json:"items"` NextPageToken string `json:"next_page_token"` }
type Workflows ¶
type Workflows interface { Get(ctx context.Context, id string) (*Workflow, error) ApproveJob(ctx context.Context, id, approvalRequestID string) error Cancel(ctx context.Context, id string) error ListWorkflowJobs(ctx context.Context, id string) (*WorkflowJobList, error) Rerun(ctx context.Context, id string, options WorkflowRerunOptions) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.