Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateContext(org, name string) (*api.Context, error)
- func (c *Client) CreateOrUpdateContextEnvironmentVariable(ctx, variable, value string) error
- func (c *Client) CreateProjectEnvironmentVariable(org, project, name, value string) error
- func (c *Client) DeleteContext(id string) error
- func (c *Client) DeleteContextEnvironmentVariable(ctx, variable string) error
- func (c *Client) DeleteProjectEnvironmentVariable(org, project, name string) error
- func (c *Client) GetContext(id string) (*api.Context, error)
- func (c *Client) GetContextByIDOrName(org, id string) (*api.Context, error)
- func (c *Client) GetContextByName(name, org string) (*api.Context, error)
- func (c *Client) HasContextEnvironmentVariable(ctx, variable string) (bool, error)
- func (c *Client) HasProjectEnvironmentVariable(org, project, name string) (bool, error)
- func (c *Client) ListContextEnvironmentVariables(ctx string) (*[]api.EnvironmentVariable, error)
- func (c *Client) Organization(org string) (string, error)
- func (c *Client) Slug(org, project string) (string, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
var ErrContextNotFound = errors.New("context not found")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides access to the CircleCI REST API It uses upstream client functionality where possible and defines its own methods as needed
func (*Client) CreateContext ¶
CreateContext creates a new context and returns the created context object
func (*Client) CreateOrUpdateContextEnvironmentVariable ¶ added in v0.6.0
CreateOrUpdateContextEnvironmentVariable creates a new context environment variable
func (*Client) CreateProjectEnvironmentVariable ¶
CreateProjectEnvironmentVariable creates a new project environment variable
func (*Client) DeleteContext ¶
func (*Client) DeleteContextEnvironmentVariable ¶
DeleteContextEnvironmentVariable deletes a context environment variable by context ID and name
func (*Client) DeleteProjectEnvironmentVariable ¶
DeleteProjectEnvironmentVariable deletes an existing project environment variable
func (*Client) GetContext ¶
GetContext gets an existing context by its ID (UUID)
func (*Client) GetContextByIDOrName ¶
GetContextByIDOrName gets a context by ID if a UUID is specified, and by name otherwise
func (*Client) GetContextByName ¶
GetContextByName gets an existing context by its name
func (*Client) HasContextEnvironmentVariable ¶
HasContextEnvironmentVariable lists all environment variables for a given context and checks whether the specified variable is defined. If either the context or the variable does not exist, it returns false.
func (*Client) HasProjectEnvironmentVariable ¶
HasProjectEnvironmentVariable checks for the existence of a matching project environment variable by name
func (*Client) ListContextEnvironmentVariables ¶
func (c *Client) ListContextEnvironmentVariables(ctx string) (*[]api.EnvironmentVariable, error)
ListContextEnvironmentVariables lists all environment variables for a given context
func (*Client) Organization ¶
Organization returns the organization for a request. If an organization is provided, that is returned. Next, an organization configured in the provider is returned. If neither are set, an error is returned.