Documentation ¶
Index ¶
- func OrbLatestVersion(opts Options, namespace string, orb string) (string, error)
- func OrbSource(opts Options, orbRef string) (string, error)
- type BuildConfigResponse
- type ConfigResponse
- type CreateNamespaceResponse
- type CreateOrbResponse
- type GQLErrorsCollection
- type GQLResponseError
- type GetNamespaceResponse
- type GetOrganizationResponse
- type IntrospectionResponse
- type NamespaceOrbResponse
- type Options
- type Orb
- func OrbIncrementVersion(opts Options, configPath string, namespace string, orb string, segment string) (*Orb, error)
- func OrbPromote(opts Options, namespace string, orb string, label string, segment string) (*Orb, error)
- func OrbPublishByID(opts Options, configPath string, orbID string, orbVersion string) (*Orb, error)
- type OrbConfigResponse
- type OrbElement
- type OrbElementParameter
- type OrbIDResponse
- type OrbLatestVersionResponse
- type OrbListResponse
- type OrbPromoteResponse
- type OrbPublishResponse
- type OrbVersion
- type OrbWithData
- type OrbsForListing
- type RealOrbElement
- type WhoamiResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OrbLatestVersion ¶ added in v0.1.1813
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 BuildConfigResponse ¶ added in v0.1.2969
type BuildConfigResponse struct { BuildConfig struct { ConfigResponse } }
BuildConfigResponse wraps the GQL result of the ConfigQuery
type ConfigResponse ¶
type ConfigResponse struct { Valid bool SourceYaml string OutputYaml string Errors GQLErrorsCollection }
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(opts Options, configPath string) (*ConfigResponse, error)
ConfigQuery calls the GQL API to validate and process config
type CreateNamespaceResponse ¶
type CreateNamespaceResponse struct { CreateNamespace struct { Namespace struct { CreatedAt string ID string } Errors GQLErrorsCollection } }
CreateNamespaceResponse type matches the data shape of the GQL response for creating a namespace
func CreateNamespace ¶
func CreateNamespace(opts Options, name string, organizationName string, organizationVcs string) (*CreateNamespaceResponse, error)
CreateNamespace creates (reserves) a namespace for an organization
type CreateOrbResponse ¶
type CreateOrbResponse struct { CreateOrb struct { Orb Orb Errors GQLErrorsCollection } }
CreateOrbResponse type matches the data shape of the GQL response for creating an orb
type GQLErrorsCollection ¶ added in v0.1.2969
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.2969
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.2969
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 GetNamespaceResponse ¶ added in v0.1.2969
type GetNamespaceResponse struct { RegistryNamespace struct { ID string } }
GetNamespaceResponse type wraps the GQL response for fetching a namespace
type GetOrganizationResponse ¶ added in v0.1.2969
type GetOrganizationResponse struct { Organization struct { ID string } }
GetOrganizationResponse type wraps the GQL response for fetching an organization and ID.
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
func IntrospectionQuery(opts Options) (*IntrospectionResponse, error)
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 NamespaceOrbResponse ¶ added in v0.1.2969
type NamespaceOrbResponse struct { RegistryNamespace struct { Name string Orbs struct { Edges []struct { Cursor string Node OrbWithData } TotalCount int PageInfo struct { HasNextPage bool } } } }
NamespaceOrbResponse type matches the result from GQL. So that we can use mapstructure to convert from nested maps to a strongly typed struct.
type Options ¶ added in v0.1.3807
Options wraps common requirements for API functions into a single struct.
type Orb ¶ added in v0.1.1845
type Orb struct { ID string Name string Namespace string CreatedAt string Source string HighestVersion string `json:"version"` Commands map[string]OrbElement Jobs map[string]OrbElement Executors map[string]OrbElement Versions []OrbVersion }
Orb is a struct for containing the yaml-unmarshaled contents of an orb
func OrbIncrementVersion ¶ added in v0.1.1813
func OrbIncrementVersion(opts Options, configPath string, namespace string, orb string, segment string) (*Orb, error)
OrbIncrementVersion accepts an orb and segment to increment the orb.
type OrbConfigResponse ¶ added in v0.1.2969
type OrbConfigResponse struct { OrbConfig struct { ConfigResponse } }
OrbConfigResponse wraps the GQL result for OrbQuery.
type OrbElement ¶ added in v0.1.3541
type OrbElement RealOrbElement
OrbElement implements RealOrbElement interface and allows us to deserialize by hand.
func (*OrbElement) UnmarshalYAML ¶ added in v0.1.4180
func (orbElement *OrbElement) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML method allows OrbElement to be a string or a map. For now, don't even try to dereference the string, just return what is essentially an empty OrbElement (no description or parameters)
type OrbElementParameter ¶ added in v0.1.3541
type OrbElementParameter struct { Description string `json:"-"` Type string `json:"-"` Default interface{} `json:"-"` }
OrbElementParameter represents the yaml-unmarshled contents of a parameter for a command/job/executor
type OrbIDResponse ¶ added in v0.1.2969
OrbIDResponse matches the GQL response for fetching an Orb and ID
type OrbLatestVersionResponse ¶ added in v0.1.2969
type OrbLatestVersionResponse struct { Orb struct { Versions []OrbVersion } }
OrbLatestVersionResponse wraps the GQL result of fetching an Orb and latest version
type OrbListResponse ¶ added in v0.1.2969
type OrbListResponse struct { Orbs struct { TotalCount int Edges []struct { Cursor string Node OrbWithData } PageInfo struct { HasNextPage bool } } }
OrbListResponse type matches the result from GQL. So that we can use mapstructure to convert from nested maps to a strongly typed struct.
type OrbPromoteResponse ¶ added in v0.1.1813
type OrbPromoteResponse struct { PromoteOrb struct { Orb Orb Errors GQLErrorsCollection } }
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 { PublishOrb struct { Orb Orb Errors GQLErrorsCollection } }
The OrbPublishResponse type matches the data shape of the GQL response for publishing an orb.
type OrbVersion ¶ added in v0.1.2331
OrbVersion wraps the GQL result used by OrbSource and OrbInfo
type OrbWithData ¶ added in v0.1.3923
type OrbWithData struct { Name string `json:"name"` HighestVersion string `json:"version"` Versions []struct { Version string `json:"version"` Source string `json:"source"` } `json:"versions"` // These fields are printing manually when --details flag is added so hidden from JSON output. Commands map[string]OrbElement `json:"-"` Jobs map[string]OrbElement `json:"-"` Executors map[string]OrbElement `json:"-"` }
OrbWithData wraps an orb with select fields for deserializing into JSON.
type OrbsForListing ¶ added in v0.1.3923
type OrbsForListing struct { Orbs []OrbWithData `json:"orbs"` Namespace string `json:"namespace,omitempty"` }
OrbsForListing is a container type for multiple orbs that includes the namespace and orbs for deserializing back into JSON.
func ListNamespaceOrbs ¶ added in v0.1.1845
func ListNamespaceOrbs(opts Options, namespace string) (*OrbsForListing, 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.
type RealOrbElement ¶ added in v0.1.4180
type RealOrbElement struct { Description string `json:"-"` Parameters map[string]OrbElementParameter `json:"-"` }
RealOrbElement represents the yaml-unmarshled contents of a named element under a command/job/executor
type WhoamiResponse ¶ added in v0.1.2295
type WhoamiResponse struct { Me struct { Name string } }
WhoamiResponse type matches the data shape of the GQL response for the current user
func WhoamiQuery ¶ added in v0.1.2295
func WhoamiQuery(opts Options) (*WhoamiResponse, error)
WhoamiQuery returns the result of querying the `/me` endpoint of the API