circleci

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const FailedOutputChannel = "failed"
View Source
const PayloadType = "circleci.workflow.completed"
View Source
const PollInterval = 5 * time.Minute
View Source
const ResourceTypePipelineDefinition = "pipeline-definition"
View Source
const SuccessOutputChannel = "success"
View Source
const WorkflowStatusCanceled = "canceled"
View Source
const WorkflowStatusFailed = "failed"
View Source
const WorkflowStatusSuccess = "success"

Variables

This section is empty.

Functions

func IsValidLocation

func IsValidLocation(location string) bool

Types

type CircleCI

type CircleCI struct{}

func (*CircleCI) Actions

func (c *CircleCI) Actions() []core.Action

func (*CircleCI) Cleanup

func (c *CircleCI) Cleanup(ctx core.IntegrationCleanupContext) error

func (*CircleCI) Components

func (c *CircleCI) Components() []core.Component

func (*CircleCI) Configuration

func (c *CircleCI) Configuration() []configuration.Field

func (*CircleCI) Description

func (c *CircleCI) Description() string

func (*CircleCI) HandleAction

func (c *CircleCI) HandleAction(ctx core.IntegrationActionContext) error

func (*CircleCI) HandleRequest

func (c *CircleCI) HandleRequest(ctx core.HTTPRequestContext)

func (*CircleCI) Icon

func (c *CircleCI) Icon() string

func (*CircleCI) Instructions

func (c *CircleCI) Instructions() string

func (*CircleCI) Label

func (c *CircleCI) Label() string

func (*CircleCI) ListResources

func (c *CircleCI) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*CircleCI) Name

func (c *CircleCI) Name() string

func (*CircleCI) Sync

func (c *CircleCI) Sync(ctx core.SyncContext) error

func (*CircleCI) Triggers

func (c *CircleCI) Triggers() []core.Trigger

type CircleCIWebhookHandler

type CircleCIWebhookHandler struct{}

func (*CircleCIWebhookHandler) Cleanup

func (*CircleCIWebhookHandler) CompareConfig

func (h *CircleCIWebhookHandler) CompareConfig(a, b any) (bool, error)

func (*CircleCIWebhookHandler) Merge

func (h *CircleCIWebhookHandler) Merge(current, requested any) (any, bool, error)

func (*CircleCIWebhookHandler) Setup

type Client

type Client struct {
	APIToken string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(http core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) CheckPipelineStatus

func (c *Client) CheckPipelineStatus(pipelineID string) (*PipelineStatusResult, error)

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(name, webhookURL, secret, projectSlug string, events []string) (*WebhookResponse, error)

func (*Client) DeleteWebhook

func (c *Client) DeleteWebhook(webhookID string) error

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser() (*UserResponse, error)

func (*Client) GetPipeline

func (c *Client) GetPipeline(pipelineID string) (*PipelineResponse, error)

func (*Client) GetPipelineDefinitions

func (c *Client) GetPipelineDefinitions(projectID string) ([]PipelineDefinitionResponse, error)

func (*Client) GetPipelineWorkflows

func (c *Client) GetPipelineWorkflows(pipelineID string) ([]WorkflowResponse, error)

func (*Client) GetProject

func (c *Client) GetProject(projectSlug string) (*ProjectResponse, error)

func (*Client) GetWebhook

func (c *Client) GetWebhook(webhookID string) (*WebhookResponse, error)

func (*Client) GetWorkflow

func (c *Client) GetWorkflow(workflowID string) (*WorkflowResponse, error)

func (*Client) ListWebhooks

func (c *Client) ListWebhooks(projectSlug string) ([]WebhookResponse, error)

func (*Client) RunPipeline

func (c *Client) RunPipeline(projectSlug string, params RunPipelineParams) (*RunPipelineResponse, error)

type Configuration

type Configuration struct {
	APIToken string `json:"apiToken"`
}

type CreateWebhookParams

type CreateWebhookParams struct {
	Name   string   `json:"name"`
	URL    string   `json:"url"`
	Events []string `json:"events"`
	Scope  struct {
		ID   string `json:"id"`
		Type string `json:"type"`
	} `json:"scope"`
	SigningSecret string `json:"signing-secret"`
	VerifyTLS     bool   `json:"verify-tls"`
}

type Metadata

type Metadata struct {
	Projects []string `json:"projects"`
}

type OnWorkflowCompleted

type OnWorkflowCompleted struct{}

func (*OnWorkflowCompleted) Actions

func (p *OnWorkflowCompleted) Actions() []core.Action

func (*OnWorkflowCompleted) Cleanup

func (p *OnWorkflowCompleted) Cleanup(ctx core.TriggerContext) error

func (*OnWorkflowCompleted) Color

func (p *OnWorkflowCompleted) Color() string

func (*OnWorkflowCompleted) Configuration

func (p *OnWorkflowCompleted) Configuration() []configuration.Field

func (*OnWorkflowCompleted) Description

func (p *OnWorkflowCompleted) Description() string

func (*OnWorkflowCompleted) Documentation

func (p *OnWorkflowCompleted) Documentation() string

func (*OnWorkflowCompleted) ExampleData

func (t *OnWorkflowCompleted) ExampleData() map[string]any

func (*OnWorkflowCompleted) HandleAction

func (p *OnWorkflowCompleted) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)

func (*OnWorkflowCompleted) HandleWebhook

func (p *OnWorkflowCompleted) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*OnWorkflowCompleted) Icon

func (p *OnWorkflowCompleted) Icon() string

func (*OnWorkflowCompleted) Label

func (p *OnWorkflowCompleted) Label() string

func (*OnWorkflowCompleted) Name

func (p *OnWorkflowCompleted) Name() string

func (*OnWorkflowCompleted) Setup

type OnWorkflowCompletedConfiguration

type OnWorkflowCompletedConfiguration struct {
	ProjectSlug string `json:"projectSlug"`
}

type OnWorkflowCompletedMetadata

type OnWorkflowCompletedMetadata struct {
	Project *Project `json:"project"`
}

type Parameter

type Parameter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type PipelineDefinitionResponse

type PipelineDefinitionResponse struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	CreatedAt   string `json:"created_at"`
}

type PipelineInfo

type PipelineInfo struct {
	ID          string `json:"id"`
	Number      int    `json:"number"`
	CreatedAt   string `json:"created_at"`
	PipelineURL string `json:"pipeline_url"`
}

type PipelineResponse

type PipelineResponse struct {
	ID        string                 `json:"id"`
	Number    int                    `json:"number"`
	State     string                 `json:"state"`
	CreatedAt string                 `json:"created_at"`
	UpdatedAt string                 `json:"updated_at"`
	VCS       map[string]interface{} `json:"vcs"`
}

type PipelineStatusResult

type PipelineStatusResult struct {
	AllDone      bool
	AnyFailed    bool
	Workflows    []WorkflowResponse
	IsErrorState bool
}

type Project

type Project struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type ProjectResponse

type ProjectResponse struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type RunPipeline

type RunPipeline struct{}

func (*RunPipeline) Actions

func (t *RunPipeline) Actions() []core.Action

func (*RunPipeline) Cancel

func (t *RunPipeline) Cancel(ctx core.ExecutionContext) error

func (*RunPipeline) Cleanup

func (t *RunPipeline) Cleanup(ctx core.SetupContext) error

func (*RunPipeline) Color

func (t *RunPipeline) Color() string

func (*RunPipeline) Configuration

func (t *RunPipeline) Configuration() []configuration.Field

func (*RunPipeline) Description

func (t *RunPipeline) Description() string

func (*RunPipeline) Documentation

func (t *RunPipeline) Documentation() string

func (*RunPipeline) ExampleOutput

func (c *RunPipeline) ExampleOutput() map[string]any

func (*RunPipeline) Execute

func (t *RunPipeline) Execute(ctx core.ExecutionContext) error

func (*RunPipeline) HandleAction

func (t *RunPipeline) HandleAction(ctx core.ActionContext) error

func (*RunPipeline) HandleWebhook

func (t *RunPipeline) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*RunPipeline) Icon

func (t *RunPipeline) Icon() string

func (*RunPipeline) Label

func (t *RunPipeline) Label() string

func (*RunPipeline) Name

func (t *RunPipeline) Name() string

func (*RunPipeline) OutputChannels

func (t *RunPipeline) OutputChannels(configuration any) []core.OutputChannel

func (*RunPipeline) ProcessQueueItem

func (t *RunPipeline) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*RunPipeline) Setup

func (t *RunPipeline) Setup(ctx core.SetupContext) error

type RunPipelineExecutionMetadata

type RunPipelineExecutionMetadata struct {
	Pipeline PipelineInfo `json:"pipeline" mapstructure:"pipeline"`
}

type RunPipelineNodeMetadata

type RunPipelineNodeMetadata struct {
	ProjectID              string `json:"projectId" mapstructure:"projectId"`
	ProjectSlug            string `json:"projectSlug" mapstructure:"projectSlug"`
	ProjectName            string `json:"projectName" mapstructure:"projectName"`
	PipelineDefinitionID   string `json:"pipelineDefinitionId" mapstructure:"pipelineDefinitionId"`
	PipelineDefinitionName string `json:"pipelineDefinitionName" mapstructure:"pipelineDefinitionName"`
}

type RunPipelineParams

type RunPipelineParams struct {
	DefinitionID string            `json:"definition_id"`
	Config       map[string]string `json:"config"`   // e.g. {"branch": "main"} or {"tag": "v1.0"}
	Checkout     map[string]string `json:"checkout"` // same as config
	Parameters   map[string]string `json:"parameters,omitempty"`
}

type RunPipelineResponse

type RunPipelineResponse struct {
	ID        string `json:"id"`
	Number    int    `json:"number"`
	State     string `json:"state"`
	CreatedAt string `json:"created_at"`
}

type RunPipelineSpec

type RunPipelineSpec struct {
	ProjectSlug          string      `json:"projectSlug"`
	Location             string      `json:"location"`
	PipelineDefinitionID string      `json:"pipelineDefinitionId"`
	Parameters           []Parameter `json:"parameters"`
}

type UserResponse

type UserResponse struct {
	ID    string `json:"id"`
	Login string `json:"login"`
	Name  string `json:"name"`
}

type WebhookConfiguration

type WebhookConfiguration struct {
	ProjectSlug string   `json:"projectSlug"`
	Events      []string `json:"events"`
}

type WebhookMetadata

type WebhookMetadata struct {
	WebhookID string `json:"webhookId"`
	Name      string `json:"name"`
}

type WebhookResponse

type WebhookResponse struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

type WorkflowInfo

type WorkflowInfo struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Status string `json:"status"`
}

type WorkflowResponse

type WorkflowResponse struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Status    string `json:"status"`
	CreatedAt string `json:"created_at"`
	StoppedAt string `json:"stopped_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL