Documentation ¶
Index ¶
- func EnvEndpointHost() (string, string)
- func GraphQLServerAddress(endpoint string, host string) (string, error)
- func OrbID(ctx context.Context, logger *logger.Logger, namespace string, orb string) (string, error)
- func OrbLatestVersion(ctx context.Context, logger *logger.Logger, namespace string, orb string) (string, error)
- func OrbSource(ctx context.Context, logger *logger.Logger, namespace string, orb string) (string, error)
- type ConfigResponse
- type CreateNamespaceResponse
- type CreateOrbResponse
- type GQLResponseErrors
- type Orb
- type OrbPromoteResponse
- type OrbPublishResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvEndpointHost ¶ added in v0.1.1430
EnvEndpointHost pulls the endpoint and host values from viper
func GraphQLServerAddress ¶ added in v0.1.1418
GraphQLServerAddress returns the full address to CircleCI GraphQL API server
func OrbID ¶ added in v0.1.1813
func OrbID(ctx context.Context, logger *logger.Logger, namespace string, orb string) (string, error)
OrbID fetches an orb returning the ID
Types ¶
type ConfigResponse ¶
type ConfigResponse struct { Valid bool SourceYaml string OutputYaml string GQLResponseErrors }
ConfigResponse 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.
func ConfigQuery ¶
func ConfigQuery(ctx context.Context, logger *logger.Logger, configPath string) (*ConfigResponse, error)
ConfigQuery calls the GQL API to validate and process config
type CreateNamespaceResponse ¶
type CreateNamespaceResponse struct { Namespace struct { CreatedAt string ID string } GQLResponseErrors }
CreateNamespaceResponse type matches the data shape of the GQL response for creating a namespace
type CreateOrbResponse ¶
type CreateOrbResponse struct { Orb struct { ID string } GQLResponseErrors }
CreateOrbResponse type matches the data shape of the GQL response for creating an orb
type GQLResponseErrors ¶
type GQLResponseErrors struct { Errors []struct { Message string } }
GQLResponseErrors is a slice of errors returned by the GraphQL server. Each error message is a key-value pair with the structure "Message: string"
func (GQLResponseErrors) ToError ¶
func (response GQLResponseErrors) ToError() error
ToError returns all GraphQL errors for a single response concatenated, or nil.
type Orb ¶ added in v0.1.1845
type Orb struct { Commands map[string]struct{} Jobs map[string]struct{} Executors map[string]struct{} }
Orb is a struct for containing the yaml-unmarshaled contents of an orb
func ListNamespaceOrbs ¶ added in v0.1.1845
ListNamespaceOrbs queries the API to find all orbs belonging to the given namespace. Prints the orbs and their jobs and commands to the supplied logger.
type OrbPromoteResponse ¶ added in v0.1.1813
type OrbPromoteResponse struct { Orb struct { CreatedAt string Version string Source string } GQLResponseErrors }
The OrbPromoteResponse type matches the data shape of the GQL response for promoting an orb.
type OrbPublishResponse ¶ added in v0.1.1813
type OrbPublishResponse struct { Orb struct { CreatedAt string Version string } GQLResponseErrors }
The OrbPublishResponse type matches the data shape of the GQL response for publishing an orb.