Help us shape the future of Go! Take the 2026 Go Developer Survey

circleci

package
v0.7.123 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAuthorized = errors.New("not authorized")

ErrNotAuthorized indicates the request was rejected (401/403).

View Source
var ErrTokenNotFound = errors.New("api token not found")

ErrTokenNotFound indicates no CircleCI token was found in env or config.

Functions

This section is empty.

Types

type AddSSHKeyRequest

type AddSSHKeyRequest struct {
	PublicKey string `json:"public_key"`
}

type AddSSHKeyResponse

type AddSSHKeyResponse struct {
	URL string `json:"url"`
}

type Client

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

func NewClient

func NewClient(cfg Config) (*Client, error)

func (*Client) AddSSHKey

func (c *Client) AddSSHKey(ctx context.Context, sidecarID, publicKey string) (*AddSSHKeyResponse, error)

func (*Client) CreateOrg added in v0.7.119

func (c *Client) CreateOrg(ctx context.Context, name string) (*OrgInfo, error)

CreateOrg creates a new standalone CircleCI organization.

func (*Client) CreateSidecar added in v0.7.31

func (c *Client) CreateSidecar(ctx context.Context, orgID, name, image string) (*Sidecar, error)

func (*Client) CreateSnapshot added in v0.7.27

func (c *Client) CreateSnapshot(ctx context.Context, sidecarID, name string) (*Snapshot, error)

func (*Client) DeleteSidecar added in v0.7.43

func (c *Client) DeleteSidecar(ctx context.Context, sidecarID string) error

func (*Client) Exec

func (c *Client) Exec(ctx context.Context, sidecarID, command string, args []string) (*ExecResponse, error)

func (*Client) GetCommand added in v0.7.97

func (c *Client) GetCommand(ctx context.Context, commandID string) (*Command, error)

func (*Client) GetCurrentUser added in v0.7.24

func (c *Client) GetCurrentUser(ctx context.Context) error

GetCurrentUser calls GET /api/v2/me to validate the token.

func (*Client) GetProjectBySlug

func (c *Client) GetProjectBySlug(ctx context.Context, slug string) (*ProjectDetail, error)

GetProjectBySlug fetches project details by slug (e.g. "gh/org/repo").

func (*Client) GetSnapshot added in v0.7.27

func (c *Client) GetSnapshot(ctx context.Context, id string) (*Snapshot, error)

func (*Client) ListCollaborations

func (c *Client) ListCollaborations(ctx context.Context) ([]Collaboration, error)

ListCollaborations returns organizations the user belongs to.

func (*Client) ListFollowedProjects

func (c *Client) ListFollowedProjects(ctx context.Context) ([]FollowedProject, error)

ListFollowedProjects returns projects the user follows.

func (*Client) ListSidecars added in v0.7.31

func (c *Client) ListSidecars(ctx context.Context, orgID string, all bool) ([]Sidecar, error)

func (*Client) ListSnapshots added in v0.7.65

func (c *Client) ListSnapshots(ctx context.Context, orgID string) ([]Snapshot, error)

func (*Client) TriggerRun

func (c *Client) TriggerRun(ctx context.Context, orgID, projectID string, body TriggerRunRequest) (*RunResponse, error)

type Collaboration

type Collaboration struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Slug    string `json:"slug"`
	VcsType string `json:"vcs_type"`
}

Collaboration represents an org the user belongs to.

type Command added in v0.7.97

type Command struct {
	ID                string  `json:"id"`
	CreatedAt         string  `json:"created_at"`
	EndedAt           *string `json:"ended_at,omitempty"`
	ExitCode          *int    `json:"exit_code,omitempty"`
	Outcome           *string `json:"outcome,omitempty"`
	Phase             string  `json:"phase"`
	SidecarInstanceID string  `json:"sidecar_instance_id"`
}

type Config added in v0.7.29

type Config struct {
	Token   string
	BaseURL string
}

type ExecRequest

type ExecRequest struct {
	Command string   `json:"command"`
	Args    []string `json:"args,omitempty"`
}

type ExecResponse

type ExecResponse struct {
	CommandID string `json:"command_id"`
	PID       int    `json:"pid"`
	Stdout    string `json:"stdout"`
	Stderr    string `json:"stderr"`
	ExitCode  int    `json:"exit_code"`
}

type FollowedProject

type FollowedProject struct {
	Username string `json:"username"`
	Reponame string `json:"reponame"`
	VcsURL   string `json:"vcs_url"`
	VcsType  string `json:"vcs_type"`
}

FollowedProject represents a project returned by the v1.1 API.

type OrgInfo added in v0.7.119

type OrgInfo struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Slug    string `json:"slug"`
	VcsType string `json:"vcs_type"`
}

OrgInfo is the response from POST /api/v2/organization.

type ProjectDetail

type ProjectDetail struct {
	ID    string `json:"id"`
	Slug  string `json:"slug"`
	Name  string `json:"name"`
	OrgID string `json:"org_id"`
}

ProjectDetail represents detailed project info from the v2 API.

type RunResponse

type RunResponse struct {
	RunID      string `json:"runId,omitempty"`
	PipelineID string `json:"pipelineId,omitempty"`
}

type Sidecar added in v0.7.31

type Sidecar struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	OrgID string `json:"org_id"`
	Image string `json:"image,omitempty"`
}

type Snapshot added in v0.7.27

type Snapshot struct {
	ID    string `json:"id"`
	OrgID string `json:"org_id"`
	Name  string `json:"name"`
	Tag   string `json:"tag,omitempty"`
}

type StatusError added in v0.7.29

type StatusError = hc.StatusError

StatusError is an alias for the shared httpcl.StatusError type.

type TriggerRunRequest

type TriggerRunRequest struct {
	AgentType          string                 `json:"agent_type"`
	DefinitionID       string                 `json:"definition_id"`
	CheckoutBranch     string                 `json:"checkout_branch"`
	TriggerSource      string                 `json:"trigger_source"`
	TriggerType        string                 `json:"trigger_type"`
	ChunkEnvironmentID *string                `json:"chunk_environment_id,omitempty"`
	Parameters         map[string]interface{} `json:"parameters"`
	Stats              *TriggerRunStats       `json:"stats,omitempty"`
}

type TriggerRunStats

type TriggerRunStats struct {
	Prompt         string `json:"prompt"`
	CheckoutBranch string `json:"checkout_branch"`
}

Jump to

Keyboard shortcuts

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