client

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package client provides a Circle http client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// FindOrg returns an organization by slug.
	FindOrg(slug string) (*Org, error)

	// FindOrgID returns an organization by ID.
	FindOrgID(id string) (*Org, error)

	// FindProject returns a project by slug.
	FindProject(slug string) (*Project, error)

	// FindPipeline returns a pipeline by slug.
	FindPipeline(slug string) (*Pipeline, error)

	// FindConfig returns a pipeline configuration by
	// pipeline id.
	FindConfig(id string) (*Config, error)

	// ListOrgs returns the user organization list.
	ListOrgs() ([]*Org, error)

	// ListProjects returns a project list by organization id.
	ListProjects(id string) ([]*Project, error)

	// ListPipelines returns a pipeline list by pipeline slug.
	ListPipelines(slug string) ([]*Pipeline, error)

	// ListEnvs returns an environment variable list by
	// pipeline slug.
	ListEnvs(slug string) ([]*Env, error)
}

Client is used to communicate with the Circle server.

func New

func New(token string, opts ...Option) Client

New returns a new Client.

type Collab

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

Collab defines a collaboration.

type Config

type Config struct {
	Source   string `json:"source"`
	Compiled string `json:"compiled"`
}

Org defines a pipeline configuration.

type Env

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

Env defines an environment variable.

type EnvList

type EnvList struct {
	Items []*Env  `json:"items"`
	Token *string `json:"next_page_token"`
}

EnvList defines an environment variable.

type Option

type Option func(*client)

Option configures a Digital Ocean provider option.

func WithAddress

func WithAddress(address string) Option

WithAddress returns an option to set the base address.

func WithTracing

func WithTracing(tracing bool) Option

WithTracing returns an option to enable tracing.

type Org

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

Org defines an organization.

type Pipeline

type Pipeline struct {
	ID      string    `json:"id"`
	Slug    string    `json:"project_slug"`
	Number  int       `json:"number"`
	State   string    `json:"state"`
	Created time.Time `json:"created_at"`
	Updated time.Time `json:"updated_at"`
	Params  struct {
		Gitlab struct {
			ID            string `json:"project_id"`
			Name          string `json:"repo_name"`
			Remote        string `json:"repo_url"`
			DeepLink      string `json:"web_url"`
			Branch        string `json:"branch"`
			BranchDefault string `json:"default_branch"`
		} `json:"gitlab"`
	} `json:"trigger_parameters"`
}

Pipeline defines a pipeline.

type PipelineList

type PipelineList struct {
	Items []*Pipeline `json:"items"`
	Token *string     `json:"next_page_token"`
}

PipelineList defines a pipeline list.

type Project

type Project struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
	Vcs  struct {
		Link     string `json:"vcs_url"`
		Branch   string `json:"default_branch"`
		Provider string `json:"provider"`
	} `json:"vcs_info"`
}

Project defines a project.

type ProjectList

type ProjectList struct {
	Items []*Project `json:"items"`
	Token *string    `json:"next_page_token"`
}

ProjectList defines a project list.

Jump to

Keyboard shortcuts

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