Documentation
¶
Index ¶
- func CreateEnvVarWithGQL(c *graphql.Client, params CreateEnvVarWithRestParams) error
- func DeleteContextWithGQL(c *graphql.Client, contextID string) error
- func DeleteEnvVarWithGQL(c *graphql.Client, params DeleteEnvVarWithRestParams) error
- func IsRestAPIAvailable(c restClient) error
- type Context
- func CreateContextWithGQL(c *graphql.Client, params CreateContextWithGQLParams) (Context, error)
- func CreateContextWithRest(client *rest.Client, params CreateContextWithRestParams) (Context, error)
- func ListAllContextsWithRest(client *rest.Client, params ListContextsWithRestParams) ([]Context, error)
- func ListContextsWithGQL(c *graphql.Client, params ListContextsWithGQLParams) ([]Context, error)
- type ContextInterface
- type CreateContextWithGQLParams
- type CreateContextWithRestParams
- type CreateEnvVarWithGQLParams
- type CreateEnvVarWithRestParams
- type DeleteContextWithRestResponse
- type DeleteEnvVarWithGQLParams
- type DeleteEnvVarWithRestParams
- type DeleteEnvVarWithRestResponse
- type EnvironmentVariable
- func CreateEnvVarWithRest(client *rest.Client, params CreateEnvVarWithRestParams) (EnvironmentVariable, error)
- func ListAllEnvVarsWithRest(client *rest.Client, params ListEnvVarsWithRestParams) ([]EnvironmentVariable, error)
- func ListEnvVarsWithGQL(c *graphql.Client, contextID string) ([]EnvironmentVariable, error)
- type ListContextsResponse
- type ListContextsWithGQLParams
- type ListContextsWithRestParams
- type ListEnvVarsResponse
- type ListEnvVarsWithRestParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEnvVarWithGQL ¶
func CreateEnvVarWithGQL(c *graphql.Client, params CreateEnvVarWithRestParams) error
func DeleteEnvVarWithGQL ¶
func DeleteEnvVarWithGQL(c *graphql.Client, params DeleteEnvVarWithRestParams) error
func IsRestAPIAvailable ¶
func IsRestAPIAvailable(c restClient) error
Types ¶
type Context ¶
type Context struct {
CreatedAt time.Time `json:"created_at"`
ID string `json:"id"`
Name string `json:"name"`
}
A Context is the owner of EnvironmentVariables.
func CreateContextWithGQL ¶
func CreateContextWithGQL(c *graphql.Client, params CreateContextWithGQLParams) (Context, error)
func CreateContextWithRest ¶
func CreateContextWithRest(client *rest.Client, params CreateContextWithRestParams) (Context, error)
Creates a new context. Binding to https://circleci.com/docs/api/v2/index.html#operation/createContext
func ListAllContextsWithRest ¶
func ListAllContextsWithRest(client *rest.Client, params ListContextsWithRestParams) ([]Context, error)
Gets all pages of ListContexts
func ListContextsWithGQL ¶
func ListContextsWithGQL(c *graphql.Client, params ListContextsWithGQLParams) ([]Context, error)
type ContextInterface ¶
type ContextInterface interface {
Contexts() ([]Context, error)
ContextByName(name string) (Context, error)
CreateContext(name string) error
DeleteContext(contextID string) error
EnvironmentVariables(contextID string) ([]EnvironmentVariable, error)
CreateEnvironmentVariable(contextID, variable, value string) error
DeleteEnvironmentVariable(contextID, variable string) error
}
ContextInterface is the interface to interact with contexts and environment variables.
func NewContextClient ¶
func NewContextClient(config *settings.Config, orgID, vcsType, orgName string) ContextInterface
type DeleteContextWithRestResponse ¶
type DeleteContextWithRestResponse struct {
Message string `json:"message"`
}
func DeleteContextWithRest ¶
func DeleteContextWithRest(client *rest.Client, contextID string) (DeleteContextWithRestResponse, error)
func DeleteEnvVarWithRest ¶
func DeleteEnvVarWithRest(client *rest.Client, params DeleteEnvVarWithRestParams) (DeleteContextWithRestResponse, error)
type DeleteEnvVarWithRestResponse ¶
type DeleteEnvVarWithRestResponse struct {
Message string `json:"message"`
}
type EnvironmentVariable ¶
type EnvironmentVariable struct {
Variable string `json:"variable"`
ContextID string `json:"context_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
An EnvironmentVariable has a Variable, a ContextID (its owner), and a CreatedAt date.
func CreateEnvVarWithRest ¶
func CreateEnvVarWithRest(client *rest.Client, params CreateEnvVarWithRestParams) (EnvironmentVariable, error)
func ListAllEnvVarsWithRest ¶
func ListAllEnvVarsWithRest(client *rest.Client, params ListEnvVarsWithRestParams) ([]EnvironmentVariable, error)
func ListEnvVarsWithGQL ¶
func ListEnvVarsWithGQL(c *graphql.Client, contextID string) ([]EnvironmentVariable, error)
type ListContextsResponse ¶
type ListContextsResponse struct {
Items []Context `json:"items"`
NextPageToken string `json:"next_page_token"`
}
func ListContextsWithRest ¶
func ListContextsWithRest(client *rest.Client, params ListContextsWithRestParams) (ListContextsResponse, error)
List all contexts for an owner. Binding to https://circleci.com/docs/api/v2/index.html#operation/listContexts
type ListEnvVarsResponse ¶
type ListEnvVarsResponse struct {
Items []EnvironmentVariable `json:"items"`
NextPageToken string `json:"next_page_token"`
}
func ListEnvVarsWithRest ¶
func ListEnvVarsWithRest(client *rest.Client, params ListEnvVarsWithRestParams) (ListEnvVarsResponse, error)
Click to show internal directories.
Click to hide internal directories.