Documentation ¶
Overview ¶
Package backstage supports vervet's integration with Backstage to automatically populate API definitions in the catalog info from compiled versions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { APIVersion string `json:"apiVersion" yaml:"apiVersion"` Kind string `json:"kind" yaml:"kind"` Metadata Metadata `json:"metadata" yaml:"metadata"` Spec APISpec `json:"spec" yaml:"spec"` }
API represents a Backstage API entity document.
type APISpec ¶
type APISpec struct { Type string `json:"type" yaml:"type"` Lifecycle string `json:"lifecycle" yaml:"lifecycle"` Owner string `json:"owner" yaml:"owner"` System string `json:"system,omitempty" yaml:"system,omitempty"` Definition DefinitionRef `json:"definition" yaml:"definition"` }
APISpec represents a Backstage API entity spec.
type CatalogInfo ¶
type CatalogInfo struct { VervetAPIs []*API // contains filtered or unexported fields }
CatalogInfo models the Backstage catalog-info.yaml file at the top-level of a project.
func LoadCatalogInfo ¶
func LoadCatalogInfo(r io.Reader) (*CatalogInfo, error)
LoadCatalogInfo loads a catalog info from a reader.
func (*CatalogInfo) LoadVervetAPIs ¶
func (c *CatalogInfo) LoadVervetAPIs(root, versions string, pivotDate time.Time) error
LoadVervetAPIs loads all the compiled versioned OpenAPI specs and adds them to the catalog as API components.
type Component ¶
type Component struct { APIVersion string `json:"apiVersion" yaml:"apiVersion"` Kind string `json:"kind" yaml:"kind"` Metadata Metadata `json:"metadata" yaml:"metadata"` Spec ComponentSpec `json:"spec" yaml:"spec"` }
Component represents a Backstage Component entity document.
type ComponentSpec ¶
type ComponentSpec struct { Type string `json:"type" yaml:"type"` Owner string `json:"owner" yaml:"owner"` ProvidesAPIs []string `json:"providesApis" yaml:"providesApis"` }
ComponentSpec represents a Backstage Component entity spec.
type DefinitionRef ¶
type DefinitionRef struct {
Text string `json:"$text" yaml:"$text"`
}
DefinitionRef represents a reference to a local file in the project.
type Metadata ¶
type Metadata struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` Title string `json:"title,omitempty" yaml:"title,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Metadata represents Backstage entity metadata.