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, orbRef string) (string, error)
- type ConfigResponse
- type CreateNamespaceResponse
- type CreateOrbResponse
- type GQLResponseErrors
- type IntrospectionResponse
- type Orb
- func OrbIncrementVersion(ctx context.Context, logger *logger.Logger, configPath string, ...) (*Orb, error)
- func OrbPromote(ctx context.Context, logger *logger.Logger, namespace string, orb string, ...) (*Orb, error)
- func OrbPublishByID(ctx context.Context, logger *logger.Logger, configPath string, orbID string, ...) (*Orb, error)
- type OrbCollection
- type OrbPromoteResponse
- type OrbPublishResponse
- type OrbVersion
- type WhoamiResponse
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
func OrbLatestVersion ¶ added in v0.1.1813
func OrbLatestVersion(ctx context.Context, logger *logger.Logger, namespace string, orb string) (string, error)
OrbLatestVersion finds the latest published version of an orb and returns it. If it doesn't find a version, it will return 0.0.0 for the orb's version
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 Orb 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 IntrospectionResponse ¶ added in v0.1.2001
type IntrospectionResponse struct { Schema struct { MutationType struct { Name string } QueryType struct { Name string } Types []struct { Description string Fields []struct { Name string } Kind string Name string } } `json:"__schema"` }
IntrospectionResponse matches the result from making an introspection query
func IntrospectionQuery ¶ added in v0.1.2001
IntrospectionQuery makes a query on the API asking for bits of the schema This query isn't intended to get the entire schema, there are better tools for that.
type Orb ¶ added in v0.1.1845
type Orb struct { ID string `json:"-"` Name string `json:"name"` Namespace string `json:"-"` CreatedAt string `json:"-"` Source string `json:"-"` // Avoid "Version" since there is a "version" key in the orb source referring // to the orb schema version HighestVersion string `json:"version"` Version string `json:"-"` Commands map[string]struct{} `json:"-"` Jobs map[string]struct{} `json:"-"` Executors map[string]struct{} `json:"-"` Versions []OrbVersion `json:"versions"` }
Orb is a struct for containing the yaml-unmarshaled contents of an orb
func OrbIncrementVersion ¶ added in v0.1.1813
func OrbIncrementVersion(ctx context.Context, logger *logger.Logger, configPath string, namespace string, orb string, segment string) (*Orb, error)
OrbIncrementVersion accepts an orb and segment to increment the orb.
func OrbPromote ¶ added in v0.1.1813
func OrbPromote(ctx context.Context, logger *logger.Logger, namespace string, orb string, label string, segment string) (*Orb, error)
OrbPromote takes an orb and a development version and increments a semantic release with the given segment.
type OrbCollection ¶ added in v0.1.2331
type OrbCollection struct { Orbs []Orb `json:"orbs"` Namespace string `json:"namespace,omitempty"` }
OrbCollection is a container type for multiple orbs to share formatting functions on them.
func ListNamespaceOrbs ¶ added in v0.1.1845
func ListNamespaceOrbs(ctx context.Context, logger *logger.Logger, namespace string) (*OrbCollection, error)
ListNamespaceOrbs queries the API to find all orbs belonging to the given namespace. Returns a collection of Orb objects containing their relevant data. Logs request and parse errors to the supplied logger.
func ListOrbs ¶ added in v0.1.2113
ListOrbs queries the API to find all orbs. Returns a collection of Orb objects containing their relevant data. Logs request and parse errors to the supplied logger.
func (OrbCollection) String ¶ added in v0.1.2331
func (orbCollection OrbCollection) String() string
String returns a text representation of all Orbs, intended for direct human use rather than machine use.
type OrbPromoteResponse ¶ added in v0.1.1813
type OrbPromoteResponse struct { Orb Orb 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 Orb GQLResponseErrors }
The OrbPublishResponse type matches the data shape of the GQL response for publishing an orb.
type OrbVersion ¶ added in v0.1.2331
OrbVersion represents a single orb version and its source
type WhoamiResponse ¶ added in v0.1.2295
type WhoamiResponse struct { Me struct { Name string } GQLResponseErrors }
WhoamiResponse type matches the data shape of the GQL response for the current user
func WhoamiQuery ¶ added in v0.1.2295
WhoamiQuery returns the result of querying the `/me` endpoint of the API