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

circleci

package
v8.149.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package circleci mocks the CircleCI API v2 and CircleCI's OAuth issuer on one server: DEVCTL_CIRCLECI_API_URL is the server's URL plus APIPrefix, the path circleci.com serves the API under, and DEVCTL_CIRCLECI_OAUTH_URL is the server's URL. Every response comes from the scenario's route sequences, keyed by the full path ("GET /api/v2/project/gh/owner/repo/pipeline").

Index

Constants

View Source
const APIPrefix = "/api/v2"

APIPrefix is the path the API v2 lives under.

Variables

View Source
var NotFound = sequence.Response{
	Status: http.StatusNotFound,
	Body:   map[string]any{"message": "Not Found"},
}

NotFound is what an unscripted route answers, the way circleci.com does.

Functions

This section is empty.

Types

type Server

type Server struct {
	*httptest.Server
	// contains filtered or unexported fields
}

Server is a running mock.

func Start

func Start(routes sequence.Routes) (*Server, error)

Start serves the routes on a loopback port until Close.

func (*Server) APIURL

func (s *Server) APIURL() string

APIURL is the value of DEVCTL_CIRCLECI_API_URL.

func (*Server) Requests

func (s *Server) Requests() []sequence.Request

Requests are the requests received so far.

Jump to

Keyboard shortcuts

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