Versions in this module Expand all Collapse all v0 v0.6.2 May 27, 2022 Changes in this version + const DefaultAddress + const DefaultBasePath + var ErrNotFound = errors.New("not found") + var ErrRequiredApprovalRequestID = errors.New("approval request id (the id of the job being approved) is required") + var ErrRequiredContextID = errors.New("context ID is required") + var ErrRequiredEitherOrganizationIDOrSlug = errors.New("either organization ID or slug is required") + var ErrRequiredEnvironmentVariableName = errors.New("environment variable name is required") + var ErrRequiredEnvironmentVariableValue = errors.New("missing environment variable value") + var ErrRequiredJobName = errors.New("job name is required") + var ErrRequiredJobNumber = errors.New("job number is required") + var ErrRequiredPipelineConfiguration = errors.New("pipeline configuration is required") + var ErrRequiredPipelineContinuationKey = errors.New("pipeline continuation key is required") + var ErrRequiredPipelineNumber = errors.New("pipeline number is required") + var ErrRequiredPipelinePipelineID = errors.New("pipeline ID is required") + var ErrRequiredProjectCheckoutKeyFingerprint = errors.New("project checkout key fingerprint is required") + var ErrRequiredProjectCheckoutKeyType = errors.New("project checkout key type is required") + var ErrRequiredProjectSlug = errors.New("project slug is required") + var ErrRequiredProjectVariableName = errors.New("project variable name is required") + var ErrRequiredProjectVariableValue = errors.New("project variable value is required") + var ErrRequiredUserID = errors.New("user id is required") + var ErrRequiredWorkflowID = errors.New("workflow id is required") + var ErrRequiredWorkflowName = errors.New("workflow name is required") + var ErrUnauthorized = errors.New("unauthorized") + func Bool(v bool) *bool + func String(v string) *string + func Time(v time.Time) *time.Time + type Actor struct + AvatarURL string + Login string + type Artifact struct + NodeIndex int64 + Path string + URL string + type ArtifactList struct + Items []*Artifact + NextPageToken string + type CheckoutKeyTypeType string + const CheckoutKeyTypeDeployKey + const CheckoutKeyTypeUserKey + func CheckoutKeyType(v CheckoutKeyTypeType) *CheckoutKeyTypeType + type Client struct + Contexts Contexts + Insights Insights + Jobs Jobs + Pipelines Pipelines + Projects Projects + Users Users + Workflows Workflows + func NewClient(cfg *Config) (*Client, error) + type Collaboration struct + AvatarURL string + Name string + VcsType string + type Commit struct + Body string + Subject string + type Config struct + Address string + BasePath string + HTTPClient *http.Client + Headers http.Header + Token string + func DefaultConfig() *Config + type Context struct + CreatedAt time.Time + ID string + Name string + type ContextAddOrUpdateVariableOptions struct + Value *string + type ContextCreateOptions struct + Name *string + Owner *OwnerOptions + type ContextList struct + Items []*Context + NextPageToken string + type ContextListOptions struct + OwnerID *string + OwnerSlug *string + OwnerType *OwnerTypeType + PageToken *string + type ContextVariable struct + ContextID string + CreatedAt time.Time + Variable string + type ContextVariableList struct + Items []*ContextVariable + NextPageToken string + type Contexts interface + AddOrUpdateVariable func(ctx context.Context, contextID string, variableName string, ...) (*ContextVariable, error) + Create func(ctx context.Context, options ContextCreateOptions) (*Context, error) + Delete func(ctx context.Context, contextID string) error + Get func(ctx context.Context, contextID string) (*Context, error) + List func(ctx context.Context, options ContextListOptions) (*ContextList, error) + ListVariables func(ctx context.Context, contextID string) (*ContextVariableList, error) + RemoveVariable func(ctx context.Context, contextID string, variableName string) error + type DurationMetrics struct + Max int + Mean int + Median int + Min int + P95 int + StandardDeviation int + type ErrorResponse struct + Message string + type Executor struct + ResourceClass string + Type string + type Insights interface + GetTestMetricsForWorkflows func(ctx context.Context, projectSlug, workflowName string, ...) (*TestMetrics, error) + ListSummaryMetricsForWorkflos func(ctx context.Context, projectSlug string, ...) (*SummaryMetricsList, error) + ListSummaryMetricsForWorkflowJobs func(ctx context.Context, projectSlug, workflowName string, ...) (*SummaryMetricsList, error) + ListWorkflowJobRuns func(ctx context.Context, projectSlug, workflowName, jobName string, ...) (*WorkflowRunList, error) + ListWorkflowRuns func(ctx context.Context, projectSlug, workflowName string, ...) (*WorkflowRunList, error) + type InsightsGetTestMetricsOptions struct + AllBranches *bool + PageToken *string + type InsightsListSummaryMetricsOptions struct + AllBranches *bool + Branch *string + PageToken *string + ReportingWindow *ReportingWindowType + type InsightsListWorkflowRunsOptions struct + AllBranches *bool + Branch *string + EndDate *time.Time + PageToken *string + StartDate *time.Time + type Job struct + Contexts []*Context + CreatedAt time.Time + Duration int + Executor *Executor + LatestWorkflow *LatestWorkflow + Messages []*JobMessage + Name string + Number int + Organization Organization + ParallelRuns []*ParallelRuns + Parallelism int + Pipeline *JobPipeline + Project *JobProject + QueuedAt time.Time + StartedAt time.Time + Status interface{} + StoppedAt time.Time + WebURL string + type JobContext struct + Name string + type JobMessage struct + Message string + Reason string + Type string + type JobPipeline struct + ID string + type JobProject struct + ExternalURL string + Name string + Slug string + type Jobs interface + Cancel func(ctx context.Context, projectSlug string, jobNumber string) error + Get func(ctx context.Context, projectSlug string, jobNumber string) (*Job, error) + ListArtifacts func(ctx context.Context, projectSlug string, jobNumber string) (*ArtifactList, error) + ListTestMetadata func(ctx context.Context, projectSlug string, jobNumber string) (*TestMetadataList, error) + type LatestWorkflow struct + ID string + Name string + type Metrics struct + DurationMetrics *DurationMetrics + FailedRuns int + Mttr int + SuccessRate int + SuccessfulRuns int + Throughput int + TotalCreditsUsed int + TotalRecoveries int + TotalRuns int + type MostFailedTest struct + FailedRuns int + Flaky bool + JobName string + P95Duration int + TestName string + TotalRuns int + type Organization struct + Name string + type OwnerOptions struct + ID *string + Slug *string + Type *OwnerTypeType + type OwnerTypeType string + const OwnerTypeAccount + const OwnerTypeOrganization + func OwnerType(v OwnerTypeType) *OwnerTypeType + type ParallelRuns struct + Index int + Status string + type Pipeline struct + CreatedAt time.Time + Errors []*PipelineError + ID string + Number int64 + ProjectSlug string + State string + Trigger *Trigger + UpdatedAt time.Time + Vcs *VCS + type PipelineConfig struct + Compiled string + CompiledSetupConfig string + SetupConfig string + Source string + type PipelineContinueOptions struct + Configuration *string + ContinuationKey *string + Parameters map[string]interface{} + type PipelineError struct + Message string + Type string + type PipelineList struct + Items []*Pipeline + NextPageToken string + type PipelineListOptions struct + Mine *bool + OrgSlug *string + PageToken *string + type PipelineListWorkflowsOptions struct + PageToken *string + type Pipelines interface + Continue func(ctx context.Context, options PipelineContinueOptions) error + Get func(ctx context.Context, pipelineID string) (*Pipeline, error) + GetConfig func(ctx context.Context, pipelineID string) (*PipelineConfig, error) + List func(ctx context.Context, options PipelineListOptions) (*PipelineList, error) + ListWorkflows func(ctx context.Context, pipelineID string, options PipelineListWorkflowsOptions) (*WorkflowList, error) + type Project struct + Name string + OrganizationName string + Slug string + VCSInfo *VCSInfo + type ProjectCheckoutKey struct + CreatedAt time.Time + Fingerprint string + Preferred bool + PublicKey string + Type CheckoutKeyTypeType + type ProjectCheckoutKeyList struct + Items []*ProjectCheckoutKey + NextPageToken string + type ProjectCreateCheckoutKeyOptions struct + Type *CheckoutKeyTypeType + type ProjectCreateVariableOptions struct + Name *string + Value *string + type ProjectListMyPipelinesOptions struct + PageToken *string + type ProjectListPipelinesOptions struct + Branch *string + PageToken *string + type ProjectTriggerPipelineOptions struct + Branch *string + Parameters map[string]interface{} + Tag *string + type ProjectVariable struct + Name string + Value string + type ProjectVariableList struct + Items []*ProjectVariable + NextPageToken string + type Projects interface + CreateCheckoutKey func(ctx context.Context, projectSlug string, ...) (*ProjectCheckoutKey, error) + CreateVariable func(ctx context.Context, projectSlug string, options ProjectCreateVariableOptions) (*ProjectVariable, error) + DeleteCheckoutKey func(ctx context.Context, projectSlug, fingerprint string) error + DeleteVariable func(ctx context.Context, projectSlug, name string) error + Get func(ctx context.Context, projectSlug string) (*Project, error) + GetCheckoutKey func(ctx context.Context, projectSlug, fingerprint string) (*ProjectCheckoutKey, error) + GetPipeline func(ctx context.Context, projectSlug string, pipelineNumber string) (*Pipeline, error) + GetVariable func(ctx context.Context, projectSlug, name string) (*ProjectVariable, error) + ListCheckoutKeys func(ctx context.Context, projectSlug string) (*ProjectCheckoutKeyList, error) + ListMyPipelines func(ctx context.Context, projectSlug string, options ProjectListMyPipelinesOptions) (*PipelineList, error) + ListPipelines func(ctx context.Context, projectSlug string, options ProjectListPipelinesOptions) (*PipelineList, error) + ListVariables func(ctx context.Context, projectSlug string) (*ProjectVariableList, error) + TriggerPipeline func(ctx context.Context, projectSlug string, options ProjectTriggerPipelineOptions) (*Pipeline, error) + type ReportingWindowType string + const Last24Hours + const Last30Days + const Last60Days + const Last7Days + const Last90Days + func ReportingWindow(v ReportingWindowType) *ReportingWindowType + type SlowestTest struct + FailedRuns int + Flaky bool + JobName string + P95Duration int + TestName string + TotalRuns int + type SummaryMetrics struct + Metrics *Metrics + Name string + WindowEnd time.Time + WindowStart time.Time + type SummaryMetricsList struct + Items []*SummaryMetrics + NextPageToken string + type TestCounts struct + Error int + Failure int + Skipped int + Success int + Total int + type TestMetadata struct + Classname string + File string + Message string + Name string + Result string + RunTime string + Source string + type TestMetadataList struct + Items []*TestMetadata + NextPageToken string + type TestMetrics struct + AverageTestCount int + MostFailedTests []*MostFailedTest + MostFailedTestsExtra int + SlowestTests []*SlowestTest + SlowestTestsExtra int + TestRuns []*TestRun + TotalTestRuns int + type TestRun struct + PipelineNumber int + SuccessRate int + TestCounts TestCounts + WorkflowID interface{} + type Trigger struct + Actor *Actor + ReceivedAt time.Time + Type string + type User struct + ID string + Login string + Name string + type Users interface + Collaborations func(ctx context.Context) ([]*Collaboration, error) + GetUser func(ctx context.Context, id string) (*User, error) + Me func(ctx context.Context) (*User, error) + type VCS struct + Branch string + Commit *Commit + OriginRepositoryURL string + ProviderName string + ReviewID string + ReviewURL string + Revision string + Tag string + TargetRepositoryURL string + type VCSInfo struct + DefaultBranch string + Provider string + VCSURL string + type Workflow struct + CanceledBy string + CreatedAt time.Time + ErroredBy string + ID string + Name string + PipelineID string + PipelineNumber int64 + ProjectSlug string + StartedBy string + Status interface{} + StoppedAt time.Time + Tag string + type WorkflowJob struct + ApprovalRequestID string + ApprovedBy string + CanceledBy string + Dependencies []*string + ID string + JobNumber int64 + Name string + ProjectSlug string + StartedAt time.Time + Status string + StoppedAt time.Time + Type string + type WorkflowJobList struct + Items []*WorkflowJob + NextPageToken string + type WorkflowList struct + Items []*Workflow + NextPageToken string + type WorkflowRerunOptions struct + FromFailed *bool + Jobs []*string + SparseTree *bool + type WorkflowRun struct + Branch string + CreatedAt time.Time + CreditsUsed int + Duration int + ID string + Status string + StoppedAt time.Time + type WorkflowRunList struct + Items []*WorkflowRun + NextPageToken string + type Workflows interface + ApproveJob func(ctx context.Context, id, approvalRequestID string) error + Cancel func(ctx context.Context, id string) error + Get func(ctx context.Context, id string) (*Workflow, error) + ListWorkflowJobs func(ctx context.Context, id string) (*WorkflowJobList, error) + Rerun func(ctx context.Context, id string, options WorkflowRerunOptions) error