Categorygithub.com/jszwedko/go-circleci
modulepackage
0.4.0
Repository: https://github.com/jszwedko/go-circleci.git
Documentation: pkg.go.dev

# README

go-circleci

GoDoc Circle CI Go Report Card coverage

Go library for interacting with CircleCI's API. Supports all current API endpoints allowing you do do things like:

  • Query for recent builds
  • Get build details
  • Retry builds
  • Manipulate checkout keys, environment variables, and other settings for a project

The CircleCI HTTP API response schemas are not well documented so please file an issue if you run into something that doesn't match up.

Example usage:

package main

import (
        "fmt"

        "github.com/jszwedko/go-circleci"
)

func main() {
        client := &circleci.Client{Token: "YOUR TOKEN"} // Token not required to query info for public projects

        builds, _ := client.ListRecentBuildsForProject("jszwedko", "circleci-cli", "master", "", -1, 0)

        for _, build := range builds {
                fmt.Printf("%d: %s\n", build.BuildNum, build.Status)
        }
}

For the CLI that uses this library (or to see more example usages), please see circleci-cli.

See GoDoc for API usage.

Feature requests and issues welcome!

# Constants

VcsType constants (github and bitbucket are the currently supported choices).
VcsType constants (github and bitbucket are the currently supported choices).

# Structs

Action represents an individual action within a build step.
APIError represents an error from CircleCI.
Artifact represents a build artifact.
AWSConfig represents AWS configuration for a project.
AWSKeypair represents the AWS access/secret key for a project SecretAccessKey will be a masked value.
Branch represents a repository branch.
Build represents the details of a build.
BuildAgent represents an agent's information.
BuildAgentProperties represents agent properties.
BuildByProjectResponse is the shape of the response body from the trigger build by project endpoint.
BuildStatus represents status information about the build Used when a short summary of previous builds is included.
BuildSummary represents the subset of build information returned with a Project.
BuildUser represents the user that triggered the build.
CheckoutKey represents an SSH checkout key for a project.
CircleYML represents the serialized CircleCI YML file for a given build.
Client is a CircleCI client Its zero value is a usable client for examining public CircleCI repositories.
CommitDetails represents information about a commit returned with other structs.
EnvVar represents an environment variable.
No description provided by the author
Message represents build messages.
Node represents the node a build was run on.
Output represents the output of a given action.
Picard represents metadata about an execution environment.
Project represents information about a project.
PublicSSHKey represents the public part of an SSH key associated with a project PrivateKey will be a masked value.
PullRequest represents a pull request.
ResourceClass represents usable resource information for a job.
SSHUser represents a user associated with an build with SSH enabled.
Step represents an individual step in a build Will contain more than one action if the step was parallelized.
TestMetadata represents metadata collected from the test run (e.g.
User represents a CircleCI user.
UserProject returns the selective project information included when querying for a User.
Workflow represents the details of the workflow for a build.

# Interfaces

Logger is a minimal interface for injecting custom logging logic for debug logs.

# Type aliases

VcsType represents the version control system type.