circleci

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() *schema.Provider

Provider -

Types

type APIError

type APIError struct {
	HTTPStatusCode int
	Message        string
}

APIError represents an error from CircleCI

func (*APIError) Error

func (e *APIError) Error() string

type ApiClient

type ApiClient struct {
	BaseURL    *url.URL     // CircleCI API endpoint (defaults to DefaultEndpoint)
	Token      string       // CircleCI API token (needed for private repositories and mutative actions)
	HTTPClient *http.Client // HTTPClient to use for connecting to CircleCI (defaults to http.DefaultClient)

	Debug  bool   // debug logging enabled
	Logger Logger // logger to send debug messages on (if enabled), defaults to logging to stderr with the standard flags
}

func (*ApiClient) AddEnvVar

func (c *ApiClient) AddEnvVar(vcstype, account, reponame, name, value string) (*EnvVar, error)

AddEnvVar adds a new environment variable to the specified project Returns the added env var (the value will be masked)

func (*ApiClient) DeleteEnvVar

func (c *ApiClient) DeleteEnvVar(vcstype, account, reponame, name string) error

DeleteEnvVar deletes the specified environment variable from the project

func (*ApiClient) DisableProject

func (c *ApiClient) DisableProject(vcstype, account, reponame string) error

DisableProject disables a project

func (*ApiClient) FollowProject

func (c *ApiClient) FollowProject(vcstype, account, reponame string) (*Project, error)

FollowProject follows a project

func (*ApiClient) GetProject

func (c *ApiClient) GetProject(vcstype, account, reponame string) (*Project, error)

GetProject retrieves a specific project Returns nil of the project is not in the list of watched projects

func (*ApiClient) ListEnvVars

func (c *ApiClient) ListEnvVars(vcstype, account, reponame string) ([]EnvVar, error)

ListEnvVars list environment variable to the specified project Returns the env vars (the value will be masked)

func (*ApiClient) ListProjects

func (c *ApiClient) ListProjects() ([]*Project, error)

ListProjects returns the list of projects the user is watching

type EnvVar

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

EnvVar represents an environment variable

type Logger

type Logger interface {
	Printf(fmt string, args ...interface{})
}

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

type Project

type Project struct {
	Username string `json:"username"`
	Reponame string `json:"reponame"`
	VcsType  string `json:"vcs_type"`
}

Jump to

Keyboard shortcuts

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