Documentation
¶
Index ¶
- Variables
- func GetOrgIdFromSlug(slug string, collaborations []CollaborationResult) string
- type BuildConfigResponse
- type CollaborationResult
- type CompileConfigRequest
- type ConfigCompiler
- func (c *ConfigCompiler) ConfigQuery(configPath string, orgID string, params Parameters, values Values) (*ConfigResponse, error)
- func (c *ConfigCompiler) GetOrgCollaborations() ([]CollaborationResult, error)
- func (c *ConfigCompiler) ProcessConfig(opts ProcessConfigOpts) error
- func (c *ConfigCompiler) ValidateConfig(opts ValidateConfigOpts) error
- type ConfigError
- type ConfigResponse
- type GQLErrorsCollection
- type GQLResponseError
- type KeyVal
- type LegacyConfigResponse
- type Options
- type Parameters
- type ProcessConfigOpts
- type ValidateConfigOpts
- type Values
Constants ¶
This section is empty.
Variables ¶
var (
CollaborationsPath = "me/collaborations"
)
var (
// Making this the one true source for default config path
DefaultConfigPath = ".circleci/config.yml"
)
Functions ¶
func GetOrgIdFromSlug ¶ added in v0.1.25569
func GetOrgIdFromSlug(slug string, collaborations []CollaborationResult) string
GetOrgIdFromSlug - converts a slug into an orgID.
Types ¶
type BuildConfigResponse ¶ added in v0.1.26061
type BuildConfigResponse struct {
BuildConfig struct {
LegacyConfigResponse
}
}
BuildConfigResponse wraps the GQL result of the ConfigQuery
type CollaborationResult ¶ added in v0.1.25569
type CompileConfigRequest ¶
type CompileConfigRequest struct {
ConfigYaml string `json:"config_yaml"`
Options Options `json:"options"`
}
CompileConfigRequest - the structure of the data we send to the downstream compilation service.
type ConfigCompiler ¶ added in v0.1.25569
type ConfigCompiler struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.1.25569
func New(cfg *settings.Config) *ConfigCompiler
func (*ConfigCompiler) ConfigQuery ¶ added in v0.1.25569
func (c *ConfigCompiler) ConfigQuery( configPath string, orgID string, params Parameters, values Values, ) (*ConfigResponse, error)
ConfigQuery - attempts to compile or validate a given config file with the passed in params/values. If the orgID is passed in, the config-compilation with private orbs should work.
func (*ConfigCompiler) GetOrgCollaborations ¶ added in v0.1.25569
func (c *ConfigCompiler) GetOrgCollaborations() ([]CollaborationResult, error)
GetOrgCollaborations - fetches all the collaborations for a given user.
func (*ConfigCompiler) ProcessConfig ¶ added in v0.1.25569
func (c *ConfigCompiler) ProcessConfig(opts ProcessConfigOpts) error
func (*ConfigCompiler) ValidateConfig ¶ added in v0.1.25569
func (c *ConfigCompiler) ValidateConfig(opts ValidateConfigOpts) error
The <path> arg is actually optional, in order to support compatibility with the --path flag.
type ConfigError ¶
type ConfigError struct {
Message string `json:"message"`
}
type ConfigResponse ¶
type ConfigResponse struct {
Valid bool `json:"valid"`
SourceYaml string `json:"source-yaml"`
OutputYaml string `json:"output-yaml"`
Errors []ConfigError `json:"errors"`
}
ConfigResponse - the structure of what is returned from the downstream compilation endpoint
type GQLErrorsCollection ¶ added in v0.1.26061
type GQLErrorsCollection []GQLResponseError
GQLErrorsCollection is a slice of errors returned by the GraphQL server. Each error is made up of a GQLResponseError type.
func (GQLErrorsCollection) Error ¶ added in v0.1.26061
func (errs GQLErrorsCollection) Error() string
Error turns a GQLErrorsCollection into an acceptable error string that can be printed to the user.
type GQLResponseError ¶ added in v0.1.26061
type GQLResponseError struct {
Message string
Value string
AllowedValues []string
EnumType string
Type string
}
GQLResponseError is a mapping of the data returned by the GraphQL server of key-value pairs. Typically used with the structure "Message: string", but other response errors provide additional fields.
type KeyVal ¶ added in v0.1.26061
type KeyVal struct {
Key string `json:"key"`
Val interface{} `json:"val"`
}
KeyVal is a data structure specifically for passing pipeline data to GraphQL which doesn't support free-form maps.
func PrepareForGraphQL ¶ added in v0.1.26061
PrepareForGraphQL takes a golang homogenous map, and transforms it into a list of keyval pairs, since GraphQL does not support homogenous maps.
type LegacyConfigResponse ¶ added in v0.1.26061
type LegacyConfigResponse struct {
Valid bool
SourceYaml string
OutputYaml string
Errors GQLErrorsCollection
}
LegacyConfigResponse is a structure that matches the result of the GQL query, so that we can use mapstructure to convert from nested maps to a strongly typed struct.
type Parameters ¶ added in v0.1.25569
type Parameters map[string]interface{}
Static typing is bypassed using an empty interface here due to pipeline parameters supporting multiple types.
type ProcessConfigOpts ¶ added in v0.1.25569
type ValidateConfigOpts ¶ added in v0.1.25569
type Values ¶ added in v0.1.25569
type Values map[string]interface{}
CircleCI provides various `<< pipeline.x >>` values to be used in your config, but sometimes we need to fabricate those values when validating config.
func LocalPipelineValues ¶ added in v0.1.25569
func LocalPipelineValues() Values
vars should contain any pipeline parameters that should be accessible via << pipeline.parameters.foo >>